I am trying to create a custom telescope driver on MacOS X. For this I have downloaded the INDI source code and using that (uncompiled) I can make the compilation of my (very simple) driver work without errors. However, when I want to use it, my driver complains about not being able to find the INDI::Telescope class. I have tried to compile the INDI source but I have problems because libnova cannot be found and compilation of libnova fails. So I am wondering if I can link to any library in the /Applications/kstars.app/Contents/MacOS/indi directory and, if yes, which one I should use.
Try using our OS X build script. Obviously you don't need to build all of kstars, but the build-env.sh script could be very useful for you in this work you are doing. It will set all the environment variables correctly (hopefully).
It looks like the @rpath is the culprit. otool tells me:
$> otool -L /usr/local/lib/libindidriver.dylib
/usr/local/lib/libindidriver.dylib:
@rpath/libindidriver.1.dylib (compatibility version 1.0.0, current version 1.6.0)
/usr/local/opt/libusb/lib/libusb-1.0.0.dylib (compatibility version 2.0.0, current version 2.0.0)
/usr/local/opt/libnova/lib/libnova-0.15.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/cfitsio/lib/libcfitsio.5.dylib (compatibility version 5.0.0, current version 5.3.42)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
Thanks very much for the tip. I am not sure if I can use that script but I'll look into it.
In the end I managed to compile the code using cmake on the command line. Since cmake in my case was installed via Homebrew, I needed to make sure that the dependencies were installed via Homebrew as well. Following the instructions in
this tutorialthis tutorial
I was able to build all files. The only difference is that I didn't use the -DCMAKE_INSTALL_PREFIX=/usr option to cmake and simply did a "make" instead of a "sudo make install". When cmake was executed it reported for instance that it found these libraries installed from Homebrew:
-- Found CFITSIO 3.42: /usr/local/lib/libcfitsio.dylib
-- Found CFITSIO: /usr/local/lib/libcfitsio.dylib
-- Found NOVA: /usr/local/lib/libnova.dylib
-- Found USB1: /usr/local/Cellar/libusb/1.0.21/lib/libusb-1.0.dylib (found version "1.0.21")
-- Found GSL: /usr/local/Cellar/gsl/2.4/include (found version "2.4")
One issue was a conflicting JPEG library and it turned out the Mac OS X one was used. This only became apparent when compilation succeeded and I tried to use the compiled examples. When I replaced the symlink to point to the Homebrew libjpeg one all went ok. I am happy