CubicSDR icon indicating copy to clipboard operation
CubicSDR copied to clipboard

Please update OSX build documentation

Open ghost opened this issue 9 years ago • 33 comments

Please add a section on how to build hamlib for CubicSDR. I tried to build it without hamlib, but the make process still asks for the hamlib development files.

ghost avatar Oct 22 '16 17:10 ghost

Hmm, still working here with my latest hamlib build but I'll do a fresh pull and look into this.

cjcliffe avatar Nov 03 '16 02:11 cjcliffe

TonsMacBookPro:build tmachielsen$ cmake ../ -DwxWidgets_CONFIG_EXECUTABLE=/Users/tmachielsen/Dev/wxWidgets-3.1.0/wxWidgets-staticlib/bin/wx-config -DCMAKE_BUILD_TYPE=Release -DBUNDLE_APP=1 -DCPACK_BINARY_DRAGNDROP=1 -DUSE_HAMLIB=1
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- HAMLIB was not found.
CMake Error at CMakeLists.txt:47 (message):
  hamlib development files not found...


-- Configuring incomplete, errors occurred!
See also "/Users/tmachielsen/Dev/CubicSDR/build/CMakeFiles/CMakeOutput.log".

BTW, i updated the CubicSDR cmake command to include /Dev/ n the path. I made an error in the change description of the page though. :-(

ghost avatar Nov 13 '16 10:11 ghost

And BTW, same happens when you don't include -DUSE_HAMLIB=1

TonsMacBookPro:build tmachielsen$ cmake ../ -DwxWidgets_CONFIG_EXECUTABLE=/Users/tmachielsen/Dev/wxWidgets-3.1.0/wxWidgets-staticlib/bin/wx-config -DCMAKE_BUILD_TYPE=Release -DBUNDLE_APP=1 -DCPACK_BINARY_DRAGNDROP=1
-- HAMLIB was not found.
CMake Error at CMakeLists.txt:47 (message):
  hamlib development files not found...


-- Configuring incomplete, errors occurred!
See also "/Users/tmachielsen/Dev/CubicSDR/build/CMakeFiles/CMakeOutput.log".

ghost avatar Nov 13 '16 10:11 ghost

Ok, installed hamlib using MacPorts. Next issue:

TonsMacBookPro:build tmachielsen$ cmake ../ -DwxWidgets_CONFIG_EXECUTABLE=/Users/tmachielsen/Dev/wxWidgets-3.1.0/wxWidgets-staticlib/bin/wx-config -DCMAKE_BUILD_TYPE=Release -DBUNDLE_APP=1 -DCPACK_BINARY_DRAGNDROP=1 -DUSE_HAMLIB=1
-- Found hamlib library at: /opt/local/lib/libhamlib.dylib
-- Found hamlib static library at: /opt/local/lib/libhamlib.a
-- Found hamlib static modules: /opt/local/lib/hamlib-alinco.a;/opt/local/lib/hamlib-aor.a;/opt/local/lib/hamlib-ars.a;/opt/local/lib/hamlib-drake.a;/opt/local/lib/hamlib-dummy.a;/opt/local/lib/hamlib-easycomm.a;/opt/local/lib/hamlib-flexradio.a;/opt/local/lib/hamlib-fodtrack.a;/opt/local/lib/hamlib-gs232a.a;/opt/local/lib/hamlib-heathkit.a;/opt/local/lib/hamlib-icom.a;/opt/local/lib/hamlib-jrc.a;/opt/local/lib/hamlib-kachina.a;/opt/local/lib/hamlib-kenwood.a;/opt/local/lib/hamlib-kit.a;/opt/local/lib/hamlib-lowe.a;/opt/local/lib/hamlib-m2.a;/opt/local/lib/hamlib-pcr.a;/opt/local/lib/hamlib-racal.a;/opt/local/lib/hamlib-rft.a;/opt/local/lib/hamlib-rotorez.a;/opt/local/lib/hamlib-rpcrig.a;/opt/local/lib/hamlib-rpcrot.a;/opt/local/lib/hamlib-rs.a;/opt/local/lib/hamlib-sartek.a;/opt/local/lib/hamlib-skanti.a;/opt/local/lib/hamlib-spid.a;/opt/local/lib/hamlib-tapr.a;/opt/local/lib/hamlib-tentec.a;/opt/local/lib/hamlib-tuner.a;/opt/local/lib/hamlib-uniden.a;/opt/local/lib/hamlib-winradio.a;/opt/local/lib/hamlib-wj.a;/opt/local/lib/hamlib-yaesu.a
-- Found hamlib include directory at: /opt/local/include
64 bit compiler detected
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework  
-- Found LIQUID: /opt/local/lib/libliquid.dylib  
CMake Error at /opt/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
  /opt/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /opt/local/share/cmake-3.6/Modules/FindwxWidgets.cmake:917 (find_package_handle_standard_args)
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/tmachielsen/Dev/CubicSDR/build/CMakeFiles/CMakeOutput.log".

ghost avatar Nov 13 '16 10:11 ghost

My wx-config is in $HOME/Dev/wxWidgets-3.1.0/ and not in $HOME/Dev/wxWidgets-3.1.0/wxWidgets-staticlib/bin/ Will update the documentation again if the build goes fine.

ghost avatar Nov 13 '16 10:11 ghost

Not perfect yet. cpack command gives me:

[ 95%] Building CXX object CMakeFiles/CubicSDR.dir/src/sdr/SoapySDRThread.cpp.o
[ 97%] Building CXX object CMakeFiles/CubicSDR.dir/src/ui/UITestCanvas.cpp.o
[ 98%] Building CXX object CMakeFiles/CubicSDR.dir/src/ui/UITestContext.cpp.o
make[2]: *** No rule to make target `/Users/tmachielsen/Dev/wxWidgets-3.1.0/lib/libwx_osx_cocoau_gl-3.1.a', needed by `x64/CubicSDR.app/Contents/MacOS/CubicSDR'.  Stop.
make[1]: *** [CMakeFiles/CubicSDR.dir/all] Error 2
make: *** [all] Error 2

ghost avatar Nov 13 '16 10:11 ghost

Hey @Toontje sorry for the delay; there was a typo when the paths were updated for wxWidgets 3.1.0 -- the configure line's install prefix and the CubicSDR build cmake line's wx-config reference didn't line up.

If you tried to move the folders into place after wx was built you might get the error described above since it's already been "installed" to the wrong location.

Re-do the wxWidgets 3.1.0 build using the paths (with your user folder) from the updated wiki instructions and it should work.

cjcliffe avatar Nov 19 '16 16:11 cjcliffe

Hey @Toontje it looks like if you used -DUSE_HAMLIB=1 and then called cmake again without -DUSE_HAMLIB=0 it caches the previously enabled state.

So cmake is working correctly it just cached the enable flag when you ran it again; deleting the build folder and running it fresh should solve this.

cjcliffe avatar Nov 19 '16 16:11 cjcliffe

I don't see any wxWidgets-staticlib directory anywhere.

ghost avatar Nov 19 '16 17:11 ghost

@Toontje when you build wxWidgets it uses that as it's installation path; it should create the folder during the build. Specifically during the "make install"

cjcliffe avatar Nov 19 '16 17:11 cjcliffe

Here is my build script. Basically the same as the parts in your wiki:

##Remove previous install

rm -rf ~/Dev

wxWidgets

mkdir ~/Dev cd ~/Dev mkdir wxWidgets-build Why is this directory created and not used? wget -O wxWidgets-3.1.0.tar.bz2 wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.0/wxWidgets-3.1.0.tar.bz2 tar -xvjpf wxWidgets-3.1.0.tar.bz2 cd wxWidgets-3.1.0 ./configure --with-opengl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --with-mac --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --with-macosx-version-min=10.9 --prefix=/Users/tmachielsen/Dev/wxWidgets-3.1.0 CXXFLAGS="-std=c++0x" --with-libiconv=/usr Is this the correct prefix path? make -j4 && make install

SoapySDR

cd ~/Dev git clone https://github.com/pothosware/SoapySDR.git cd SoapySDR SoapySDR$ mkdir build SoapySDR$ cd build cmake .. -DCMAKE_BUILD_TYPE=Release make sudo make install SoapySDRUtil --info

SoapyRTLSDR

cd ~/Dev sudo port install rtl-sdr git clone https://github.com/pothosware/SoapyRTLSDR.git cd SoapyRTLSDR mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make sudo make install SoapySDRUtil --probe

##SoapySDRPlay

cd ~/Dev git clone https://github.com/pothosware/SoapySDRPlay.git cd SoapySDRPlay mkdir build cd build cmake .. -DCMAKE_BUILD_TYPE=Release make sudo make install SoapySDRUtil --probe

##CubicSDR

git clone https://github.com/cjcliffe/CubicSDR.git cd CubicSDR mkdir build cd build cmake ../ -DwxWidgets_CONFIG_EXECUTABLE=/Users/tmachielsen/Dev/wxWidgets-3.1.0/bin/wx-config -DCMAKE_BUILD_TYPE=Release -DBUNDLE_APP=1 -DCPACK_BINARY_DRAGNDROP=1 -DUSE_HAMLIB=1 Is this the correct config executable path? cpack

ghost avatar Nov 19 '16 17:11 ghost

@Toontje there was a bug in the instructions I have now fixed -- the way it was you'd be installing wxWidgets into the build folder which wasn't correct; you'll need to change these lines:

From: ./configure --with-opengl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --with-mac --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --with-macosx-version-min=10.9--prefix=/Users/tmachielsen/Dev/wxWidgets-3.1.0CXXFLAGS="-std=c++0x" --with-libiconv=/usr

To: ./configure --with-opengl --disable-shared --enable-monolithic --with-libjpeg --with-libtiff --with-libpng --with-zlib --with-mac --disable-sdltest --enable-unicode --enable-display --enable-propgrid --disable-webkit --disable-webview --disable-webviewwebkit --with-macosx-version-min=10.9--prefix=/Users/tmachielsen/Dev/wxWidgets-staticlibCXXFLAGS="-std=c++0x" --with-libiconv=/usr

And

From:

cmake ../-DwxWidgets_CONFIG_EXECUTABLE=/Users/tmachielsen/Dev/wxWidgets-3.1.0/bin/wx-config-DCMAKE_BUILD_TYPE=Release -DBUNDLE_APP=1 -DCPACK_BINARY_DRAGNDROP=1 -DUSE_HAMLIB=1

To:

cmake ../-DwxWidgets_CONFIG_EXECUTABLE=/Users/tmachielsen/Dev/wxWidgets-staticlib/bin/wx-config-DCMAKE_BUILD_TYPE=Release -DBUNDLE_APP=1 -DCPACK_BINARY_DRAGNDROP=1 -DUSE_HAMLIB=1

Pretty sure that was a copy+paste error when updating the instructions for wxWidgets 3.1.0.

Also the 'Why is this directory created and not used?' there was supposed to be a 'cd wxWidgets-build' in there just to separate your wx widgets build into a separate folder. Wasn't as major of an issue as the incorrect path; but have added that now.

cjcliffe avatar Nov 19 '16 17:11 cjcliffe

Back at https://github.com/cjcliffe/CubicSDR/issues/455#issuecomment-260178481

[ 95%] Building CXX object CMakeFiles/CubicSDR.dir/src/sdr/SoapySDRThread.cpp.o
[ 97%] Building CXX object CMakeFiles/CubicSDR.dir/src/ui/UITestCanvas.cpp.o
[ 98%] Building CXX object CMakeFiles/CubicSDR.dir/src/ui/UITestContext.cpp.o
make[2]: *** No rule to make target `/Users/tmachielsen/Dev/wxWidgets-build/wxWidgets-3.1.0/lib/libwx_osx_cocoau_gl-3.1.a', needed by `x64/CubicSDR.app/Contents/MacOS/CubicSDR'.  Stop.
make[1]: *** [CMakeFiles/CubicSDR.dir/all] Error 2
make: *** [all] Error 2

Is the wxWidgets-staticlib reference still valid in the configure and cmake command?

ghost avatar Nov 19 '16 18:11 ghost

@Toontje shouldn't be anything looking in /Users/tmachielsen/Dev/wxWidgets-build if you've made the two changes I suggested above and rebuilt; wxWidgets-staticlib is the installation target folder that's created by configuring and building/installing wxWidgets to use it as the install prefix.

cjcliffe avatar Nov 20 '16 02:11 cjcliffe

If i follow your exact instructions i end up with

-- Found hamlib include directory at: /opt/local/include
64 bit compiler detected
-- Found OpenGL: /System/Library/Frameworks/OpenGL.framework  
-- Found LIQUID: /opt/local/lib/libliquid.dylib  
CMake Error at /opt/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find wxWidgets (missing: wxWidgets_LIBRARIES
  wxWidgets_INCLUDE_DIRS)
Call Stack (most recent call first):
  /opt/local/share/cmake-3.6/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /opt/local/share/cmake-3.6/Modules/FindwxWidgets.cmake:917 (find_package_handle_standard_args)
  CMakeLists.txt:123 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Users/tmachielsen/Dev/SoapySDRPlay/build/CubicSDR/build/CMakeFiles/CMakeOutput.log".
CPack Error: CPack generator not specified

ghost avatar Nov 20 '16 16:11 ghost

@Toontje can you post your script to http://gist.github.com/ and I'll see if I can spot anything?

cjcliffe avatar Nov 20 '16 23:11 cjcliffe

https://gist.github.com/Toontje/34d5f61c2e87a96e3f19cc56f8a773fc

ghost avatar Nov 21 '16 09:11 ghost

@Toontje still not seeing the issue here; even copied and pasted the relevant parts of your script and substituted my username and it worked.

For interests sake; what's version do you get when you run cmake --version ?

I've got:

cjmacbook:build ccliffe$ cmake --version 
cmake version 3.5.2 

cjcliffe avatar Nov 21 '16 22:11 cjcliffe

@Toontje also have you updated your OSX since your last ports install/rebuild?

cjcliffe avatar Nov 21 '16 22:11 cjcliffe

TonsMacBookPro:~ tmachielsen$ cmake --version
cmake version 3.6.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Yes, i upgraded to Sierra and i updated XCode and macports as well.

ghost avatar Nov 22 '16 15:11 ghost

@Toontje sorry for the delay; can you give me the output of the following?

cjmacbook:~ ccliffe$ sudo port select --summary
Name       Selected  Options
====       ========  =======
cython     none      cython27 none
llvm       none      mp-llvm-3.7 none
...more stuff...

Also working on a quick alternate step-by-step using cmake-gui instead of command line which might give us more insight.

cjcliffe avatar Nov 26 '16 00:11 cjcliffe

@Toontje here's the info for building using CMake GUI:

Build everything as usual with your script but skip building CubicSDR.

Get https://cmake.org/files/v3.7/cmake-3.7.0-Darwin-x86_64.dmg and do the usual drag+install to apps.

Run the CMake App; and set the source source to the CubicSDR and the build folder to a separate location; and hit the 'configure' button and choose 'Unix Makefiles' and proceed, you should get errors like the following:

screen shot 2016-11-25 at 7 32 43 pm

Scroll to find the key 'wxWidgets_CONFIG_EXECUTABLE' and set it where your wx-config binary is (i.e. /Users/ccliffe/Dev/wxWidgets-staticlib/bin/wx-config):

screen shot 2016-11-25 at 7 36 19 pm

screen shot 2016-11-25 at 7 36 42 pm

Configure again and you shouldn't get any errors:

screen shot 2016-11-25 at 7 38 44 pm

Then hit 'Generate' and you should see in the log:

screen shot 2016-11-25 at 7 39 43 pm

Then open a Terminal and build CubicSDR:

screen shot 2016-11-25 at 7 41 30 pm

Once that's done you should be able to cd to the x64/ directory and run CubicSDR:

screen shot 2016-11-25 at 7 44 49 pm

If any of those steps fail the console / terminal errors might give us some insight into the problem

cjcliffe avatar Nov 26 '16 00:11 cjcliffe

Name     Selected  Options
====     ========  =======
python   none      python26-apple python27 python27-apple none
python2  none      python26-apple python27 python27-apple none
python3  none      none
ruby     none      ruby18 none
[ 94%] Building CXX object CMakeFiles/CubicSDR.dir/external/cubicvr2/math/cubic_math.cpp.o
[ 95%] Building CXX object CMakeFiles/CubicSDR.dir/src/sdr/SoapySDRThread.cpp.o
[ 97%] Building CXX object CMakeFiles/CubicSDR.dir/src/ui/UITestCanvas.cpp.o
make[2]: *** No rule to make target `/Users/tmachielsen/Dev/wxWidgets-build/wxWidgets-3.1.0/lib/libwx_osx_cocoau_gl-3.1.a', needed by `x64/CubicSDR'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 98%] Building CXX object CMakeFiles/CubicSDR.dir/src/ui/UITestContext.cpp.o
make[1]: *** [CMakeFiles/CubicSDR.dir/all] Error 2
make: *** [all] Error 2

ghost avatar Nov 27 '16 10:11 ghost

@Toontje I can't make sense of that error or why it's looking in the wxWidgets-build folder -- going to have to try upgrade a Mac to Sierra and let you know what I find.

cjcliffe avatar Nov 30 '16 02:11 cjcliffe

WOW! Thanks!

ghost avatar Nov 30 '16 16:11 ghost

@Toontje when you get a chance; try updating your script and remove --with-macosx-version-min=10.9 and if you can paste your script to a gist again I'll review.

cjcliffe avatar Dec 01 '16 23:12 cjcliffe

https://gist.github.com/Toontje/382d76a224b59e97b92377ef05b384f0

Another issue comes up. Check the attached log. CMakeOutput.log.zip

ghost avatar Dec 02 '16 10:12 ghost

@cjcliffe I don't have MacPorts installed but use Homebrew, so your script threw an error on line 32 on my iMac 7,1 running OS X 10.11.6:

sudo port install rtl-sdr

The equivalent Homebrew command would be (may be?):

brew install rtf-sdr (with modifications as brew updates itself on a new install)

However, another error occurred when I created a new script to continue installing by starting it at your line 42 (rtf-sdr was already previously installed):

-- libsdrplay not found.
CMake Error at CMakeLists.txt:16 (message):
  SDRPlay development files not found...

-- Configuring incomplete, errors occurred!

I then installed just CubicSDR with that part of your script, which failed with:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: no LC_RPATH load command with path: /Users/stuart/Dev/wxWidgets-staticlib/lib found in: /Users/Stuart/Dev/CubicSDR/build/_CPack_Packages/Darwin/DragNDrop/CubicSDR-0.2.0-Darwin/./CubicSDR.app/Contents/MacOS/CubicSDR (for architecture x86_64), required for specified option "-delete_rpath /Users/stuart/Dev/wxWidgets-staticlib/lib"

CubicSDR build failed.txt

There was a Dev/CubicSDR/build/CubicSDR-0.2.0-Darwin.dmg file created, which launched, but as there was no SoapySDRPlay device installed, was useless!

And so it goes....

stuzog avatar Dec 21 '16 04:12 stuzog

This is my issue: http://trac.wxwidgets.org/ticket/17685 Maybe this will be my solution: https://trac.macports.org/ticket/52951

Testing now...

ghost avatar Dec 28 '16 08:12 ghost

@Toontje still haven't reproduced issue here but haven't upgraded to Sierra yet either -- holding off on updating my only Mac here until I have a chance to upgrade a non-essential one at work to try it out.

cjcliffe avatar Dec 29 '16 22:12 cjcliffe