×

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

Bi-monthly release with minor bug fixes and improvements

Building one driver only

  • Posts: 554
  • Thank you received: 138
I'm in the process of updating a driver and I need to install and run my local copy on a Pi Zero running Raspbian.

I'm developing on a Pi 4 and I've committed and pushed to my own repository.

I can clone this to the Pi Zero, in ~/Projects/indi

I can build following the process in AstroPi3 Raspbian but it takes for ever and I only want the indi server and my driver.
the build process is:
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ~/Projects/indi
make
sudo make install

I've tried:
make indi_celestron_gps

and this seems to just build indi_celestron_gps and it's dependencies but:

sudo make install

then builds all the things not built in the first run of make and

sudo make install indi_celestron_gps

seems to do the same.

would only build the celestron driver and it's dependencies?
Would I need to do something with the make install step?

Chris
4 years 2 months ago #48066

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

  • Posts: 139
  • Thank you received: 31

Replied by Marc on topic Building one driver only

Try this:

cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo ~/Projects/indi

then go to your build directory

make indi_celestron_gps #(just like you did!)

when build is over, a little shell script with something like

~~~~~~~~~~~~~~~~~~~~~
#!/bin/sh
sudo cp -av indi_celestron_gps /your_bin_directory #( generally /usr/bin )
sudo cp -av libindidriver.so.* /your_lib_directory #( generally /usr/lib )
sudo ldconfig -v /your_lib_directory #( so the cache is updated )
~~~~~~~~~~~~~~~~~~~~~

Adapt to your own locations and that should do it. :)

- Marc
The following user(s) said Thank You: Chris Rowland
Last edit: 4 years 2 months ago by Marc.
4 years 2 months ago #48069

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

  • Posts: 554
  • Thank you received: 138
Thanks for the help, this is what i ended up with, it will update the sources from my personal repositiory, buid and distribute.
Lifted the sudo check from AstroPi3, thanks.
There are a couple of reads that give me a chance to review what's going on, they can be commented out of course.
#!/bin/bash
 
if [ "$(whoami)" != "root" ]; then
        echo "Please run this script with sudo due to the fact that it must do a number of sudo tasks.  Exiting now."
        exit 1
elif [ -z "$BASH_VERSION" ]; then
        echo "Please run this script in a BASH shell because it is a script written using BASH commands.  Exiting now."
        exit 1
else
        echo "You are running BASH $BASH_VERSION as the root user."
fi
 
export USERHOME=$(sudo -u $SUDO_USER -H bash -c 'echo $HOME')
 
echo "kill indi server because it seems to upset things"
pkill indiserver
 
echo "get the latest sources"
cd $USERHOME/Projects/indi
git pull
 
# set the build directory
cd $USERHOME/Projects/indi-build
 
# read -p "run cmake"
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo $USERHOME/Projects/indi
 
# read -p "$ make indi_celestron_gps"
make indi_celestron_gps
 
read -p "distribute the required files"
 
sudo cp -av indi_celestron_gps /usr/bin
sudo cp -av libindidriver.so.* /usr/lib
read -p "update the configuration"
sudo ldconfig -v /usr/lib
4 years 2 months ago #48180

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

Time to create page: 0.383 seconds