Compiling Libraries. [SOLVED]

Raspberry PI specific forum
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Compiling Libraries. [SOLVED]

Post by daveb »

I am trying to compile the pigpio library, as per the instructions: https://abyz.me.uk/rpi/pigpio/download.html
I have downloaded the zip file and extracted it to pigpio-master.
The output for $ sudo make install

Code: Select all

install -m 0755 -d                             /opt/pigpio/cgi
install -m 0755 -d                             /usr/local/include
install -m 0644 pigpio.h                       /usr/local/include
install -m 0644 pigpiod_if.h                   /usr/local/include
install -m 0644 pigpiod_if2.h                  /usr/local/include
install -m 0755 -d                             /usr/local/lib
install -m 0755 libpigpio.so.1      /usr/local/lib
install -m 0755 libpigpiod_if.so.1  /usr/local/lib
install -m 0755 libpigpiod_if2.so.1 /usr/local/lib
cd /usr/local/lib && ln -fs libpigpio.so.1      libpigpio.so
cd /usr/local/lib && ln -fs libpigpiod_if.so.1  libpigpiod_if.so
cd /usr/local/lib && ln -fs libpigpiod_if2.so.1 libpigpiod_if2.so
install -m 0755 -d                             /usr/local/bin
install -m 0755 pig2vcd                        /usr/local/bin
install -m 0755 pigpiod                        /usr/local/bin
install -m 0755 pigs                           /usr/local/bin
if which python2; then python2 setup.py install ; fi
which: no python2 in (/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/vc/bin)
if which python3; then python3 setup.py install ; fi
/bin/python3
running install
/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
running bdist_egg
running egg_info
creating pigpio.egg-info
writing pigpio.egg-info/PKG-INFO
writing dependency_links to pigpio.egg-info/dependency_links.txt
writing top-level names to pigpio.egg-info/top_level.txt
writing manifest file 'pigpio.egg-info/SOURCES.txt'
listing git files failed - pretending there aren't any
reading manifest file 'pigpio.egg-info/SOURCES.txt'
writing manifest file 'pigpio.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-aarch64/egg
running install_lib
running build_py
creating build
creating build/lib
copying pigpio.py -> build/lib
creating build/bdist.linux-aarch64
creating build/bdist.linux-aarch64/egg
copying build/lib/pigpio.py -> build/bdist.linux-aarch64/egg
byte-compiling build/bdist.linux-aarch64/egg/pigpio.py to pigpio.cpython-310.pyc
creating build/bdist.linux-aarch64/egg/EGG-INFO
copying pigpio.egg-info/PKG-INFO -> build/bdist.linux-aarch64/egg/EGG-INFO
copying pigpio.egg-info/SOURCES.txt -> build/bdist.linux-aarch64/egg/EGG-INFO
copying pigpio.egg-info/dependency_links.txt -> build/bdist.linux-aarch64/egg/EGG-INFO
copying pigpio.egg-info/top_level.txt -> build/bdist.linux-aarch64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/pigpio-1.78-py3.10.egg' and adding 'build/bdist.linux-aarch64/egg' to it
removing 'build/bdist.linux-aarch64/egg' (and everything under it)
Processing pigpio-1.78-py3.10.egg
Copying pigpio-1.78-py3.10.egg to /usr/lib/python3.10/site-packages
Adding pigpio 1.78 to easy-install.pth file

Installed /usr/lib/python3.10/site-packages/pigpio-1.78-py3.10.egg
Processing dependencies for pigpio==1.78
Finished processing dependencies for pigpio==1.78
install -m 0755 -d                             /usr/local/man/man1
install -m 0644 p*.1                           /usr/local/man/man1
install -m 0755 -d                             /usr/local/man/man3
install -m 0644 p*.3                           /usr/local/man/man3
ldconfig
A library check with $ sudo ./x_pigpio # check C I/F returns:

Code: Select all

./x_pigpio: error while loading shared libraries: libpigpio.so.1: cannot open shared object file: No such file or directory
The libpigpio.so.1 (313.4k) is definitely in the pigpio-master directory.

Can anyone suggest where I might be going wrong.

Thanks & regards
Dave
Last edited by daveb on Tue Jul 19, 2022 9:46 am, edited 1 time in total.
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Did you also call 'make' in the pigpio-master directory beforehand, and what does the result look like?

If so, then again in the pigpio-master directory:
- make clean
- make

Then run 'sudo make install'.
If everything is ok, the 'libpigpio' libraries should be in the directory '/usr/local/lib'.

If you do not use Python, these are not necessary.

P.S.
Look in the directory '/usr/lib' if the libraries are already there. If yes, then manjaro for raspberry has already provided them.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Compiling Libraries.

Post by daveb »

Thanks for your time and patience.

All I can find in '/user/lib' is pigpio-1.78-py3.10.egg

After - make clean - make and $ sudo make install '/usr/local/lib' contains:
libpigpio.so
libpigpio.so.1
libpigpiod_if.so
libpigpiod_if.so.1
libpigpiod_if2.so
libpigpiod_if2.so.1

The results returned by the following commands are:
sudo: ./x_pigpio: command not found
sudo pigpiod
pigpiod: error while loading shared libraries: libpigpio.so.1: cannot open shared object file: No such file or directory

Regards
Dave
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Maybe there is no search path at manjaro for '/usr/local/lib/' and /usr/local/bin/'.

Default path for 'manjaro' should be '/usr/lib/' for the libraries and for the bin-file 'pigpiod' the path '/usr/bin/'.

Maybe copy it manually as sudo.

P.S.
Or edit the make file for right path (first copy orginal)

remove ...

This all without garanty!
Last edited by mk-soft on Sun Jul 17, 2022 3:37 pm, edited 1 time in total.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Please wait,

i testing now on my PI 400 with manjaro. Even its to big screen on my 4k television ;)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Ok,

on manjaro the libraries not found on path '/usr/local/lib' and bin file not found on path '/usr/local/bin'

In addition for python I have install the python-setuptools, but i don't known ifs needed ...
- sudo pacman -S python-setuptools


Solution to install pigpio on manjaro to base path '/usr':

Run first:
Remove old install
- sudo make uninstall

Then:
Save MakeFile
- cp MakeFile MakeFile_Org

Edit MakeFile
- mousepad
-> Open MakeFile
-> Change line 36: 'prefix = /usr/local' to 'prefix=/usr'
-> Save

Last:
- sudo make install

After all this:
To check the library -> its work here

Small tip:
Start the purebasic-ide as sudo for testing programs with hardware IO
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Compiling Libraries.

Post by daveb »

OK! That's real progress.
- sudo ./x_pigpio passes all appropriate tests and sudo pigpiod appears to start the demon without errors.

My problem now is that I have both your pigpiod2.pbi and servo.pb in the same /home/user/purebasic600/Code directory and with the IDE running as either root or user attempting to run servo.pb returns:
[COMPILER] Line 1: File not found (/home/user/purebasic600/Code/pigpiod2.pbi).
Tried absolute path: IncludeFile "/home/user/purebasic600/Code/pigpiod2.pbi"
I have double, triple and quadruple checked the accuracy of my spelling and recreated pigpiod2.pbi from the 'PIGPIO' forum thread.

I think it might be time for me to "throw the towel in" and stop wasting any more of your time. I am really not enjoying the PI, because there seem to be endless complications in many aspects of the system, not just this one issue.

Many thanks for all your effort and patience.

Regards
Dave
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Here you have to pay attention to lower and upper case of path and file.
There probably must be everything.

Do not give up. The squirrel is slowly eating ;)
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Compiling Libraries.

Post by daveb »

Obviously with Linux, case was the very first thing I checked when performing multiple spelling cross checks.
Even some of my own programs that work perfectly on an x64 platform throw up similar missing file errors with PB on Manjaro.
While Raspian OS is almost unusable for me and I am not a big fan of Ubuntu, it looks like I am going to have to go with one of those if I want to use the Pi's GPIO. Pity, because in every other way Manjaro provided all the features I wanted.
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Maybe you should take a closer look at Raspberry Pi OS (64-bit).
The base is debian and there is a lot of software and extensions for Arm32 and Arm64 processors.
I have already tried Ubuntu for Arm. But was a bit disappointed, because this only gave with initial problems with the graphics synchronization. Was apparently ready fixed.

Just give it a try, only costs a small SD card.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Compiling Libraries.

Post by daveb »

I already have an MSD card with a recent Raspberry PI OS 64bit image. I am going out later to pickup a wired USB keyboard and mouse, in the hope that this will resolve/reduce the major usability issues I had with the Raspberry PI OS and several different wireless USB keyboard/mouse combinations.
One of the main reasons I wanted to use Manjaro was the fact that it is an up-to-date rolling release with recent releases of most major applications, but if I can resolve this GPIO issue using the Raspberry PI OS I will just have to live with what I consider to be the Debian shortcomings.
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Compiling Libraries.

Post by daveb »

Wow! I am getting giddy going around and around in ever decreasing circles.
The wired USB keyboard/mouse have mad the Raspberry PI OS physically usable.

Installed the GPIO software from the repository.
- sudo pigpiod doesn't produce any error
- sudo ./x_pigpio # check C I/F returns command not found

Extracted PB to /home/user/purbasic600
- ./launch.sh opens the PB IDE with the terminal error:
** (purebasic:7797): CRITICAL **: 09:55:11.457: clearlooks_style_draw_focus: assertion 'height >= -1' failed
The OS cripples any attempt to create an executable 'purbasic600.desktop' file, in that it dictates that it is a text file and it MUST ONLY be opened with a text editor.

The Raspberry PI OS is definitely not for me.
Will take a stab at Ubuntu.
User avatar
mk-soft
Always Here
Always Here
Posts: 6242
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Compiling Libraries.

Post by mk-soft »

Desktop Files:
Link: Tips & Tricks for Raspberry
Installed the GPIO software from the repository.
It was not necessary to install the pigpio libraries. It is available by default with Raspberry OS.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
daveb
User
User
Posts: 30
Joined: Tue Jun 07, 2022 6:12 pm

Re: Compiling Libraries.

Post by daveb »

Well Ubuntu didn't work out any better for me.
Based on an idea put to me by someone in the Manjaro forums, I grabbed an image of Manjaro ARM64 with xfce DE.
By following through on the pointers mk-soft had previously given, my Raspberry PI 4B now has a fully functional PB IDE/compiler (complete with taskbar icons :wink: ), which can access the installed pigpio library.
I hope that at some time I might have the opportunity to repay mk-soft for the valuable & patient assistance.
Dave
Post Reply