glinscott / leela-chess

**MOVED TO https://github.com/LeelaChessZero/leela-chess ** A chess adaption of GCP's Leela Zero
http://lczero.org
GNU General Public License v3.0
760 stars 299 forks source link

can't compile v0.9 #572

Open pw31 opened 6 years ago

pw31 commented 6 years ago

On Ubuntu 14.04 with gcc 5.5.0:

cmake -DFEATURE_USE_CPU_ONLY=On -DBLAS_INCLUDE_DIRS=/usr/include .. make ... /home/star/pw31/chess/Engines/LCzero/leela-chess/src/Network.cpp:37:36: fatal error: boost/spirit/home/x3.hpp: No such file or directory

This was working before. Any idea?

ganeshkrishnan1 commented 6 years ago

I could fix it by commenting out init(); method in pgn.cpp.

pgn.h has changed and the author forgot to comment the overriden method I guess

pw31 commented 6 years ago

Hi @ganeshkrishnan1, thanks! Unfortunately, and I'm really feeling stupid right now, I cannot find "init()" in src/pgn.cpp. Would you have a line number for me please?

ganeshkrishnan1 commented 6 years ago

Unfortunately I am running a fork of leela chess and I just noticed this master doesn't have the init() method. Sorry I feel stupid now. Past my bedtime!

I am able to compile fresh version of 0.9 so I guess your issues would have to be with your local system setup

pw31 commented 6 years ago

Seems that boost spirit x3 is not supported by boost 1.54.0 which currently is the required minimum boost version. Ubuntu 14.04 only offers support until 1.54.0. My problem might be solvable by a custom installation of a more recent boost version, see https://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html#get-boost. I did that, but now I'm stuck because I don't know how to tell cmake to use that compilation rather then the default one on the system. I just don't understand cmake.

pw31 commented 6 years ago

Seems that boost spirit x3 is not supported by boost 1.54.0 which currently is the required minimum boost version. Ubuntu 14.04 only offers support until 1.54.0. My problem might be solvable by a custom installation of a more recent boost version, see https://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html#get-boost. I did that, but now I'm stuck because I don't know how to tell cmake to use that compilation rather then the default one on the system. I just don't understand cmake. I can do

cmake -DBOOST_ROOT=/data/pw31/software/boost_1_66_0/ ..

causing warnings as CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message): Imported targets not available for Boost version 106600 Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES) CMakeLists.txt:29 (find_package)

but then make stops with error

[ 93%] Linking CXX executable tests /usr/bin/ld: CMakeFiles/objs.dir/src/Training.cpp.o: undefined reference to symbol '_ZN5boost6system16generic_categoryEv' //usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status

tomeckip commented 6 years ago

Having a similar issue.

After cmake command: cmake -DFEATURE_USE_CPU_ONLY=On ..

I got the following error message:

-- The CXX compiler identification is unknown -- The C compiler identification is GNU 5.4.0 CMake Error at CMakeLists.txt:15 (project): No CMAKE_CXX_COMPILER could be found.

Tell CMake where to find the compiler by setting either the environment variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH. -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Configuring incomplete, errors occurred! See also "/home/tom/leela-chess/build/CMakeFiles/CMakeOutput.log". See also "/home/tom/leela-chess/build/CMakeFiles/CMakeError.log".

Trying to compile on google compute cloud with Ubuntu 16.04.

tomeckip commented 6 years ago

Ok, now I feel stupid :)

Installed build-essential and edited CMakeLists.txt to point CMAKE_CXX_COMPILER to g++ and problem solved.

pw31 commented 6 years ago

My problem still not solved. I managed to compile and install boost_1_66 as decribed here https://coderwall.com/p/0atfug/installing-boost-1-55-from-source-on-ubuntu-12-04 (using directory /data/pw31/software/boost) Then I setup compilation with

cmake -DFEATURE_USE_CPU_ONLY=On -DBLAS_INCLUDE_DIRS=/usr/include -DBOOST_ROOT=/data/pw31/software/boost/ ..

which already results in some warnings as -- The CXX compiler identification is GNU 5.5.0 -- The C compiler identification is GNU 5.5.0 -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Found PythonInterp: /home/star/pw31/software/anaconda/bin/python (found version "2.7.14") -- Looking for pthread.h -- Looking for pthread.h - found -- Looking for pthread_create -- Looking for pthread_create - not found -- Check if compiler accepts -pthread -- Check if compiler accepts -pthread - yes -- Found Threads: TRUE
CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message): Imported targets not available for Boost version 106600 Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES) CMakeLists.txt:29 (find_package) CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message): Imported targets not available for Boost version 106600 Call Stack (most recent call first): /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES) /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES) CMakeLists.txt:29 (find_package) -- Boost version: 1.66.0 -- Found the following Boost libraries: -- programoptions -- filesystem -- Found ZLIB: /home/star/pw31/software/anaconda/lib/libz.so (found version "1.2.11") -- Looking for sgemm -- Looking for sgemm_ - found -- A library with BLAS API found. -- Configuring done -- Generating done -- Build files have been written to: /home/star/pw31/chess/Engines/LCzero/leela-chess/build

... and then "make" results in ...

[ 81%] Building CXX object CMakeFiles/tests.dir/src/tests/network_test.cpp.o [ 84%] Building CXX object CMakeFiles/tests.dir/src/tests/perf_test.cpp.o [ 87%] Building CXX object CMakeFiles/tests.dir/src/tests/position_test.cpp.o [ 90%] Building CXX object CMakeFiles/tests.dir/src/tests/random_test.cpp.o [ 93%] Linking CXX executable tests /usr/bin/ld: CMakeFiles/objs.dir/src/Training.cpp.o: undefined reference to symbol '_ZN5boost6system16generic_categoryEv' /data/pw31/software/boost/lib/libboost_system.so.1.66.0: error adding symbols: DSO missing from command line

where "DSO" is a dynamic shared object, or a shared library in other words. I am missing a library in linking stage. I confirm that /data/pw31/software/boost/lib/libboost_system.so.1.66.0 is there, created by my boost_1_66 installation, which I think was successful. I realize that /usr/share/cmake-3.5/Modules/FindBoost.cmake was used, which comes from the system boost 1.54 installation.

Any help would be appreciated.