我正在尝试在 mac os X 10.11 上编译需要 boost、GMP 和 MPFR 的 plll 库。
我已经通过自制软件安装了 boost、GMP 和 MPFR,然后我在 plll 的 dir build 中启动了 cmake,但我得到了那个错误:
By not providing "FindMPFR.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "MPFR", but
CMake did not find one.
Could not find a package configuration file provided by "MPFR" with any of
the following names:
MPFRConfig.cmake
mpfr-config.cmake
Add the installation prefix of "MPFR" to CMAKE_PREFIX_PATH or set
"MPFR_DIR" to a directory containing one of the above files. If "MPFR"
provides a separate development package or SDK, be sure it has been
installed.
如果我在 cmake 使用的 Librairies.txt 中更改 GMP 和 MPFR 的顺序,则 GMP 也是如此。
之后,我手动安装了这些库,它们位于/usr/local/include 中。GMP的make检查很完美,所以我猜安装没问题。
但仍然是相同的错误消息。我也尝试添加一个 FindMPFR.cmake 文件,但根本没有任何变化。
这是 Libraries.txt 中涉及的部分:
find_package(MPFR REQUIRED)
include_directories(${MPFR_INCLUDES})
if(NOT MPFR_FOUND)
message(FATAL_ERROR "Could not find MPFR!")
endif(NOT MPFR_FOUND)
set(libraries ${libraries} ${MPFR_LIBRARIES})
set(libraries_shared ${libraries_shared} ${MPFR_LIBRARIES})
find_package(GMP REQUIRED)
include_directories(${GMP_INCLUDE_DIR})
if(NOT (GMP_INCLUDE_DIR AND GMP_LIBRARIES))
message(FATAL_ERROR "Could not find GMP!")
endif(NOT (GMP_INCLUDE_DIR AND GMP_LIBRARIES))
set(libraries ${libraries} ${GMP_LIBRARIES})
set(libraries_shared ${libraries_shared} ${GMP_LIBRARIES})
奇怪的是,我对 Boost 没有任何问题……