×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

compile simple c++ client without compiling libindi

  • Posts: 6
  • Thank you received: 0
Hello,

On my Raspberry Pi, I'm using a main program in python, a part of the program connects an ASI camera with pyindi. It works well except for the acquisition time impossible to decrease below 300 ms for a frame (even with binning or cropping). It has been explained in this topic : indilib.org/forum/ccds-dslrs/12476-acquition-time-too-long.html .

I would like to create a python library just to acquire frames at a higher rate, so written in C++ to overpass this limitation. I've seen the examples : github.com/indilib/indi/tree/master/examples , example 6 fits almost my need, but programs are always compiled with the whole library using cmake.

To create a library to use with python, I need to compile it using python docs.python.org/3/extending/extending.html passing by a commande like
python3 ./setup.py build
with all informations regarding the compilation in the setup.py file. Both conditions (cmake and python compilation) are quite complexe to use together.

Is it a simple way to compile a simple client (for exemple the one in exemple 6), just linked to the needed libraries ?.
given the simple client, I expected a possibility like, for the C++ part :
g++ very_simple_client.cpp -needed_library - L /urs.... -I /usr/...
that would be easy to transfer for a python compilation.

Does such a simple compilation way exist ?

Thank you !
Benjamin
1 year 2 months ago #89657

Please Log in or Create an account to join the conversation.

  • Posts: 349
  • Thank you received: 107
I could compile that example just with this command
g++ tutorial_client.cpp  -o client -I/usr/include/libindi -lindiclient

First just compile and install whole INDI by following instruction in Build indi-core (cmake) section.
The following user(s) said Thank You: benjamin
1 year 2 months ago #89660

Please Log in or Create an account to join the conversation.

  • Posts: 111
  • Thank you received: 41
Hello Benjamin,

one can quickly check files for compilation in e.g. the DEB package libindi-dev
$ dpkg-query -L libindi-dev
/.
/usr
/usr/include
/usr/include/libindi
/usr/include/libindi/abstractbaseclient.h
/usr/include/libindi/alignment
/usr/include/libindi/alignment/AlignmentSubsystemForDrivers.h
/usr/include/libindi/alignment/AlignmentSubsystemForMathPlugins.h
...
/usr/include/libindi/v4l2_decode.h
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libindiAlignmentClient.a
/usr/lib/x86_64-linux-gnu/libindiclient.a
/usr/lib/x86_64-linux-gnu/libindidriver.a
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/libindi.pc
/usr/share
/usr/share/doc
/usr/share/doc/libindi-dev
/usr/share/doc/libindi-dev/AUTHORS
/usr/share/doc/libindi-dev/NEWS.gz
/usr/share/doc/libindi-dev/README.gz
/usr/share/doc/libindi-dev/changelog.gz
/usr/share/doc/libindi-dev/copyright
/usr/lib/libindiclient.so
/usr/lib/libindidriver.so
/usr/lib/libindilx200.so
/usr/lib/x86_64-linux-gnu/libindiAlignmentDriver.so
/usr/lib/x86_64-linux-gnu/libindiclient.so
/usr/lib/x86_64-linux-gnu/libindidriver.so
/usr/lib/x86_64-linux-gnu/libindilx200.so

Some compiling needs proper path to header (include) files and shared librararies *.so or archive files (.a).
So to be more specific compiling e.g. indi/examples/tutorial_three/simpleccd.cpp
$ g++ simpleccd.cpp -o simpleccd -I/usr/include/libindi -lindiclient -lindidriver && file simpleccd
simpleccd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=94b50e8cba51f2f174afab03cc6e7a986f3606e4, for GNU/Linux 3.2.0, not stripped

Or e.g.
indi/examples/tutorial_seven
$g++ simple_telescope_simulator.cpp -o simple_telescope_simulator -I/usr/include/libindi -lindiclient -lindidriver && file simple_telescope_simulator
/usr/bin/ld: /tmp/ccESuSgI.o: undefined reference to symbol 'ln_get_julian_from_sys'
/usr/bin/ld: /lib/x86_64-linux-gnu/libnova-0.16.so.0: error adding symbols: DSO missing from command line
complains that libnova is missing, so adding the proper library as an additional parameter "-llibnova" (requires libnova packaged install) and in addition it requires
/usr/lib/x86_64-linux-gnu/libindiAlignmentDriver.so
one can compile it as follows:
$ g++ simple_telescope_simulator.cpp -o simple_telescope_simulator -I/usr/include/libindi -lindiAlignmentDriver -lnova -lindiclient -lindidriver && file simple_telescope_simulator
simple_telescope_simulator: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=13d9b3c7720caec9ea05288289ee79c28e915b43, for GNU/Linux 3.2.0, not stripped

Cheers
Thomas
The following user(s) said Thank You: benjamin
1 year 2 months ago #89661

Please Log in or Create an account to join the conversation.

  • Posts: 6
  • Thank you received: 0
Thank you very much to both of you for your help.
It works perfectly!

Benjamin
1 year 2 months ago #89822

Please Log in or Create an account to join the conversation.

Time to create page: 0.414 seconds