Could NOT find Boost (missing: python) on macOS - macos

ERROR INF:
-- Could NOT find Boost (missing: python) (found version "1.71.0")
I've tried everything I found in here, and nothing works.
Here is what I've done:
Firstly, I've installed boost, boost_python and boost_python3 through brew install.
However, I noticed that in boost dir there are "include" and "lib" dirs, but there is only "lib" in boost_python and boost_python3, which I don't understand.
Run cmake as below:
CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake
-DCMAKE_BUILD_TYPE="Release"
-DBUILD_QT5=1
-DCMAKE_PREFIX_PATH="/usr/local/Cellar/qt/5.13.1/lib/cmake"
-DFREECAD_USE_EXTERNAL_KDL=1
-DBUILD_FEM_NETGEN=1
-DFREECAD_CREATE_MAC_APP=1
-DCMAKE_INSTALL_PREFIX="./.."
-DPYTHON_LIBRARY=$ANACONDA_HOME/lib/libpython3.7.so
-DPYTHON_INCLUDE_DIR=$ANACONDA_HOME/include/python3.7
-DPYTHON_EXECUTABLE=$ANACONDA_HOME/bin/python3.7
-DBoost_NO_BOOST_CMAKE:BOOL=ON
-DBoost_NO_SYSTEM_PATHS=TRUE
-DBOOST_ROOT=/usr/local/Cellar/boost/1.71.0
-DBOOST_LIBRARY_DIRS=/usr/local/Cellar/boost/1.71.0/lib
-DBOOST_INCLUDE_DIR=/usr/local/Cellar/boost/1.71.0/include
../
But the log says:
Found Boost: /usr/local/Cellar/boost/1.71.0/include (found version "1.71.0")
Found PythonInterp: /bin/python3.7 (Required is at least version "3")
Found PythonLibs: /lib/libpython3.7.so (Required is at least version "3")
Detected Homebrew install at /usr/local
Found PythonInterp: /bin/python3.7
Found PythonLibs: /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libpython.tbd
(found version "2.7.10")
Found Boost: /usr/local/Cellar/boost/1.71.0/include (found suitable version "1.71.0", minimum required is "1.48") found components:
filesystem program_options regex system thread chrono date_time atomic
- Could NOT find Boost (missing: python) (found version "1.71.0")
As you can see, there are some components in Boost except for python.
I've tried:
-DBOOST_ROOT=/usr/local/Cellar/boost_python3/1.71.0_1
-DBOOST_LIBRARY_DIRS=/usr/local/Cellar/boost_python3/1.71.0_1/lib
But due to there's no "include" dir in boost_python3, I don't know how to edit BOOST_INCLUDE_DIR. Therefore, the log says:
Could NOT find Boost (missing: Boost_INCLUDE_DIR)
PLEASE HELP!!!!!!! I intend to compile FreeCAD on my mac but I've been stuck for a few days!

Related

could not detect boost libraries when running ./configure when compiling bitcoin core code

This is the error I get:
checking for boostlib >= 1.58.0 (105800)... configure:
We could not detect the boost libraries (version 1.58.0 or higher).
If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.
If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: Boost is not available!
I am on the latest version of macOS big sur and I installed boost with homebrew. I believe boost should be installed in usr/local/include, but for me, it is installed in /opt/homebrew/opt/boost. Could this be the issue? I used a symlink to go from usr/local/include to /opt/homebrew/opt/boost but it didn't work when I cded into the bitcoin folder and then ran ./configure.
export BOOST_ROOT=/opt/homebrew/opt/boost
./configure --with-gui=no --without-bdb --with-boost=$BOOST_ROOT
Your options may differ

Cmake won't find correct version of Boost

I am trying to build some code using cmake. The code uses some Boost libraries. Because of that I try to find Boost in the cmakefile:
find_package(Boost 1.65.1 REQUIRED COMPONENTS unit_test_framework program_options )
I have installed boost version 1.58 via apt (I am using Linux Mint 18.3), so I obviously get the error message when trying to cmake the code:
CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
Unable to find the requested Boost libraries.
Boost version: 1.58.0
Boost include path: /usr/include
Detected version of Boost is too old. Requested version was 1.65.1 (or newer).
Call Stack (most recent call first):
CMakeLists.txt:14 (find_package)
-- Configuring incomplete, errors occurred!
So I went on and downloaded Boost 1.65.1 by source and built it the intended way and installed it with the prefix
sudo ./b2 install --prefix=/usr/include
When I try to build the code again, it still gives the exact same error message as before, stating that it didn't find the newer version. I have tried to uninstall version 1.58 and build, but then cmake doesn't find Boost at all.
How can I install Boost in a way, that cmake is able to find it?
Thanks in advance,
cheers!
When changing the version information of Boost in a find_package(Boost) call you need to clear the CMakeCache.txt file. Otherwise the cached information from the previous run is used.

CMake does not find boost_thread

I am trying to install the OpenGM library. However, while using CMake, I get the following error:
CMake Error at /usr/local/share/cmake-3.6/Modules/FindBoost.cmake:1753 (message):
Unable to find the requested Boost libraries.
Boost version: 1.62.0
Boost include path: /usr/local/include
Could not find the following Boost libraries:
boost_thread
Some (but not all) of the required Boost libraries were found. You may
need to install these additional Boost libraries. Alternatively, set
BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
to the location of Boost.
However, when I do:
ls -l
in
/usr/local/include
I get the following line:
lrwxr-xr-x 1 Florian admin 36 13 oct 19:11 boost -> ../Cellar/boost/1.62.0/include/boost
which suggests that it looks in the right directory.
In:
/usr/local/lib
I have:
libboost_thread-mt.a
libboost_thread-mt.dylib
So, it seems that the boost_thread library does exist...
Regarding the CMake configuration related to Boost, I have:
Boost_DIR Boost_DIR-NOTFOUND
Boost_INCLUDE_DIR /usr/local/include
Boost_LIBRARY_DIR_DEBUG /usr/local/lib
Boost_LIBRARY_DIR_RELEASE /usr/local/lib
Boost_PYTHON_LIBRARY_DEBUG /usr/local/lib/libboost_python.dylib
Boost_PYTHON_LIBRARY_RELEASE /usr/local/lib/libboost_python.dylib
If it can help, I am under Mac OSX and Boost was installed through:
brew install boost --with-python
brew install boost-python
I have managed to handle this error by setting the Boost multithreading flag to ON n CMakeLists.txt.

GMP & MPFR not found by cmake, but are installed

I'm trying to compile the plll library which require boost, GMP and MPFR on mac os X 10.11.
I've installed boost, GMP and MPFR by homebrew, then i've launched cmake in a dir build in plll, but I get that error :
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.
And the same for GMP if I change the order of GMP and MPFR in the Librairies.txt used by cmake.
After that i've install the librairies by hand and they are in/usr/local/include. The make check of GMP is perfect so I guess that the installation is ok.
But still the same error message. I've also tried to add a FindMPFR.cmake file but no change at all.
Here is the part of the Libraries.txt which is concerned:
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})
The strange part of that is that I've no problem with Boost...

cmake cannot find glib2

On OS X 10.8.2, I have macports and have installed:
glib2
pkg-config
among other things. The cmake I run tries to use pkg-config to find glib2. Running pkg-config --libs glib-2.0:
-L/opt/local/lib -lglib-2.0 -lintl
and --cflags:
-I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include -I/opt/local/include
Yet, when I try to enter these in (individually, or all of them using ; or :), and all sorts of combinations, or when I tried downloading gtk and using the glib2 dirs of that: cmake complains it can't find the directories:
checking for module 'gstreamer-0.10'
found gstreamer-0.10, version 0.10.36
checking for module 'glib-2.0'
found glib-2.0, version 2.34.3
CMake Error at /Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
Could NOT find GLib2 (missing: GLIB2_LIBDIR GLIB2_INCLUDE_DIRS)
Call Stack (most recent call first):
/Applications/CMake 2.8-10.app/Contents/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
cmake/Modules/FindGLib2.cmake:127 (find_package_handle_standard_args)
cmake/Modules/FindGStreamer.cmake:12 (find_package)
CMakeLists.txt:32 (find_package)
I saw this page about conflicting pkg-config's with MonoDevelop. I uninstalled Mono, don't have any other pkg-config binaries that I can find, and cleared the cmake cache without any luck. I've looked at the cmake specifics, and its looking for glib.h and glibconfig.h, which are in those directories. Why can't it just behave?
Try to use this file: http://svn.opensync.org/branches/3rd-party-cmake-modules/modules/FindGLIB2.cmake
In your main CMakeLists.txt file, enter the following line:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/helper/")
This is assuming that the above FindGLIB2.cmake is stored in directory /helper off the src.
The contents of this file will help CMake to better find GLIB2.
This link will help you understand how these files work: http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries#Writing_find_modules
I faced this problem while building wireshark-3.4.2 from source using cmake on Centos8.2/RHEL8.2. The error was
Could NOT find GLIB2 (missing: GLIB2_LIBRARY GLIB2_MAIN_INCLUDE_DIR GLIB2_INTERNAL_INCLUDE_DIR) Required is at least version "2.32.0")
while my system had preinstalled glib-2.56.4
Solution: Installed glib2-devel package. Then cmake found the glib-2.0 properly.
The cmake output looked like:
-- Checking for one of the modules 'glib-2.0'
-- Found GLIB2: /usr/lib64/libglib-2.0.so (found suitable version "2.56.4", minimum required is "2.32.0")

Resources