SolveSpace Logo SOLVESPACE -- parametric 2d/3d CAD
Examples
Tutorials
Features
Download
Reference
Technology
Library
Forum
Contact
USER FORUM

(you are viewing a thread; or go back to list of threads)

compile and run on Raspberry Pi? (by Marc)
I tried to build SolveSpace on a Raspberry Pi, but I'm getting this error:

[ 8%] Built target dxfrw
[ 14%] Built target mimalloc-static
[ 34%] Built target solvespace-core
[ 38%] Built target slvs
[ 72%] Built target resources
[ 72%] Linking CXX executable ../bin/solvespace
/usr/bin/ld: ../bin/libmimalloc.a(stats.c.o): in function `mi_stat_process_info':
stats.c:(.text+0xf8): undefined reference to `__atomic_load_8'
/usr/bin/ld: stats.c:(.text+0x10c): undefined reference to `__atomic_load_8'

(there's more... the full log is attached)

This looks like a linker error to me, but that's where my expertise ends.

Is there a chance to get this working with a simple fix, or are SolveSpace and the Raspberry Pi fundamentally incompatible?
Tue Oct 26 2021, 17:54:10, download attachment error.txt
(no subject) (by ruevs)
Wed Oct 27 2021, 16:59:57
(no subject) (by Marc)
How do I fix that linker error, though?
I'm not familiar with gcc and ld and such.

I found mention of "cairo" and "atomic" in CMakeCache.txt, and I'm guessing that adding "-latomic" somewhere might be worth a try from reading https://lists.debian.org/debian-mips/2013/12/msg00033.html, but that's all super vague.

I'd really appreciate some help here.
Fri Oct 29 2021, 17:47:10
(no subject) (by ruevs)
The trick to compile on Raspberry Pi is to add:

set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")

on line 131 of "solvespace/git/CMakeLists.txt" so that it looks like this:

if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed ${CMAKE_EXE_LINKER_FLAGS}")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -latomic")
endif()

The problem comes from "solvespace/git/extlib/mimalloc/include/mimalloc-atomic.h" that uses acomics but the library (I do not why) is not linked by default.

The library is "find /usr/|grep libatomic.so"
Sat Jan 22 2022, 11:14:37
still not working (by Marc)
I missed your reply and gave up, but now I'm trying again and it's still not working. I updated CMakeLists.txt according to your advice, but I'm getting the exact same error.

Actually, the CMakeLists.txt I edited was in solvespace/CMakeLists.txt and not in solvespace/git/CMakeLists.txt, and I needed to make the change in line 134 instead of 131, but that's probably because the file has changed since then.

Either way the error is still the same, and I need to compile (as opposed to install as per https://github.com/solvespace/solvespace/issues/350 because I would like to use my enhancement from https://solvespace.com/forum.p...;parent=5151&tt=1677612274 on a raspberry pi.

Any additional help would be welcome.
Mon Jan 8 2024, 21:04:04
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):
© 2008-2022 SolveSpace contributors. Most recent update June 2 2022.