Search code examples
c++boostevolutionary-algorithmcc

C++ program cannot find boost


I am trying to compile the MultiNEAT project (https://github.com/peter-ch/MultiNEAT). I have installed boost and boost-python, and it is located in /usr/local/Cellar/boost. I also edited ~/.bash_profile to add /usr/local/Cellar/boost/1.60.0_1/include to PATH. However, when I try to compile and install MultiNEAT by

sudo python setup.py install

I get the error:

running install
running build
running build_py
running build_ext
building '_MultiNEAT' extension
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/Genome.cpp -o build/temp.macosx-10.11-intel-2.7/src/Genome.o -march=native -DUSE_BOOST_PYTHON -DUSE_BOOST_RANDOM -std=gnu++11 -g -Wall
src/Genome.cpp:37:10: fatal error: 'boost/unordered_map.hpp' file not found
#include <boost/unordered_map.hpp>
     ^
1 error generated.
error: command 'cc' failed with exit status 1

How can I make the program found the boost library and successfully comiple MultiNEAT? My system is OS X Yosemite.


Solution

  • You have to change your compilation definitions to include the boost header files. You may, possibly, need to add the boost libraries (and their directories) to the linkage settings. I could have said more if you have published the way you build your application.