AlexandreRouma / SDRPlusPlus

Cross-Platform SDR Software
GNU General Public License v3.0
3.93k stars 540 forks source link

Further Compile Issues on OSX - 11.2.3 (Big Sur) #119

Closed jordancrombie closed 3 years ago

jordancrombie commented 3 years ago

Following on from #115 , it seems like there may be some additional challenges on OSX.

While previously I was able to compile up SDR++ so long as the Individual radio Options were commented out, the latest pulls now are failing to complete the build at all, dying specifically within the linker.

.... .... .... [ 95%] Linking CXX shared library libsdrpp_core.dylib ld: library not found for -lGLEW clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [core/libsdrpp_core.dylib] Error 1 make[1]: [core/CMakeFiles/sdrpp_core.dir/all] Error 2

OSX Info Darwin macbook34.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

Using Homebrew for required libs

atlex commented 3 years ago

I have the same issue on Mac OS Catalina 10.15.7. But glew is here:

$ pkg-config --list-all | grep -I glew glew glew - The OpenGL Extension Wrangler library

$ port search glew

glew @2.2.0 (graphics, devel)
    OpenGL Extension Wrangler Library

py-glewpy @0.7.4_12 (python, graphics)
    Python bindings for GLEW (OpenGL Extension Wrangler)

py27-glewpy @0.7.4_12 (python, graphics)
    Python bindings for GLEW (OpenGL Extension Wrangler)

Found 3 ports.

$ ls /usr/local/lib |grep glew

lrwxr-xr-x    1 alex  admin    46B Apr 24 22:25 libGLEW.2.2.0.dylib -> ../Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib
lrwxr-xr-x    1 alex  admin    44B Apr 24 22:25 libGLEW.2.2.dylib -> ../Cellar/glew/2.2.0_1/lib/libGLEW.2.2.dylib
loewal commented 3 years ago

I have these installed and get no errors:

/Users/Loewal/Downloads/ brew list glew /usr/local/Cellar/glew/2.2.0_1/bin/glewinfo /usr/local/Cellar/glew/2.2.0_1/bin/visualinfo /usr/local/Cellar/glew/2.2.0_1/include/GL/ (3 files) /usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib /usr/local/Cellar/glew/2.2.0_1/lib/cmake/ (4 files) /usr/local/Cellar/glew/2.2.0_1/lib/pkgconfig/glew.pc /usr/local/Cellar/glew/2.2.0_1/lib/ (3 other files) /usr/local/Cellar/glew/2.2.0_1/share/doc/ (20 files)

loewal commented 3 years ago

So I used Homebrew instead of Macports

atlex commented 3 years ago

I also installed the GLEW with Homebrew.

$ brew list glew /usr/local/Cellar/glew/2.2.0_1/bin/glewinfo /usr/local/Cellar/glew/2.2.0_1/bin/visualinfo /usr/local/Cellar/glew/2.2.0_1/include/GL/ (3 files) /usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib /usr/local/Cellar/glew/2.2.0_1/lib/cmake/ (4 files) /usr/local/Cellar/glew/2.2.0_1/lib/pkgconfig/glew.pc /usr/local/Cellar/glew/2.2.0_1/lib/ (3 other files) /usr/local/Cellar/glew/2.2.0_1/share/doc/ (20 files)

and I still have "ld: library not found for -lGLEW".

@loewal you can try git pull and make again.

jordancrombie commented 3 years ago

Just for completeness (as noted above, I'm using Homebrew)

$ brew list glew /usr/local/Cellar/glew/2.2.0_1/bin/glewinfo /usr/local/Cellar/glew/2.2.0_1/bin/visualinfo /usr/local/Cellar/glew/2.2.0_1/include/GL/ (3 files) /usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib /usr/local/Cellar/glew/2.2.0_1/lib/cmake/ (4 files) /usr/local/Cellar/glew/2.2.0_1/lib/pkgconfig/glew.pc /usr/local/Cellar/glew/2.2.0_1/lib/ (3 other files) /usr/local/Cellar/glew/2.2.0_1/share/doc/ (20 files)

However I did notice some relative wonkiness within the Cellar for Homebrew Glew...(quite a bit of version Sym-linking).

lrwxr-xr-x 1 jcrombie admin 17 Mar 15 2020 libGLEW.dylib -> libGLEW.2.2.dylib -r--r--r-- 1 jcrombie admin 660880 Mar 15 2020 libGLEW.a lrwxr-xr-x 1 jcrombie admin 19 Mar 15 2020 libGLEW.2.2.dylib -> libGLEW.2.2.0.dylib drwxr-xr-x 3 jcrombie admin 96 Mar 15 2020 cmake drwxr-xr-x 8 jcrombie admin 256 Mar 15 2020 . -r--r--r-- 1 jcrombie admin 518336 Apr 26 23:52 libGLEW.2.2.0.dylib drwxr-xr-x 3 jcrombie admin 96 Apr 26 23:52 pkgconfig drwxr-xr-x 10 jcrombie admin 320 Apr 26 23:52 ..

$ md5 /usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib MD5 (/usr/local/Cellar/glew/2.2.0_1/lib/libGLEW.2.2.0.dylib) = 01cdf06b729b494b69f2d3e61a47f75d

$ md5 /usr/local/lib/libGLEW.* MD5 (/usr/local/lib/libGLEW.2.2.0.dylib) = 01cdf06b729b494b69f2d3e61a47f75d (Sym-link) MD5 (/usr/local/lib/libGLEW.2.2.dylib) = 01cdf06b729b494b69f2d3e61a47f75d (Sym-link) MD5 (/usr/local/lib/libGLEW.a) = 702c06ef9c8181b173896e403f89638f MD5 (/usr/local/lib/libGLEW.dylib) = 01cdf06b729b494b69f2d3e61a47f75d (Sym-link)

Im going to rip it all out and try again....

AlexandreRouma commented 3 years ago

Hello,

could you run pkg-config --libs glew and show what it returns?

jordancrombie commented 3 years ago

I just ripped it all out, and reinstalled (so I dont have the command run before that) However I did run just before I did: $ pkg-config --list-all | grep -I glew glew glew - The OpenGL Extension Wrangler library

That said, even after reinstalling, and cleaning up brew, still get the error: [ 63%] Linking CXX shared library libsdrpp_core.dylib

ld: library not found for -lGLEW clang: error: linker command failed with exit code 1 (use -v to see invocation)

To that end, here is the command output as requested: $ pkg-config --libs glew -L/usr/local/Cellar/glew/2.2.0_1/lib -lGLEW

AlexandreRouma commented 3 years ago

try ls /usr/local/Cellar/glew/2.2.0_1/lib and see which files are in there for some reason I remember it being libglew.dylib and not libGLEW.dylib.

jordancrombie commented 3 years ago

I think we are thinking along the same lines:

macbook34:build jcrombie$ ls /usr/local/Cellar/glew/2.2.0_1/lib cmake libGLEW.2.2.0.dylib libGLEW.2.2.dylib libGLEW.a libGLEW.dylib pkgconfig

On a hunch I tired adding first glew, then fftw, etc) in the direct paths to LIBRARY_PATHS (which of course breaks other things, needing to one by one add them in), however I WAS able to get past the compile error (it finds the libs). Of course because the LIBRARY_PATHS is hand spun, it cant find anything (its now dying looking for Soapy)..

macbook34:build jcrombie$ export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/Cellar/glew/2.2.0_1/lib:/usr/local/Cellar/fftw/3.3.9/lib:/usr/local/Cellar/glfw/3.3.4/lib:/usr/local/Cellar/volk/2.4.1_1/lib" macbook34:build jcrombie$ make [ 1%] Linking CXX shared library libsdrpp_core.dylib [ 56%] Built target sdrpp_core [ 57%] Building CXX object CMakeFiles/sdrpp.dir/src/main.cpp.o [ 59%] Linking CXX executable sdrpp [ 59%] Built target sdrpp [ 59%] Built target do_always [ 60%] Building CXX object radio/CMakeFiles/radio.dir/src/main.cpp.o

jordancrombie commented 3 years ago

Got it to fully compile up by doing declaring as follows before building:

export LIBRARY_PATH=:/usr/local/Cellar/glew/2.2.0_1/lib:/usr/local/lib

Im thinking its something with the symlinks that Brew creates? It fails if only using /usr/local/lib, but the direct linking allows it to find what it is looking for.

Its not ideal...but its a workaround

atlex commented 3 years ago

No luck for me. Still have "ld: library not found for -lGLEW".

AlexandreRouma commented 3 years ago

I think I know what the issue is, a few days ago I removed "target_link_directoriy" cmake commands to allow compiling on older cmake versions. I'll try adding them back and see if it fixes it.

loewal commented 3 years ago

I had to remove the references to airspy, airspyhf, perseus and bladerf in the main makefile. Then it compiles, otherwise things like airspyhf.h etc. are not found. I pulled the airspyhf from airspy and copied the necessary files, but later on things like lbiio prevent it to continue. (#include <libairspyhf/airspyhf.h> in src-directory.....where is this interms of real location?)

In Linux all went fine

loewal commented 3 years ago

Pulled most recent source: /Users/Loewal/Downloads/SDRPlusPlus/airspyhf_source/src/main.cpp:10:10: fatal error: 'libairspyhf/airspyhf.h' file not found

include <libairspyhf/airspyhf.h>

     ^~~~~~~~~~~~~~~~~~~~~~~~

2 warnings and 1 error generated. make[2]: [airspyhf_source/CMakeFiles/airspyhf_source.dir/src/main.cpp.o] Error 1 make[1]: [airspyhf_source/CMakeFiles/airspyhf_source.dir/all] Error 2 make: *** [all] Error 2

loewal commented 3 years ago

This was after missing sources were edited.

loewal commented 3 years ago

Pulled again after the airspy-change in the source:

Same error as above...or is it an ongoing project and should we wait?

AlexandreRouma commented 3 years ago

The airspy include stuff should be fixed now, but i'm still running into the weird EventManager thingy :/

jordancrombie commented 3 years ago

Can confirm these changes seem to have done the trick. Still seeing the #115 issue as well, but I think this one looks fixed. Maybe @loewal wants to chime in? If not Ill close this.

loewal commented 3 years ago

Tried again this morning.

include <libairspyhf/airspyhf.h>

     ^~~~~~~~~~~~~~~~~~~~~~~~

2 warnings and 1 error generated. make[2]: [airspyhf_source/CMakeFiles/airspyhf_source.dir/src/main.cpp.o] Error 1 make[1]: [airspyhf_source/CMakeFiles/airspyhf_source.dir/all] Error 2 make: *** [all] Error 2

Is there something I forget Alexander?

loewal commented 3 years ago

I removed references to airspy, airspyhf, bladerf and forgot perseus.

This happened:

include

     ^~~~~~~

2 warnings and 1 error generated. make[2]: [plutosdr_source/CMakeFiles/plutosdr_source.dir/src/main.cpp.o] Error 1 make[1]: [plutosdr_source/CMakeFiles/plutosdr_source.dir/all] Error 2 make: *** [all] Error 2

Any help?

loewal commented 3 years ago

Removed also the perseus-reference in the main cmake-file. Compiles well. sdrpp ----> SoapySDR ----> segmentation fault sdrpp ----> Hackrf ----> crash

AlexandreRouma commented 3 years ago

The hackrf module can't be used along with the soapysdr module. You need to delete one of them.

AlexandreRouma commented 3 years ago

Just found the issue for the EventHandler thingy. Will push a fix shortly.

AlexandreRouma commented 3 years ago

closing since MacOS compile issues seem to have been fixed.

loewal commented 3 years ago

Still having issues....

/Users/Loewal/Downloads/SDRPlusPlus/plutosdr_source/src/main.cpp:8:10: fatal error: 'iio.h' file not found

include

     ^~~~~~~

2 warnings and 1 error generated. make[2]: [plutosdr_source/CMakeFiles/plutosdr_source.dir/src/main.cpp.o] Error 1 make[1]: [plutosdr_source/CMakeFiles/plutosdr_source.dir/all] Error 2 make: *** [all] Error 2

How to install libiio?

loewal commented 3 years ago

I did: brew install libiio but still not found...

loewal commented 3 years ago

I am also working with SDRangel and there the compilation of Pluto goes well. Also libiio....

AlexandreRouma commented 3 years ago

haven't tested the pluto stuff yet. lib paths might be wrong Also I have no idea how to install it you can disable it with -DOPT_BUILD_PLUTOSDR_SOURCE=OFF