macOS 上编译 Dynamips

Dynamips 是一个Cisco 路由器模拟软件。
安装过程:

git clone git://github.com/GNS3/dynamips.git
cd dynamips
mkdir build
cd build
cmake ..

对于 macOS,需要准备好 cmake 和 libelf。

如果遇到报错:

CMake Error at /usr/local/Cellar/cmake/3.10.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find LibElf (missing: LIBELF_LIBRARIES LIBELF_INCLUDE_DIRS)

就是没有找到LibElf库,可以用命令安装:

brew install libelf

若要构建稳定发布版本

cmake .. -DDYNAMIPS_CODE=stable

如果发生错误,可以尝试指定 C 编译器的路径,可用 xcrun 命令找到相应的编译器的路径:

cmake ..  -DCMAKE_C_COMPILER=`xcrun -find cc`

最后编译安装 Dynamips

make install

猜你喜欢

转载自www.cnblogs.com/flipped/p/9022510.html