digego / extempore

A cyber-physical programming environment
1.41k stars 127 forks source link

Build error involving libm #365

Closed dgrisham closed 5 years ago

dgrisham commented 5 years ago

I'm getting an error at the step of linking sndfile-metadata-set:

/usr/bin/ld: CMakeFiles/sndfile-metadata-set.dir/programs/common.c.o: undefined reference to symbol 'round@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I've tried adding the -lm in a few places, as per the advice here: https://github.com/NanoComp/libctl/issues/1, but haven't figured it out yet.

Here's more context to the output:

Install the project...                                                         
-- Install configuration: "Release"                                            
-- Installing: /home/grish/scratch/extempore/cmake-build/deps-install/lib/libkiss_fft.so
-- Installing: /home/grish/scratch/extempore/cmake-build/deps-install/include/kiss_fft.h
-- Installing: /home/grish/scratch/extempore/cmake-build/deps-install/include/kfc.h
-- Installing: /home/grish/scratch/extempore/cmake-build/deps-install/include/kiss_fftnd.h
-- Installing: /home/grish/scratch/extempore/cmake-build/deps-install/include/kiss_fftndr.h
-- Installing: /home/grish/scratch/extempore/cmake-build/deps-install/include/kiss_fftr.h
[ 61%] Completed 'kiss_fft'                                                    
[ 61%] Built target kiss_fft                                                   
[ 62%] Performing build step for 'sndfile'
[  0%] Built target GENFILES                                                   
[ 65%] Built target sndfile                                                    
[ 65%] Linking C executable sndfile-metadata-set
/usr/bin/ld: CMakeFiles/sndfile-metadata-set.dir/programs/common.c.o: undefined reference to symbol 'round@@GLIBC_2.2.5'
/usr/bin/ld: /usr/lib/libm.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[5]: *** [CMakeFiles/sndfile-metadata-set.dir/build.make:100: sndfile-metadata-set] Error 1
make[4]: *** [CMakeFiles/Makefile2:203: CMakeFiles/sndfile-metadata-set.dir/all] Error 2
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [CMakeFiles/sndfile.dir/build.make:115: libsndfile/src/sndfile-stamp/sndfile-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1240: CMakeFiles/sndfile.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
benswift commented 5 years ago

Hey there, what OS and C compiler are you using?

dgrisham commented 5 years ago

@benswift I'm on Arch Linux and using Clang (I ran the build commands again after doing export CC=clang to be sure, and I got the same error):

$ uname -a              
Linux archlinux 5.3.1-arch1-1-ARCH #1 SMP PREEMPT Sat Sep 21 11:33:49 UTC 2019 x86_64 GNU/Linux

$ clang --version
clang version 8.0.1 (tags/RELEASE_801/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin