I am trying to compile a C++ project that uses Boost. I have tried this on a Windows machine (first trying with cygwin, then with Visual Studio) as well as a Macbook. I continue to run into the problem that cmake
will find Boost just fine, but make
will tell me that it can't find the first boost library it needs to look for. I've tried using make -I/path/to/boost/parent/directory/
and the output is identical.
I've attached the Mac terminal output for cmake ..
and make
below. I'll also include the steps that I took, and attempts to dissect the problem:
- Ran
brew install boost
- Ran
git clone git-repo
- Ran
mkdir build
cmake ..
make
I have also reinstalled boost, reinstalled brew, and checked that the proper include paths were being used by the compiler. CMakeLists.txt
has the line find_package(Boost REQUIRED)
. Doing all these yields the same results shown below.
Any help solving this would be greatly appreciated.
mudly@MyMac build % cmake ..
-- The C compiler identification is AppleClang 12.0.5.12050022
-- The CXX compiler identification is AppleClang 12.0.5.12050022
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Boost: /usr/local/lib/cmake/Boost-1.76.0/BoostConfig.cmake (found version "1.76.0")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND)
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mudly/source/matching/matching/build
mudly@MyMac build % make
[ 10%] Building CXX object CMakeFiles/matching_distance_test.dir/tests/test_bifiltration.cpp.o
[ 20%] Building CXX object CMakeFiles/matching_distance_test.dir/tests/test_common.cpp.o
In file included from /Users/mudly/source/matching/matching/tests/test_common.cpp:9:
In file included from /Users/mudly/source/matching/matching/include/matching_distance.h:19:
In file included from /Users/mudly/source/matching/matching/../bottleneck/include/bottleneck.h:41:
In file included from /Users/mudly/source/matching/matching/../bottleneck/include/bottleneck_detail.h:41:
In file included from /Users/mudly/source/matching/matching/../bottleneck/include/bound_match.h:36:
In file included from /Users/mudly/source/matching/matching/../bottleneck/include/neighb_oracle.h:37:
/Users/mudly/source/matching/matching/../bottleneck/include/dnn/geometry/euclidean-fixed.h:4:10: fatal error: 'boost/operators.hpp' file not found
#include <boost/operators.hpp>
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/matching_distance_test.dir/tests/test_common.cpp.o] Error 1
make[1]: *** [CMakeFiles/matching_distance_test.dir/all] Error 2
make: *** [all] Error 2
#include <boost/operators.hpp>
includesboost/
in the name of the file to be included. – Richard Crittenmake
to invoke your compiler (make sure that the desired flags are there and that they match the directory structure on your system). – JaMiT