×

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

Bi-monthly release with minor bug fixes and improvements

Pyindi-client wrappers problem

  • Posts: 15
  • Thank you received: 0
Ok thanks, I finally managed to follow and complete all the steps :) problem solved :) :cheer:
7 years 11 months ago #7707

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

  • Posts: 69
  • Thank you received: 12

Replied by anat on topic Pyindi-client wrappers problem

I got these errors when compiling in RPi3. How to enable c99 in cmake?

root@iAstroHub:/home/pi/INDI/libindipython# make
[ 25%] Swig source
Language subdirectory: python
Search paths:
./
/usr/include/python2.7/
/usr/include/libindi/
/usr/include/
/home/pi/INDI/swig-indi-python/
./swig_lib/python/
/usr/share/swig2.0/python/
./swig_lib/
/usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
/usr/include/libindi/baseclient.h:32: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
/usr/include/libindi/basedevice.h:33: Warning 322: Redundant redeclaration of 'MAXRBUF',
/usr/include/libindi/indibase.h:10: Warning 322: previous declaration of 'MAXRBUF'.
Processing types...
C++ analysis...
/usr/include/libindi/baseclient.h:55: Warning 403: Class 'INDI::BaseClient' might be abstract, no constructors generated,
/usr/include/libindi/indibase.h:79: Warning 403: Method INDI::BaseMediator::newDevice(INDI::BaseDevice *) might not be implemented.
Generating wrappers...
[ 50%] Building CXX object CMakeFiles/_PyIndi.dir/indiclientpythonPYTHON_wrap.cxx.o
Linking CXX shared module _PyIndi.so
[ 50%] Built target _PyIndi
[ 75%] Swig source
Language subdirectory: python
Search paths:
./
/usr/include/python2.7/
/usr/include/libindi/
/usr/include/
/home/pi/INDI/swig-indi-python/
./swig_lib/python/
/usr/share/swig2.0/python/
./swig_lib/
/usr/share/swig2.0/
Preprocessing...
Starting language-specific parse...
Processing types...
C++ analysis...
Generating wrappers...
/usr/include/libindiserver.h:47: Warning 451: Setting a const char * variable may leak memory.
/usr/include/libindiserver.h:64: Warning 454: Setting a pointer/reference variable may leak memory.
[100%] Building C object CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c: In function ‘Swig_var_clinfo_get’:
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c:4933:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for(size_t i = 0; i < nclinfo; ++i)
^
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c:4933:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c: In function ‘Swig_var_dvrinfo_set’:
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c:6136:7: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (int i = 0; i < size; ++i) {
^
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c: In function ‘Swig_var_dvrinfo_get’:
/home/pi/INDI/libindipython/indiserverpythonPYTHON_wrap.c:6161:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for(size_t i = 0; i < ndvrinfo; ++i)
^
CMakeFiles/_PyIndiServer.dir/build.make:62: recipe for target 'CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o' failed
make[2]: *** [CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/_PyIndiServer.dir/all' failed
make[1]: *** [CMakeFiles/_PyIndiServer.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
7 years 10 months ago #8249

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

  • Posts: 69
  • Thank you received: 12

Replied by anat on topic Pyindi-client wrappers problem

I solved the problem by

nano /home/pi/INDI/libindipython/CMakeCache.txt
//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=-std=c99

But now I get this error
[100%] Building C object CMakeFiles/_PyIndiServer.dir/indiserverpythonPYTHON_wrap.c.o
Linking C shared module _PyIndiServer.so
/usr/bin/ld: cannot find -lindiserver
collect2: error: ld returned 1 exit status
CMakeFiles/_PyIndiServer.dir/build.make:94: recipe for target '_PyIndiServer.so' failed
make[2]: *** [_PyIndiServer.so] Error 1
CMakeFiles/Makefile2:95: recipe for target 'CMakeFiles/_PyIndiServer.dir/all' failed
make[1]: *** [CMakeFiles/_PyIndiServer.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2

and appying cmake to libindiserver return this:
root@iAstroHub:/home/pi/INDI/swig-indi-python/libindiserver# cmake .
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.28")
-- checking for module 'libindi'
--   found libindi, version 1.2.0
CMake Error at /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:136 (message):
  Could NOT find INDI (missing: INDI_MAIN_LIBRARIES) (found version "1.2.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.0/Modules/FindPackageHandleStandardArgs.cmake:343 (_FPHSA_FAILURE_MESSAGE)
  cmake_modules/FindINDI.cmake:71 (find_package_handle_standard_args)
  CMakeLists.txt:31 (find_package)
-- Configuring incomplete, errors occurred!
See also "/home/pi/INDI/swig-indi-python/libindiserver/CMakeFiles/CMakeOutput.log".
Last edit: 7 years 10 months ago by anat.
7 years 10 months ago #8250

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

  • Posts: 226
  • Thank you received: 88
Hi,
I recently have made a try to write an indiserver in Python so I created a libindiserver library directly from the indiserver.c source file. But you don't have this library installed (it lies in the swig-indi-python directory and you should install it by hand before). You could comment the two last lines of the CMakeList.txt file to avoid the build of PyIndiServer wrapping and get rid of this error.
Now, I've been asked to make a Python installer for the client part of the wrapping, so I did start to write a distutils/setuptools Python package for pyindi-client. So you probably may now refer to it if you want only the client part of the wrapping. It lies here , you may directly download a release , unpack it and run
python setup.py install
to run all the swig/compile/install steps. I did not test it heavily, but plan to put it in the Python package index .

Jean-Luc.

PS: Actually you built the libindiserver library, but the CMakeLists.txt file in the libindiserver directory should be too old, you may try to replace FindINDI.cmake with the last one.
The following user(s) said Thank You: anat
Last edit: 7 years 10 months ago by Jean-Luc.
7 years 10 months ago #8269

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

  • Posts: 200
  • Thank you received: 57
Yes please, put it on pypi.
I have noticed that you have written a bridge indi-stellarium. Just what I need!
7 years 10 months ago #8272

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

  • Posts: 226
  • Thank you received: 88
I've put it on TestPypi, it still needs some little corrections. You may try with
pip install -i https://testpypi.python.org/pypi pyindi-client
Beware that pyindi-stellarium is just a sample script not heavily tested.
7 years 10 months ago #8312

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

  • Posts: 200
  • Thank you received: 57
So it will be better tested ;)
I will let you know about the results
7 years 10 months ago #8328

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

  • Posts: 454
  • Thank you received: 51
Hello all,
Trying to compile the wrapper for INDI I get same results as ANAT.
I don't understand what I do wrong.
I follow strictly the tutorial but I fail.
Patrick
7 years 8 months ago #9243

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

  • Posts: 1
  • Thank you received: 0
Hi!

I try:
pip install -i https://testpypi.python.org/pypi pyindi-client
and give:
c++: error: /usr/lib/libindiclient.a: No such file or directory
error: command 'c++' failed with exit status 1
libindi-dev, python-dev and swig is installed, but I not found libindiclient.a. Can anybody help me?
7 years 6 months ago #10429

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

  • Posts: 314
  • Thank you received: 95

Replied by Oleg on topic Pyindi-client wrappers problem

Where is your libindiclient.a?

I my case for Ubuntu 16.04 64 bit, I found this file in directory /usr/lib/x86_64-linux-gnu/
So, solution for my case is:
sudo ln -s /usr/lib/x86_64-linux-gnu/libindiclient.a /usr/lib/libindiclient.a
sudo pip install -i https://testpypi.python.org/pypi pyindi-client
You can try my open project Astronomy Linux
The following user(s) said Thank You: Dmitry
Last edit: 7 years 6 months ago by Oleg.
7 years 6 months ago #10431
Attachments:

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

The tutorial needs to be updated to address all the issues raised in this thread, anyone?
7 years 6 months ago #10438

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

  • Posts: 226
  • Thank you received: 88
Hi,
I've updated the pip files so it tries to find the library on multiarch distribution (tested with ubuntu 16.04.1).
I also put pyindi-client directly on Pypi so
pip install pyindi-client
should be ok now.
Let's test that and give me feedbacks if you encounter some errors.
I may update the tutorial but do not know where it lies.
Jean-Luc.
The following user(s) said Thank You: Jasem Mutlaq
7 years 6 months ago #10460

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

Time to create page: 1.063 seconds