geek-ai / MAgent

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

Ubuntu Build error fix needed #15

Closed dhl8282 closed 5 years ago

dhl8282 commented 6 years ago

system: Ubuntu 16.04.3 LTS conda 4.4.7 Python 2.7.14 :: Anaconda, Inc. gcc (GCC) 4.8.5 libjsoncpp-dev is already the newest version (1.7.2-1). libboost-system-dev is already the newest version (1.58.0.1ubuntu1). libwebsocketpp-dev is already the newest version (0.7.0-5). cmake is already the newest version (3.5.1-1ubuntu3).

(tensorflow_p27) ubuntu@ip-172-31-24-200:~/cs/MAgent$ bash build.sh 
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Check for working C compiler: /home/ubuntu/anaconda3/envs/tensorflow_p27/bin/cc
-- Check for working C compiler: /home/ubuntu/anaconda3/envs/tensorflow_p27/bin/cc -- 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: /home/ubuntu/anaconda3/envs/tensorflow_p27/bin/c++
-- Check for working CXX compiler: /home/ubuntu/anaconda3/envs/tensorflow_p27/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/cs/MAgent/build
Scanning dependencies of target magent
[  3%] Building CXX object CMakeFiles/magent.dir/src/temp_c_booster.cc.o
[  6%] Building CXX object CMakeFiles/magent.dir/src/runtime_api.cc.o
[  9%] Building CXX object CMakeFiles/magent.dir/src/gridworld/RenderGenerator.cc.o
[ 12%] Building CXX object CMakeFiles/magent.dir/src/gridworld/AgentType.cc.o
[ 15%] Building CXX object CMakeFiles/magent.dir/src/gridworld/RewardEngine.cc.o
[ 18%] Building CXX object CMakeFiles/magent.dir/src/gridworld/GridWorld.cc.o
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc:456:0: warning: ignoring #pragma omp declare [-Wunknown-pragmas]
     #pragma omp declare reduction (merge : std::vector<RenderAttackEvent> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
 ^
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc: In member function ‘virtual void magent::gridworld::GridWorld::step(int*)’:
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc:474:40: error: expected ‘+’, ‘*’, ‘-’, ‘&’, ‘^’, ‘|’, ‘&&’, ‘||’, ‘min’ or ‘max’ before ‘merge’
     #pragma omp parallel for reduction(merge: render_attack_buffer)
                                        ^
CMakeFiles/magent.dir/build.make:182: recipe for target 'CMakeFiles/magent.dir/src/gridworld/GridWorld.cc.o' failed
make[2]: *** [CMakeFiles/magent.dir/src/gridworld/GridWorld.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/magent.dir/all' failed
make[1]: *** [CMakeFiles/magent.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
Scanning dependencies of target render
Scanning dependencies of target testlib
[  3%] Building CXX object CMakeFiles/render.dir/src/render/backend/websocket.cc.o
[  6%] Building CXX object CMakeFiles/render.dir/src/render/backend/render.cc.o
[  9%] Building CXX object CMakeFiles/magent.dir/src/gridworld/GridWorld.cc.o
[ 12%] Building CXX object CMakeFiles/testlib.dir/src/temp_c_booster.cc.o
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc:456:0: warning: ignoring #pragma omp declare [-Wunknown-pragmas]
     #pragma omp declare reduction (merge : std::vector<RenderAttackEvent> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
 ^
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc: In member function ‘virtual void magent::gridworld::GridWorld::step(int*)’:
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc:474:40: error: expected ‘+’, ‘*’, ‘-’, ‘&’, ‘^’, ‘|’, ‘&&’, ‘||’, ‘min’ or ‘max’ before ‘merge’
     #pragma omp parallel for reduction(merge: render_attack_buffer)
                                        ^
CMakeFiles/magent.dir/build.make:182: recipe for target 'CMakeFiles/magent.dir/src/gridworld/GridWorld.cc.o' failed
make[2]: *** [CMakeFiles/magent.dir/src/gridworld/GridWorld.cc.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/magent.dir/all' failed
make[1]: *** [CMakeFiles/magent.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 15%] Building CXX object CMakeFiles/render.dir/src/render/backend/data.cc.o
[ 18%] Building CXX object CMakeFiles/testlib.dir/src/runtime_api.cc.o
[ 21%] Building CXX object CMakeFiles/testlib.dir/src/gridworld/RenderGenerator.cc.o
[ 24%] Building CXX object CMakeFiles/render.dir/src/render/backend/text.cc.o
[ 27%] Building CXX object CMakeFiles/render.dir/src/render/backend/utility/logger.cc.o
/home/ubuntu/cs/MAgent/src/render/backend/utility/logger.cc: In member function ‘void magent::render::Logger::log(const string&)’:
/home/ubuntu/cs/MAgent/src/render/backend/utility/logger.cc:14:20: error: ‘put_time’ is not a member of ‘std’
         ostream << std::put_time(std::localtime(&time), "[%Y-%m-%d %H:%M:%S] [")
                    ^
CMakeFiles/render.dir/build.make:158: recipe for target 'CMakeFiles/render.dir/src/render/backend/utility/logger.cc.o' failed
make[2]: *** [CMakeFiles/render.dir/src/render/backend/utility/logger.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 30%] Building CXX object CMakeFiles/testlib.dir/src/gridworld/AgentType.cc.o
[ 33%] Building CXX object CMakeFiles/testlib.dir/src/gridworld/RewardEngine.cc.o
[ 36%] Building CXX object CMakeFiles/testlib.dir/src/gridworld/GridWorld.cc.o
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc:456:0: warning: ignoring #pragma omp declare [-Wunknown-pragmas]
     #pragma omp declare reduction (merge : std::vector<RenderAttackEvent> : omp_out.insert(omp_out.end(), omp_in.begin(), omp_in.end()))
 ^
[ 39%] Building CXX object CMakeFiles/testlib.dir/src/gridworld/test.cc.o
[ 42%] Building CXX object CMakeFiles/testlib.dir/src/gridworld/Map.cc.o
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc: In member function ‘virtual void magent::gridworld::GridWorld::step(int*)’:
/home/ubuntu/cs/MAgent/src/gridworld/GridWorld.cc:474:40: error: expected ‘+’, ‘*’, ‘-’, ‘&’, ‘^’, ‘|’, ‘&&’, ‘||’, ‘min’ or ‘max’ before ‘merge’
     #pragma omp parallel for reduction(merge: render_attack_buffer)
                                        ^
CMakeFiles/testlib.dir/build.make:182: recipe for target 'CMakeFiles/testlib.dir/src/gridworld/GridWorld.cc.o' failed
make[2]: *** [CMakeFiles/testlib.dir/src/gridworld/GridWorld.cc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:141: recipe for target 'CMakeFiles/testlib.dir/all' failed
make[1]: *** [CMakeFiles/testlib.dir/all] Error 2
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/render.dir/all' failed
make[1]: *** [CMakeFiles/render.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

I am getting this message. How do I fix this? I am using AWS Deep Learning AMI. So I tried in python3 and still having similar error.

pilaoda commented 6 years ago

Have you solved your problem? I also have the same problem in Ubuntu 14.04, python3.6 .

dhl8282 commented 6 years ago

@pilaoda Yes I got it fixed and make it work. This is your environment issue. I was using AWS DeepLearning AMI (https://aws.amazon.com/marketplace/pp/B077GCH38C) and it has built in conda environment.

It didn't work on [tensorflow_p27] environment but it worked fine with [python2] environment. I will paste conda list of [python2] environment. Try to match the versions.

absl-py 0.1.10 asn1crypto 0.24.0 py27_0
autovizwidget 0.12.5 py27h255d36a_0
backports 1.0 py27_1 conda-forge backports.functools-lru-cache 1.4 backports.shutil_get_terminal_size 1.0.0 py_3 conda-forge backports.weakref 1.0.post1 backports_abc 0.5 py27_0 conda-forge blas 1.1 openblas conda-forge bleach 1.5.0 bleach 2.0.0 py27_0 conda-forge bokeh 0.12.13 py27h5233db4_0
boto3 1.5.20 botocore 1.8.34 bzip2 1.0.6 1 conda-forge ca-certificates 2017.08.26 h1d4fec5_0
cairo 1.14.12 h77bcde2_0
certifi 2018.1.18 py27_0
certifi 2018.1.18 cffi 1.11.4 py27h9745a5d_0
chardet 3.0.4 py27hfa10054_1
configparser 3.5.0 py27_0 conda-forge cryptography 2.1.4 py27h6697b16_0
cuda90 1.0 h6433d27_0 pytorch cycler 0.10.0 dbus 1.10.22 0 conda-forge decorator 4.2.1 decorator 4.1.2 py27_0 conda-forge docutils 0.14 entrypoints 0.2.3 py27_1 conda-forge enum34 1.1.6 py27_1 conda-forge environment-kernels 1.1 expat 2.2.5 he0dffb1_0
ffmpeg 3.4 h7264315_0
fontconfig 2.12.4 h88586e7_1
freetype 2.8 hab7d2ae_1
funcsigs 1.0.2 functools32 3.2.3.2 py27_1 conda-forge futures 3.2.0 py27h7b459c0_0
gettext 0.19.7 1 conda-forge giflib 5.1.4 0 conda-forge glib 2.53.6 h5d9569c_2
gmp 6.1.2 0 conda-forge graphite2 1.3.10 hf63cedd_1
graphviz 2.40.1 h25d223c_0
gst-plugins-base 1.8.0 0 conda-forge gstreamer 1.8.0 0
harfbuzz 1.7.4 hc5b324e_0
hdf5 1.10.1 1 conda-forge hdijupyterutils 0.12.5 py27hcc60360_0
html5lib 1.0.1 py_0 conda-forge html5lib 0.9999999 icu 58.2 h9c2bf20_1
idna 2.6 py27h5722d68_1
intel-openmp 2018.0.0 hc7b2577_8
ipaddress 1.0.19 py27_0
ipykernel 4.7.0 py27_0 conda-forge ipykernel 4.8.0 ipython 5.5.0 py27_0 conda-forge ipython_genutils 0.2.0 py27_0 conda-forge ipywidgets 7.1.0 py27_0
ipywidgets 7.1.1 jasper 1.900.1 4 conda-forge jinja2 2.10 py27_0 conda-forge jmespath 0.9.3 jpeg 9b h024ee3a_2
jsonschema 2.6.0 py27_0 conda-forge jupyter_client 5.2.2 py27_0 conda-forge jupyter_core 4.4.0 py_0 conda-forge krb5 1.14.2 hcdc1b81_6
libedit 3.1 heed3624_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 7.2.0 h7cc24e2_2
libgfortran 3.0.0 1
libgfortran-ng 7.2.0 h9f7466a_2
libiconv 1.15 h63c8f33_5
libopus 1.2.1 hb9ed12e_0
libpng 1.6.34 hb9fc6fc_0
libprotobuf 3.4.1 h5b8497f_0
libsodium 1.0.15 1 conda-forge libstdcxx-ng 7.2.0 h7a57d05_2
libtiff 4.0.9 h28f6b97_0
libtool 2.4.6 h544aabb_3
libvpx 1.6.1 h888fd40_0
libwebp 0.5.2 7 conda-forge libxcb 1.12 1 conda-forge libxml2 2.9.4 h2e8b1d7_6
Markdown 2.6.11 markupsafe 1.0 py27_0 conda-forge matplotlib 2.1.2 mistune 0.8.3 py_0 conda-forge mkl 2018.0.1 h19d6760_4
mock 2.0.0 nb_conda 2.2.1 py27_0 conda-forge nb_conda_kernels 2.1.0 py27_0 conda-forge nbconvert 5.3.1 py_1 conda-forge nbformat 4.4.0 py27_0 conda-forge ncurses 6.0 h9df7e31_2
notebook 5.3.1 py27_1 conda-forge numpy 1.14.0 py27_blas_openblas_200 [blas_openblas] conda-forge olefile 0.45.1 py27_0
openblas 0.2.20 7 conda-forge opencv 3.3.1 py27h6cbbc71_1
openjdk 8.0.121 1
openssl 1.0.2n hb7f436b_0
pandas 0.22.0 py27hf484d3e_0
pandoc 2.1.1 0 conda-forge pandocfilters 1.4.1 py27_0 conda-forge pandocfilters 1.4.2 pango 1.41.0 hd475d92_0
pathlib2 2.3.0 py27_0 conda-forge pbr 3.1.1 pcre 8.41 hc27e229_1
pexpect 4.3.1 py27_0 conda-forge pickleshare 0.7.4 py27_0 conda-forge pillow 5.0.0 py27h3deb7b8_0
pip 9.0.1 py27ha730c48_4
pixman 0.34.0 1 conda-forge plotly 2.2.2 py27hb784091_0
prompt_toolkit 1.0.15 py27_0 conda-forge protobuf 3.5.0 py27_1 conda-forge protobuf 3.5.1 psycopg2 2.7.3.2 ptyprocess 0.5.2 py27_0 conda-forge py4j 0.10.4 pycparser 2.18 py27hefa08c5_1
pygal 2.4.0 pygame 1.9.3 pygments 2.2.0 py27_0 conda-forge pykerberos 1.1.14 py27h2de3caf_2
pyopenssl 17.5.0 py27hcee3be0_0
pyparsing 2.2.0 pysocks 1.6.7 py27he2db6d2_1
pyspark 2.2.1 python 2.7.14 h1571d57_29
python-dateutil 2.6.1 py27_0 conda-forge pytorch 0.3.0 py27_cuda9.0.176_cudnn7.0.3hdbbd62b_4 [cuda90] pytorch pytz 2017.3 py27h001bace_0
pyyaml 3.12 py27h2d70dd7_1
pyzmq 16.0.4 pyzmq 16.0.2 py27_3 conda-forge qt 4.8.7 4
readline 7.0 ha6073c6_4
requests 2.18.4 py27hc5b0589_1
requests-kerberos 0.11.0 py27hd0065c0_1
s3transfer 0.1.12 scandir 1.6 py27_0 conda-forge send2trash 1.4.2 py_0 conda-forge setuptools 38.4.0 py27_0
setuptools 38.5.0 simplegeneric 0.8.1 py27_0 conda-forge singledispatch 3.4.0.3 py27_0 conda-forge six 1.11.0 py27_1 conda-forge sparkmagic 0.12.5 py27h0acb2c8_0
SQLAlchemy 1.2.2 sqlite 3.21.0 h1bed415_0
ssl_match_hostname 3.5.0.1 py27_1 conda-forge subprocess32 3.2.7 tensorflow 1.5.0 tensorflow-gpu 0.12.1 tensorflow-tensorboard 1.5.0 terminado 0.8.1 py27_0 conda-forge testpath 0.3.1 py27_0 conda-forge tk 8.6.7 hc745277_3
torchvision 0.2.0 py27hfb27419_1 pytorch tornado 4.5.3 py27_0 conda-forge traitlets 4.3.2 py27_0 conda-forge urllib3 1.22 py27ha55213b_0
wcwidth 0.1.7 py27_0 conda-forge webencodings 0.5 py27_0 conda-forge webencodings 0.5.1 Werkzeug 0.14.1 wheel 0.30.0 py27h2bc6bb2_1
widgetsnbextension 3.1.3 widgetsnbextension 3.1.0 py27_0
x264 20131217 3 conda-forge xorg-libxau 1.0.8 3 conda-forge xorg-libxdmcp 1.1.2 3 conda-forge xz 5.2.3 h55aa19d_2
yaml 0.1.7 had09818_2
zeromq 4.2.1 1 conda-forge zlib 1.2.11 ha838bed_2