facebookresearch / phyre

PHYRE is a benchmark for physical reasoning.
https://phyre.ai
Apache License 2.0
431 stars 64 forks source link

installation from source failed #30

Closed floodsung closed 4 years ago

floodsung commented 4 years ago

I just followed the instruction to install phyre from source, but I got make errors like this:

[ 83%] Building CXX object CMakeFiles/simulator_lib.dir/src/simulator/task_validation.cpp.o /data/phyre/src/simulator/image_to_box2d.cpp: In function 'void featurizeBody(const scene::Body&, int, int, float*)': /data/phyre/src/simulator/image_to_box2d.cpp:427:41: error: expected ',' before ')' token static_assert(kObjectFeatureSize == 14); ^ /data/phyre/src/simulator/image_to_box2d.cpp:427:41: error: expected string-literal before ')' token CMakeFiles/simulator_lib.dir/build.make:92: recipe for target 'CMakeFiles/simulator_lib.dir/src/simulator/image_to_box2d.cpp.o' failed make[3]: [CMakeFiles/simulator_lib.dir/src/simulator/image_to_box2d.cpp.o] Error 1 make[3]: Waiting for unfinished jobs.... [ 84%] Linking CXX static library libgtest.a make[3]: Leaving directory '/data/phyre/cmake_build' [ 84%] Built target gtest make[3]: Entering directory '/data/phyre/cmake_build' Scanning dependencies of target gtest_main make[3]: Leaving directory '/data/phyre/cmake_build' make[3]: Entering directory '/data/phyre/cmake_build' [ 85%] Building CXX object third-party/googletest/googlemock/gtest/CMakeFiles/gtest_main.dir/src/gtest_main.cc.o [ 86%] Linking CXX static library libtask_io.a make[3]: Leaving directory '/data/phyre/cmake_build' make[3]: Leaving directory '/data/phyre/cmake_build' CMakeFiles/Makefile2:691: recipe for target 'CMakeFiles/simulator_lib.dir/all' failed make[2]: [CMakeFiles/simulator_lib.dir/all] Error 2 make[2]: Waiting for unfinished jobs.... [ 86%] Built target task_io [ 87%] Linking CXX static library libgtest_main.a make[3]: Leaving directory '/data/phyre/cmake_build' [ 87%] Built target gtest_main make[2]: Leaving directory '/data/phyre/cmake_build' Makefile:157: recipe for target 'all' failed make[1]: [all] Error 2 make[1]: Leaving directory '/data/phyre/cmake_build' Makefile:27: recipe for target 'compile' failed make: [compile] Error 2 Traceback (most recent call last): File "", line 1, in File "/data/phyre/src/python/setup.py", line 79, in 'License :: OSI Approved :: Apache Software License', File "/opt/conda/envs/phyre/lib/python3.6/site-packages/setuptools/init.py", line 144, in setup return distutils.core.setup(**attrs) File "/opt/conda/envs/phyre/lib/python3.6/distutils/core.py", line 148, in setup dist.run_commands() File "/opt/conda/envs/phyre/lib/python3.6/distutils/dist.py", line 955, in run_commands self.run_command(cmd) File "/opt/conda/envs/phyre/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/opt/conda/envs/phyre/lib/python3.6/site-packages/setuptools/command/develop.py", line 38, in run self.install_for_development() File "/opt/conda/envs/phyre/lib/python3.6/site-packages/setuptools/command/develop.py", line 140, in install_for_development self.run_command('build_ext') File "/opt/conda/envs/phyre/lib/python3.6/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/opt/conda/envs/phyre/lib/python3.6/distutils/dist.py", line 974, in run_command cmd_obj.run() File "/data/phyre/src/python/setup.py", line 45, in run subprocess.check_call(command, cwd='../..') File "/opt/conda/envs/phyre/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['make', 'develop']' returned non-zero exit status 2.

ERROR: Command errored out with exit status 1: /opt/conda/envs/phyre/bin/python3.6 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/data/phyre/src/python/setup.py'"'"'; file='"'"'/data/phyre/src/python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.

How to solve it? Thank you

akhti commented 4 years ago

Seems that you have older compiler. What's your OS/compiler version?

floodsung commented 4 years ago

ubuntu 18.04 cmake version 3.17.0

akhti commented 4 years ago

18.04 should have a recent compiler. Try sudo apt-get install build-essential and make clean all. If not not working, please let me know compiler version: gcc --version.

Alternatively, you can change this line https://github.com/facebookresearch/phyre/blob/master/src/simulator/image_to_box2d.cpp#L427 from

static_assert(kObjectFeatureSize == 14);

to

static_assert(kObjectFeatureSize == 14, "err");
floodsung commented 4 years ago

Thank you! I successfully installed the phyre after the change.