facebookresearch/ELF

compilation fatal error

kirk86 opened this issue · 3 comments

Hi thanks for this project. Following the instructions and installing prerequisites the compilation step fails without being able to find tbb/concurrent_queue.h even though libtbb-dev is installed in my system as requested by the prerequisites.

cmake .. -DPYTHON_EXECUTABLE=$HOME/miniconda3/envs/torch/bin/python
-- The C compiler identification is GNU 5.4.1
-- The CXX compiler identification is GNU 5.4.1
-- Check for working C compiler: /usr/bin/gcc-5
-- Check for working C compiler: /usr/bin/gcc-5 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-5
-- Check for working CXX compiler: /usr/bin/g++-5 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/user/miniconda3/envs/torch/bin/python (found version "3.6.4")
-- Found PythonLibs: /home/user/miniconda3/envs/torch/lib/libpython3.6m.so
-- pybind11 v2.3.dev0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
-- LTO enabled
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/ELF/rts/build
:~/ELF/rts/build$
:~/ELF/rts/build$ make -j8
Scanning dependencies of target minirts-game-headers
Scanning dependencies of target minirts-engine-headers
[  1%] Running compile_cmds.py on /home/user/ELF/rts/game_MC/cmd_specific
[  3%] Running compile_cmds.py on /home/user/ELF/rts/engine/cmd_specific
[  4%] Running compile_cmds.py on /home/user/ELF/rts/engine/cmd
[  4%] Built target minirts-game-headers
[  4%] Built target minirts-engine-headers
Scanning dependencies of target minirts-backend
Scanning dependencies of target minirts
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/trainable_ai.cc.o
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/gamedef.cc.o
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/ai.cc.o
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/game_action.cc.o
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/python_wrapper.cc.o
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/wrapper_callback.cc.o
[ 15%] Building CXX object minirts/CMakeFiles/minirts.dir/cmd_specific.cc.o
[ 17%] Building CXX object minirts/CMakeFiles/minirts.dir/mc_rule_actor.cc.o
[ 19%] Building CXX object backend/CMakeFiles/minirts-backend.dir/comm_ai.cc.o
In file included from /home/user/ELF/elf/../elf/tree_search.h:21:0,
                 from /home/user/ELF/elf/../elf/mcts.h:8,
                 from /home/user/ELF/rts/game_MC/ai.h:16,
                 from /home/user/ELF/rts/game_MC/trainable_ai.h:4,
                 from /home/user/ELF/rts/game_MC/trainable_ai.cc:1:
/home/user/ELF/elf/../elf/primitive.h:11:36: fatal error: tbb/concurrent_queue.h: No such file or directory
In file included from /home/user/ELF/elf/../elf/state_collector.h:27:0,
                 from /home/user/ELF/elf/../elf/comm_template.h:27,
                 from /home/user/ELF/rts/game_MC/wrapper_callback.h:12,
                 from /home/user/ELF/rts/game_MC/wrapper_callback.cc:11:
/home/user/ELF/elf/../elf/primitive.h:11:36: fatal error: tbb/concurrent_queue.h: No such file or directory
compilation terminated.
In file included from /home/user/ELF/elf/../elf/tree_search.h:21:0,
                 from /home/user/ELF/elf/../elf/mcts.h:8,
                 from /home/user/ELF/rts/game_MC/ai.h:16,
                 from /home/user/ELF/rts/game_MC/rule_ai.h:3,
                 from /home/user/ELF/rts/game_MC/gamedef.cc:18:
/home/user/ELF/elf/../elf/primitive.h:11:36: fatal error: tbb/concurrent_queue.h: No such file or directory
compilation terminated.
compilation terminated.
minirts/CMakeFiles/minirts.dir/build.make:158: recipe for target 'minirts/CMakeFiles/minirts.dir/trainable_ai.cc.o' failed
make[2]: *** [minirts/CMakeFiles/minirts.dir/trainable_ai.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
minirts/CMakeFiles/minirts.dir/build.make:86: recipe for target 'minirts/CMakeFiles/minirts.dir/wrapper_callback.cc.o' failed
make[2]: *** [minirts/CMakeFiles/minirts.dir/wrapper_callback.cc.o] Error 1
minirts/CMakeFiles/minirts.dir/build.make:206: recipe for target 'minirts/CMakeFiles/minirts.dir/gamedef.cc.o' failed
make[2]: *** [minirts/CMakeFiles/minirts.dir/gamedef.cc.o] Error 1
[ 20%] Building CXX object backend/CMakeFiles/minirts-backend.dir/save2json.cc.o
[ 23%] Building CXX object backend/CMakeFiles/minirts-backend.dir/raw2cmd.cc.o
[ 23%] Building CXX object backend/CMakeFiles/minirts-backend.dir/main_loop.cc.o
[ 25%] Building CXX object backend/CMakeFiles/minirts-backend.dir/__/game_MC/ai.cc.o
[ 26%] Building CXX object backend/CMakeFiles/minirts-backend.dir/__/game_MC/game_action.cc.o
In file included from /home/user/ELF/elf/../elf/tree_search.h:21:0,
                 from /home/user/ELF/elf/../elf/mcts.h:8,
                 from /home/user/ELF/rts/game_MC/ai.h:16,
                 from /home/user/ELF/rts/backend/main_loop.cc:20:
/home/user/ELF/elf/../elf/primitive.h:11:36: fatal error: tbb/concurrent_queue.h: No such file or directory
compilation terminated.
In file included from /home/user/ELF/elf/../elf/state_collector.h:27:0,
                 from /home/user/ELF/elf/../elf/comm_template.h:27,
                 from /home/user/ELF/rts/game_MC/wrapper_callback.h:12,
                 from /home/user/ELF/rts/game_MC/python_wrapper.cc:18:
/home/user/ELF/elf/../elf/primitive.h:11:36: fatal error: tbb/concurrent_queue.h: No such file or directory
compilation terminated.
minirts/CMakeFiles/minirts.dir/build.make:62: recipe for target 'minirts/CMakeFiles/minirts.dir/python_wrapper.cc.o' failed
make[2]: *** [minirts/CMakeFiles/minirts.dir/python_wrapper.cc.o] Error 1
CMakeFiles/Makefile2:191: recipe for target 'minirts/CMakeFiles/minirts.dir/all' failed
make[1]: *** [minirts/CMakeFiles/minirts.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
backend/CMakeFiles/minirts-backend.dir/build.make:86: recipe for target 'backend/CMakeFiles/minirts-backend.dir/main_loop.cc.o' failed
make[2]: *** [backend/CMakeFiles/minirts-backend.dir/main_loop.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/user/ELF/elf/../elf/tree_search.h:21:0,
                 from /home/user/ELF/elf/../elf/mcts.h:8,
                 from /home/user/ELF/rts/game_MC/ai.h:16,
                 from /home/user/ELF/rts/backend/comm_ai.h:13,
                 from /home/user/ELF/rts/backend/comm_ai.cc:10:
/home/user/ELF/elf/../elf/primitive.h:11:36: fatal error: tbb/concurrent_queue.h: No such file or directory
compilation terminated.
backend/CMakeFiles/minirts-backend.dir/build.make:62: recipe for target 'backend/CMakeFiles/minirts-backend.dir/comm_ai.cc.o' failed
make[2]: *** [backend/CMakeFiles/minirts-backend.dir/comm_ai.cc.o] Error 1
CMakeFiles/Makefile2:279: recipe for target 'backend/CMakeFiles/minirts-backend.dir/all' failed
make[1]: *** [backend/CMakeFiles/minirts-backend.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
apt-cache search libtbb*
libtbb-dev - parallelism library for C++ - development files
libtbb-doc - parallelism library for C++ - documentation
libtbb2 - parallelism library for C++ - runtime files
libtbb2-dbg - parallelism library for C++ - debugging symbols
dpkg-query -l | grep libtbb*
ii  libtbb2:amd64                                            4.4~20151115-0ubuntu3                                    amd64        parallelism library for C++ - runtime files

It would have been much easier for the users if ELF would have come as a conda package.

Finally I manged to compile it without any errors. I updated some prerequisite files and switched gcc from 4.9 to 7.2. Everything else went smooth ;). Currently trying to check the training process.

@kirk86 How did you update the prerequisite files?

@carlosgmartin Hi, just make sure you have the following packages installed
cmake >= 3.8, gcc >= 4.9 and libtbb-dev

It could be possible that playing around with their versions will yield different results.

Also before compiling install conda and the packages described in the README of this repo.