User avatar
CypherOz
Posts: 51
Joined: Fri Jul 05, 2019 1:46 pm

Stockfish compile (link) fails on RPi4 -- undefined reference to `__atomic_load_8' etc.

Tue Jul 16, 2019 5:51 am

Hi

I can't seem to build stockfish (latest DEV git clone)...

Help please! Thanks in adavnce

Code: Select all

pi@KymPI:~/Stockfish/src $ sudo make -j4 profile-build ARCH=armv7

Config:
debug: 'no'
sanitize: 'no'
optimize: 'yes'
arch: 'armv7'
bits: '32'
kernel: 'Linux'
os: 'GNU/Linux'
prefetch: 'yes'
popcnt: 'no'
sse: 'no'
pext: 'no'

Flags:
CXX: g++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -std=c++11  -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto
LDFLAGS:  -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++11  -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto

Testing config sanity. If this fails, try 'make help' ...


Step 1/4. Building instrumented executable ...
make ARCH=armv7 COMP=gcc gcc-profile-make
make[1]: Entering directory '/home/pi/Stockfish/src'
make ARCH=armv7 COMP=gcc \
EXTRACXXFLAGS='-fprofile-generate' \
EXTRALDFLAGS='-lgcov' \
all
make[2]: Entering directory '/home/pi/Stockfish/src'
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o benchmark.o benchmark.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o bitbase.o bitbase.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o bitboard.o bitboard.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o endgame.o endgame.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o evaluate.o evaluate.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o main.o main.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o material.o material.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o misc.o misc.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o movegen.o movegen.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o movepick.o movepick.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o pawns.o pawns.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o position.o position.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o psqt.o psqt.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o search.o search.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o thread.o thread.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o timeman.o timeman.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o tt.o tt.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o uci.o uci.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o ucioption.o ucioption.cpp
g++ -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto   -c -o syzygy/tbprobe.o syzygy/tbprobe.cpp
g++ -o stockfish benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o material.o misc.o movegen.o movepick.o pawns.o position.o psqt.o search.o thread.o timeman.o tt.o uci.o ucioption.o syzygy/tbprobe.o -lgcov -Wl,--no-as-needed -lpthread -Wall -Wcast-qual -fno-exceptions -std=c++11 -fprofile-generate -pedantic -Wextra -Wshadow -DNDEBUG -O3 -flto
/usr/bin/ld: /tmp/ccX3j06u.ltrans0.ltrans.o: in function `TimeManagement::elapsed() const [clone .isra.77] [clone .constprop.24]':
<artificial>:(.text+0x5738): undefined reference to `__atomic_load_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans0.ltrans.o: in function `Value (anonymous namespace)::search<((anonymous namespace)::NodeType)1>(Position&, Search::Stack*, Value, Value, Depth, bool) [clone .constprop.5]':
<artificial>:(.text+0xcfa8): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xdf60): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xe0f4): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: <artificial>:(.text+0xf48c): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xf5c0): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans3.ltrans.o: in function `ThreadPool::start_thinking(Position&, std::unique_ptr<std::deque<StateInfo, std::allocator<StateInfo> >, std::default_delete<std::deque<StateInfo, std::allocator<StateInfo> > > >&, Search::LimitsType const&, bool)':
<artificial>:(.text+0xa7f8): undefined reference to `__atomic_store_8'
/usr/bin/ld: <artificial>:(.text+0xa80c): undefined reference to `__atomic_store_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans3.ltrans.o: in function `UCI::loop(int, char**)':
<artificial>:(.text+0xe10c): undefined reference to `__atomic_load_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans6.ltrans.o: in function `Position::do_move(Move, StateInfo&, bool)':
<artificial>:(.text+0x5ca4): undefined reference to `__atomic_fetch_add_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans6.ltrans.o: in function `(anonymous namespace)::ThreadHolding::ThreadHolding(Thread*, unsigned long long, int) [clone .lto_priv.246]':
<artificial>:(.text+0xc160): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xc1c4): undefined reference to `__atomic_store_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans7.ltrans.o: in function `dbg_print()':
<artificial>:(.text+0xcc90): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xcca8): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xccfc): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xcd5c): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xcdb8): undefined reference to `__atomic_load_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans7.ltrans.o:<artificial>:(.text+0xcdcc): more undefined references to `__atomic_load_8' follow
/usr/bin/ld: /tmp/ccX3j06u.ltrans5.ltrans.o: in function `Thread::search()':
<artificial>:(.text+0x6534): undefined reference to `__atomic_store_8'
/usr/bin/ld: <artificial>:(.text+0x6828): undefined reference to `__atomic_load_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans5.ltrans.o: in function `MainThread::search()':
<artificial>:(.text+0x7a18): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0x7e38): undefined reference to `__atomic_store_8'
/usr/bin/ld: <artificial>:(.text+0x827c): undefined reference to `__atomic_store_8'
/usr/bin/ld: <artificial>:(.text+0x82cc): undefined reference to `__atomic_load_8'
/usr/bin/ld: /tmp/ccX3j06u.ltrans5.ltrans.o: in function `Value (anonymous namespace)::search<((anonymous namespace)::NodeType)0>(Position&, Search::Stack*, Value, Value, Depth, bool) [clone .lto_priv.247]':
<artificial>:(.text+0xb228): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xb3a0): undefined reference to `__atomic_load_8'
/usr/bin/ld: <artificial>:(.text+0xd4f8): undefined reference to `__atomic_fetch_add_8'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:500: stockfish] Error 1
make[2]: Leaving directory '/home/pi/Stockfish/src'
make[1]: *** [Makefile:516: gcc-profile-make] Error 2
make[1]: Leaving directory '/home/pi/Stockfish/src'
make: *** [Makefile:422: profile-build] Error 2
pi@KymPI:~/Stockfish/src $ 
--
Regards, Kym
Retired software bloke from Adelaide, South Australia

User avatar
CypherOz
Posts: 51
Joined: Fri Jul 05, 2019 1:46 pm

Re: Stockfish compile (link) fails on RPi4 -- undefined reference to `__atomic_load_8' etc.

Tue Jul 16, 2019 5:52 am

I have not been able to find anything useful via google as to missing library etc.
Stumped by this issue
--
Regards, Kym
Retired software bloke from Adelaide, South Australia

User avatar
PeterO
Posts: 6095
Joined: Sun Jul 22, 2012 4:14 pm

Re: Stockfish compile (link) fails on RPi4 -- undefined reference to `__atomic_load_8' etc.

Tue Jul 16, 2019 5:58 am

CypherOz wrote:
Tue Jul 16, 2019 5:52 am
I have not been able to find anything useful via google as to missing library etc.
Stumped by this issue
What did you search for ? Google produces lots of hits on "atomic_load_8" and some even mention libatomic :shock:
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
CypherOz
Posts: 51
Joined: Fri Jul 05, 2019 1:46 pm

Re: Stockfish compile (link) fails on RPi4 -- undefined reference to `__atomic_load_8' etc.

Tue Jul 16, 2019 6:06 am

Making progress...

sudo make -j4 profile-build ARCH=armv7 LDFLAGS="-latomic"

Seems to be better, but another error to fix ...
--
Regards, Kym
Retired software bloke from Adelaide, South Australia

User avatar
CypherOz
Posts: 51
Joined: Fri Jul 05, 2019 1:46 pm

Re: Stockfish compile (link) fails on RPi4 -- undefined reference to `__atomic_load_8' etc.

Tue Jul 16, 2019 6:39 am

This works...

Code: Select all

sudo make clean

sudo make -j4 profile-build ARCH=armv7 LDFLAGS="-latomic -lpthread -lgcov"

sudo make install
--
Regards, Kym
Retired software bloke from Adelaide, South Australia

User avatar
CypherOz
Posts: 51
Joined: Fri Jul 05, 2019 1:46 pm

Re: Stockfish compile (link) fails on RPi4 -- undefined reference to `__atomic_load_8' etc.

Tue Jul 16, 2019 6:41 am

PeterO wrote:
Tue Jul 16, 2019 5:58 am
CypherOz wrote:
Tue Jul 16, 2019 5:52 am
I have not been able to find anything useful via google as to missing library etc.
Stumped by this issue
What did you search for ? Google produces lots of hits on "atomic_load_8" and some even mention libatomic :shock:
PeterO
My search was too specific... sorted now ... thanks!
--
Regards, Kym
Retired software bloke from Adelaide, South Australia

Return to “Beginners”