[Cs-dev] Compiling Csound6 on RPi
Date | 2013-08-10 07:59 |
From | David Akbari |
Subject | [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
Hello List, Is there a way to do --disable-atomic using CMake? I am trying to compile Csound 6 on Raspberry Pi and everything seems to compile OK but when it comes down to linking I am having some trouble with the message:
"../libcsound64.so.6.0: undefined reference to `__sync_fetch_and_add_8' ../libcsound64.so.6.0: undefined reference to `__sync_lock_test_and_set_8'"
Any clues? Full console log appended. Cheers, David pi@raspberrypi ~/csound6-git $ make [ 67%] Built target csound64 [ 67%] Built target ampmidid
[ 67%] Built target cellular [ 67%] Built target control [ 67%] Built target cs_date [ 67%] Built target doppler [ 67%] Built target fareygen [ 68%] Built target fractalnoise
[ 68%] Built target image [ 69%] Built target jackTransport [ 69%] Built target jacko [ 69%] Built target joystick [ 70%] Built target mixer [ 70%] Built target osc
[ 71%] Built target platerev [ 71%] Built target py [ 71%] Built target scansyn [ 72%] Built target serial [ 72%] Built target signalflowgraph [ 73%] Built target system_call
[ 73%] Built target urandom [ 73%] Built target ipmidi [ 73%] Built target pmidi [ 74%] Built target rtalsa [ 74%] Built target rtjack [ 74%] Built target rtpulse
[ 77%] Built target virtual [ 78%] Built target widgets [ 80%] Built target libcsnd [ 80%] Built target _csnd6 [ 81%] Built target csbeats [ 82%] Built target csladspa
Linking C executable ../csound ../libcsound64.so.6.0: undefined reference to `__sync_fetch_and_add_8' ../libcsound64.so.6.0: undefined reference to `__sync_lock_test_and_set_8' collect2: ld returned 1 exit status
make[2]: *** [csound] Error 1 make[1]: *** [frontends/CMakeFiles/csound-bin.dir/all] Error 2 make: *** [all] Error 2 |
Date | 2013-08-10 09:43 |
From | David Akbari |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
Of note, Csound5 compiles and runs without issue. On Sat, Aug 10, 2013 at 1:59 AM, David Akbari <dakbari@gmail.com> wrote:
|
Date | 2013-08-10 18:42 |
From | Steven Yi |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Hi Dave, That's a bit odd as I had thought that others had compiled on Raspberry PI. You might try removing "#define HAVE_ATOMIC_BUILTIN" in csound6/include/csound.h to see if that will get you a build. If so, please file a bug in the tracker with information from your email, and mention that CMake should be modified to check for the presence of the atomic functions used and only then enable them. Thanks! steven On Sat, Aug 10, 2013 at 8:59 AM, David Akbari |
Date | 2013-08-10 23:23 |
From | David Akbari |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
Hello Steven, Thanks for your email. It looks like that sorted it! I simply removed the #define HAVE_ATOMIC_BUILTIN from ./csound6-git/include/csound.h and it compiled and linked just fine.
Note that your observation about others getting Csound up and running on RPi is consistent with my experience, as Csound 5 compiles, links, and runs without issue straight from the git repository.
I will have a look at documenting my findings later using the tracker. Cheers, David On Sat, Aug 10, 2013 at 12:42 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Dave, |
Date | 2013-08-12 20:46 |
From | Steven Yi |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Hi Dave, I've modified the build to do a check for support for the atomic stuff. Could you try the latest from GIT? Thanks! steven On Sun, Aug 11, 2013 at 12:23 AM, David Akbari |
Date | 2013-08-14 15:09 |
From | David Akbari |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
Hello Steven, Thanks for your email. I really appreciate the time you put into this! First pass I got this (like last time). Not sure why. pi@raspberrypi /media/TEMP/RPi/csound6-git $ make [ 0%] Generating csound_prelex.c [ 1%] Generating csound_orclex.c [ 1%] Generating csound_orcparse.c /media/TEMP/RPi/csound6-git/Engine/csound_orc.y: conflicts: 4 shift/reduce, 10 reduce/reduce
Scanning dependencies of target csound64 [ 2%] Building C object CMakeFiles/csound64.dir/Engine/auxfd.c.o cc1: error: unrecognized command line option â-mfpmath=sseâ make[2]: *** [CMakeFiles/csound64.dir/Engine/auxfd.c.o] Error 1
make[1]: *** [CMakeFiles/csound64.dir/all] Error 2 make: *** [all] Error 2 Deleting this in CMakeLists.txt fixes it consistent with advice given on an archived email from the list:
add_compiler_flags(${libcsound_CFLAGS} -fvisibility=hidden -ffast-math -mfpmath=sse -fomit-frame-pointer TARGETS ${CSOUNDLIB}) I also got the same linking errors as before. Note that this is on an entirely new SD card so I am certain there aren't left over pieces and the checkout is fresh. As before, simply removing the preprocessor instruction in csound.h gets a working build on RPi.
Of course, I cannot rule out user interaction as a factor for this anomalous behavior. I will have more time this weekend to investigate. In the meantime, thanks for your time and consideration of this issue!
Cheers, David On Mon, Aug 12, 2013 at 2:46 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Dave, |
Date | 2013-08-14 15:10 |
From | David Akbari |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
Forgot to ask, is there a way to have make output what it is doing more verbosely? It looks very elegant the way it is set up by default but perhaps the operand to the -D compiler flag is not getting passed appropriately. Would like to confirm this.
On Wed, Aug 14, 2013 at 9:09 AM, David Akbari <dakbari@gmail.com> wrote:
|
Date | 2013-08-14 16:07 |
From | Steven Yi |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Hi Dave, Two things: 1. I think you might be building off the master branch and not the develop branch as the cmake stuff your referenced has been taken out with the latest. Check what branch you're on with "git status" or "git branch". If that's the case, do a "git checkout -b develop origin/develop". You'll be on the develop branch and can pull any latest changes. 2. For verbose makefiles, you can use -DCMAKE_VERBOSE_MAKEFILE=1. You can also see how to do it in the Custom.cmake.ex (which you can copy to Custom.cmake and then modify). Thanks! steven On Wed, Aug 14, 2013 at 4:10 PM, David Akbari |
Date | 2013-08-14 16:38 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
You can also run with: make VERBOSE=1 A On Aug 14, 2013 8:07 AM, "Steven Yi" <stevenyi@gmail.com> wrote:
Hi Dave, |
Date | 2013-08-15 02:51 |
From | David Akbari |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Attachments | None None |
Hello Steven and Andres, Thanks for your replies. The first tip was very helpful and I was indeed on the master branch. Now this time on the develop branch: pi@raspberrypi /media/TEMP/RPi/csound6-git $ git status
# On branch develop # Untracked files: # (use "git add <file>..." to include in what will be committed) # # CPackConfig.cmake # CPackSourceConfig.cmake
# csnd6.py nothing added to commit but untracked files present (use "git add" to track) Everything works fine in CMake and everything works great until I get to this point:
cd /media/TEMP/RPi/csound6-git/frontends && /usr/bin/cmake -E cmake_link_script CMakeFiles/csound-bin.dir/link.txt --verbose=1 /usr/bin/gcc -ffast-math -fomit-frame-pointer -fvisibility=hidden -DHAVE_ATOMIC_BUILTIN -fopenmp CMakeFiles/csound-bin.dir/csound/csound_main.c.o CMakeFiles/csound-bin.dir/csound/sched.c.o -o ../csound -rdynamic ../libcsound64.so.6.0 -lpthread -Wl,-rpath,/media/TEMP/RPi/csound6-git:
../libcsound64.so.6.0: undefined reference to `__sync_fetch_and_add_8' ../libcsound64.so.6.0: undefined reference to `__sync_lock_test_and_set_8' collect2: ld returned 1 exit status
make[2]: *** [csound] Error 1 make[2]: Leaving directory `/media/TEMP/RPi/csound6-git' make[1]: *** [frontends/CMakeFiles/csound-bin.dir/all] Error 2 make[1]: Leaving directory `/media/TEMP/RPi/csound6-git'
make: *** [all] Error 2 It seems that the -DHAVE_ATOMIC_BUILTIN check is succeeding where it shouldn't perhaps... looking further into the verbose output of CMake The CMake configuration includes the following: -- The C compiler identification is GNU 4.6.3 -- The CXX compiler identification is GNU 4.6.3 -- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- 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 -- /media/Zendikar/TEMP/RPi/csound6-git LIBRARY INSTALL DIR: lib
-- Performing Test HAS_TREE_VECTORIZE -- Performing Test HAS_TREE_VECTORIZE - Success -- Performing Test HAS_CXX_TREE_VECTORIZE -- Performing Test HAS_CXX_TREE_VECTORIZE - Success
-- Performing Test HAS_FAST_MATH -- Performing Test HAS_FAST_MATH - Success -- Performing Test HAS_CXX_FAST_MATH -- Performing Test HAS_CXX_FAST_MATH - Success -- Performing Test HAS_FPMATH_SSE
-- Performing Test HAS_FPMATH_SSE - Failed -- Performing Test HAS_CXX_FPMATH_SSE -- Performing Test HAS_CXX_FPMATH_SSE - Failed -- Performing Test HAS_SSE2 -- Performing Test HAS_SSE2 - Failed
-- Performing Test HAS_CXX_SSE2 -- Performing Test HAS_CXX_SSE2 - Failed -- Performing Test HAS_OMIT_FRAME_POINTER -- Performing Test HAS_OMIT_FRAME_POINTER - Success -- Performing Test HAS_CXX_OMIT_FRAME_POINTER
-- Performing Test HAS_CXX_OMIT_FRAME_POINTER - Success -- Not using Custom.cmake file. -- Performing Test HAS_VISIBILITY_HIDDEN -- Performing Test HAS_VISIBILITY_HIDDEN - Success
-- Performing Test HAS_CXX_VISIBILITY_HIDDEN -- Performing Test HAS_CXX_VISIBILITY_HIDDEN - Success -- BUILD_BIN_DIR set to /media/Zendikar/TEMP/RPi/csound6-git -- BUILD_LIB_DIR set to /media/Zendikar/TEMP/RPi/csound6-git
-- BUILD_PLUGINS_DIR set to /media/Zendikar/TEMP/RPi/csound6-git -- Check if the system is big endian -- Searching 16 bit integer -- Looking for sys/types.h -- Looking for sys/types.h - found
-- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of unsigned short -- Check size of unsigned short - done
-- Using unsigned short -- Check if the system is big endian - little endian -- Try OpenMP C flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp] -- Performing Test OpenMP_FLAG_DETECTED -- Performing Test OpenMP_FLAG_DETECTED - Success -- Found OpenMP: -fopenmp -- Performing Test HAVE_ATOMIC_BUILTIN
-- Performing Test HAVE_ATOMIC_BUILTIN - Success -- Looking for libintl.h -- Looking for libintl.h - found -- Looking for C++ include eigen3/Eigen/Dense -- Looking for C++ include eigen3/Eigen/Dense - not found
-- Found Gettext: /usr/bin/msgmerge (found version "0.18.1") -- Looking for lrint in m -- Looking for lrint in m - found -- Looking for unistd.h -- Looking for unistd.h - found
-- Looking for io.h -- Looking for io.h - not found -- Looking for fcntl.h -- Looking for fcntl.h - found -- Looking for sys/time.h -- Looking for sys/time.h - found
-- Looking for termios.h -- Looking for termios.h - found -- Looking for values.h -- Looking for values.h - found -- Looking for winsock.h -- Looking for winsock.h - not found
-- Looking for sys/socket.h -- Looking for sys/socket.h - found -- Looking for dirent.h -- Looking for dirent.h - found -- USE_LRINT is enabled -- Found FLEX: /usr/bin/flex (found version "2.5.35")
-- Found BISON: /usr/bin/bison (found version "2.5") -- Looking for pthread_spin_lock -- Looking for pthread_spin_lock - found -- Looking for pthread_barrier_init -- Looking for pthread_barrier_init - found
-- USE_OPEN_MP is enabled -- Not building with score parser -- Not building with new parser debugging -- Building with multicore -- USE_GETTEXT is enabled -- Using GNU Gettext
-- Building on Linux -- Looking for strtok_r -- Looking for strtok_r - found -- Looking for strtod_l -- Looking for strtod_l - found -- Boost version: 1.50.0
-- Looking for ladspa.h -- Looking for ladspa.h - not found -- Looking for fluidsynth.h -- Looking for fluidsynth.h - not found -- Looking for jack/jack.h -- Looking for jack/jack.h - found
-- Looking for C++ include gmm/gmm.h -- Looking for C++ include gmm/gmm.h - not found -- Looking for lo/lo.h -- Looking for lo/lo.h - found -- Found ZLIB: /usr/lib/arm-linux-gnueabihf/libz.so (found version "1.2.7")
-- Found PNG: /usr/lib/arm-linux-gnueabihf/libpng.so (found version "1.2.49") -- Found PythonLibs: /usr/lib/libpython2.7.so (found version "2.7.3")
-- Looking for wiiuse.h -- Looking for wiiuse.h - not found -- Looking for p5glove.h -- Looking for p5glove.h - not found I pastebinned the rest of it here: http://pastebin.com/0BgfRmh7
Best regards, David On Wed, Aug 14, 2013 at 10:07 AM, Steven Yi <stevenyi@gmail.com> wrote: Hi Dave, |
Date | 2013-08-15 03:53 |
From | Steven Yi |
Subject | Re: [Cs-dev] Compiling Csound6 on RPi |
Hi Dave, Thanks for the feedback. I was actually getting a similar issue on Windows but I thought it was something strange with my setup as it actually *should* have those atomic functions. I noticed in cs_new_dispatch there's these: #define ATOMIC_READ(x) __sync_fetch_and_or(&(x), 0) #define ATOMIC_WRITE(x,v) __sync_fetch_and_and(&(x), v) #define ATOMIC_CAS(x,current,new) __sync_bool_compare_and_swap(x,current,new) which are getting used but aren't really tested to exist. That seems problematic to me as it means it's assuming GCC. However, that shouldn't be the issue here as you were able to compile before by just removing HAVE_ATOMIC_BUILTIN. Ah... okay, I found place where a header was defining HAVE_ATOMIC_BUILTIN. I should have removed that earlier. Could you pull the latest and try again? Thanks! steven On Wed, Aug 14, 2013 at 9:51 PM, David Akbari |