leela-zero / leela-zero

Go engine with no human-provided knowledge, modeled after the AlphaGo Zero paper.
GNU General Public License v3.0
5.27k stars 1.01k forks source link

Cannot compile on Linux mint 19.3 #2625

Open SamAmco opened 3 years ago

SamAmco commented 3 years ago

Hi, I'm trying to compile on Linux. I followed the build instructions in the README but when I run

cmake --build .

I eventually hit the following error:

[ 79%] Linking CXX executable leelaz
/usr/bin/ld: /usr/lib/llvm-7/bin/../lib/LLVMgold.so: error loading plugin: /usr/lib/llvm-7/bin/../lib/LLVMgold.so: cannot open shared object file: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
CMakeFiles/leelaz.dir/build.make:149: recipe for target 'leelaz' failed
make[2]: *** [leelaz] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/leelaz.dir/all' failed
make[1]: *** [CMakeFiles/leelaz.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

Would love to be able to compile so I can run Leela with Sabaki. Thanks.

l1t1 commented 3 years ago

why use llvm? gcc is enoug.

SamAmco commented 3 years ago

I didn't change anything. I just ran what is in your README here:

sudo apt install clinfo && clinfo

# Clone github repo
git clone https://github.com/leela-zero/leela-zero
cd leela-zero
git submodule update --init --recursive

# Install build depedencies
sudo apt install cmake g++ libboost-dev libboost-program-options-dev libboost-filesystem-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev zlib1g-dev

# Use a stand alone build directory to keep source dir clean
mkdir build && cd build

# Compile leelaz and autogtp in build subdirectory with cmake
cmake ..
cmake --build . 

Presumably this means there's something in your cmake file telling it to use llvm? Sorry I'm not very experienced with cmake and g++. It's possible it's something to do with my environment but I don't know what to check if that's the case?