geek-ai / MAgent

A Platform for Many-Agent Reinforcement Learning
MIT License
1.68k stars 332 forks source link

Quick fix for mac bash build.sh error (library not found for -lboost_system) #14

Open dhl8282 opened 6 years ago

dhl8282 commented 6 years ago

I was getting this error even though I installed boost library properly through both brew and macports.

| => bash build.sh 
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/donghun/cs/MAgent/build
[ 75%] Built target testlib
[ 78%] Built target magent
[ 81%] Linking CXX executable render/render
ld: library not found for -lboost_system
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [render/render] Error 1
make[1]: *** [CMakeFiles/render.dir/all] Error 2
make: *** [all] Error 2

First, check if you properly installed boost ls /usr/local/lib | grep --color boost_system results:

libboost_system-mt.a
libboost_system-mt.dylib

Fix: Change boost_system library to boost_system-mt (multi thread)

vi build/CMakeFiles/render.dir/link.txt
change boost_system to boost_system-mt in 2 places

and the build works.