Ciekce / Stormphrax

UCI chess engine, with NNUE trained from zero knowledge
GNU General Public License v3.0
51 stars 11 forks source link

can't compile v5.0.0 on Linux #172

Open tissatussa opened 1 week ago

tissatussa commented 1 week ago

using your makefile, i get this error :

~/Compiled/Stormphrax-main-v5.0.0-PR171$ make CXX=clang++-17 PGO=off
Makefile:70: llvm-profdata not found, disabling PGO
clang++-17 -std=c++20 -O3 -flto -DNDEBUG -DSP_NETWORK_FILE=\"src/eval/stonegardens.nnue\" -DSP_VERSION=5.0.0 -D_SILENCE_CXX20_ATOMIC_INIT_DEPRECATION_WARNING -DSP_NATIVE -march=native -DSP_FAST_PEXT -pthread -fuse-ld=lld -o stormphrax-5.0.0-native src/main.cpp src/uci.cpp src/util/split.cpp src/position/position.cpp src/movegen.cpp src/search.cpp src/util/timer.cpp src/pretty.cpp src/ttable.cpp src/limit/time.cpp src/eval/nnue.cpp src/perft.cpp src/bench.cpp src/tunable.cpp src/opts.cpp src/3rdparty/fathom/tbprobe.cpp src/datagen/datagen.cpp src/wdl.cpp src/cuckoo.cpp src/datagen/marlinformat.cpp src/datagen/viri_binpack.cpp src/tb.cpp src/attacks/black_magic/attacks.cpp src/attacks/bmi2/attacks.cpp
ld.lld: error: /tmp/main-cec96e.o: Opaque pointers are only supported in -opaque-pointers mode (Producer: 'LLVM17.0.6' Reader: 'LLVM 14.0.0')
clang++-17: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:126: stormphrax-5.0.0] Error 1

i want a native build. i use Clang++-17 because you use code like std::chrono and my default Clang++ is v14.0.0 which can't handle that. i tried to solve the -opaque-pointers mode error with some extra arguments in the Makefile but i didn't succeed.

if you want more info about my notebook and installed programs & modules, let me know. i'm on Xubuntu 22.04

tissatussa commented 1 week ago

i solved the Issue by consulting ChatGPT, i even can use PGO now.

i had to install llvm-17, then i added this line in Makefile :

LINKER = lld-17

LDFLAGS is empty by default, but now i changed it :

LDFLAGS := -fuse-ld=$(LINKER)

(such line is already included for Darwin, but i use Linux, not Apple)

finally i changed all instances of llvm-profdata into llvm-profdata-17.