Library of the PRU (Libpruio)

What are the steps to install and make the library libpruio work? this github repository: GitHub - DTJF/libpruio: Fast and easy Input/Output driver for digital/analog lines on Beagleboard hardware

I did some steps using the commands
sudo apt-get update
sudo apt- get upgrade
sudo apt-get install git
git clone GitHub - DTJF/libpruio: Fast and easy Input/Output driver for digital/analog lines on Beagleboard hardware
cd libpruio
mkdir build
cd build
cmake …

Until here but the cmake… it doesn’t generate Makefile

Any idea with it?

Best Regards,
Rony Vargas

I have not seen this tree until just moments ago. Did look at the cmake and it has some error messages that will output. Did you see any error messages being output?

cmake /home/fred/test-delete/libpruio
CMake Error: Could not find cmake module file: CMakeDetermineFbcCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fbc_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fbc_COMPILER
CMake Error: Could not find cmake module file: /home/fred/test-delete/libpruio/CMakeFiles/3.16.3/CMakeFbcCompiler.cmake
-- The C compiler identification is GNU 9.4.0
CMake Error at CMakeLists.txt:18 (PROJECT):
  No CMAKE_Fbc_COMPILER could be found.

  Tell CMake where to find the compiler by setting the CMake cache entry
  CMAKE_Fbc_COMPILER to the full path to the compiler, or to the compiler
  name if it is in the PATH.


CMake Error: Could not find cmake module file: CMakeFbcInformation.cmake
-- 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
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error: CMAKE_Fbc_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/fred/test-delete/libpruio/CMakeFiles/CMakeOutput.log".

Looks like you will need to work on the CMakeLists.txt
The missing files are at the top of the tree, are they correct??

Yes I think the problem has to be in the CMakeLists.txt, my friend @foxsquirrel, @RobertCNelson any idea what is the problem with it? Why it doesn’t generate the Makefile?

Bes Regards,
Rony Vargas

$ cmake <path to top of the tree>

Generate the error messges on your machine and then get into the .txt file and edit it. That should get you going, hopefully.

root@beaglebone:/home/debian/libpruio/build# cmake …
CMake Error: Could not find cmake module file: CMakeDetermineFbcCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fbc_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may not be built correctly.
Missing variable is:
CMAKE_Fbc_COMPILER
CMake Error: Could not find cmake module file: /home/debian/libpruio/build/CMakeFiles/3.13.4/CMakeFbcCompiler.cmake
CMake Error at CMakeLists.txt:18 (PROJECT):
No CMAKE_Fbc_COMPILER could be found.

Tell CMake where to find the compiler by setting the CMake cache entry
CMAKE_Fbc_COMPILER to the full path to the compiler, or to the compiler
name if it is in the PATH.

CMake Error: Could not find cmake module file: CMakeFbcInformation.cmake
CMake Error: CMAKE_Fbc_COMPILER not set, after EnableLanguage
– Configuring incomplete, errors occurred!
See also “/home/debian/libpruio/build/CMakeFiles/CMakeOutput.log”

this happen when I do the command cmake …

fred@eng-dev2:~$ mkdir delete-this
fred@eng-dev2:~$ cd delete-this/
fred@eng-dev2:~/delete-this$ git clone https://github.com/DTJF/libpruio.git
Cloning into 'libpruio'...
remote: Enumerating objects: 3198, done.
remote: Counting objects: 100% (221/221), done.
remote: Compressing objects: 100% (125/125), done.
remote: Total 3198 (delta 121), reused 165 (delta 94), pack-reused 2977
Receiving objects: 100% (3198/3198), 3.02 MiB | 1.68 MiB/s, done.
Resolving deltas: 100% (2366/2366), done.
fred@eng-dev2:~/delete-this$ git branch -a
fatal: not a git repository (or any of the parent directories): .git
fred@eng-dev2:~/delete-this$ ls
libpruio
fred@eng-dev2:~/delete-this$ cd libpruio/
fred@eng-dev2:~/delete-this/libpruio$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/V-0.4
  remotes/origin/master
  remotes/origin/tjf
fred@eng-dev2:~/delete-this/libpruio$ git checkout -b my-libpruio
Switched to a new branch 'my-libpruio'
fred@eng-dev2:~/delete-this/libpruio$ git status
On branch my-libpruio
nothing to commit, working tree clean
fred@eng-dev2:~/delete-this/libpruio$

What you want to do is look at the example code I just pasted here.

First make your own branch so you can work on it and not break the original tree. This is very important if you have a cat in the office that likes the keyboard.

Look over the files in the tree

From the top of the tree

$ tree -d

If you don’t have tree,

$ sudo apt install tree

Look over all the directories and see what is going on, even use nautilus / file manger.

fred@eng-dev2:~/delete-this/libpruio$ tree -d
.
├── cmake
│   └── Modules
│       └── Platform
├── debian
│   └── source
├── doxy
└── src
    ├── c_examples
    ├── c_include
    ├── config
    ├── doc
    │   └── img
    ├── examples
    ├── lkm
    ├── pruio
    └── python
        └── libpruio

I would first look into modules and go from there.

While you are in your git branch do what ever you want until it works. If you get it all messed up just go back and checkout the master and then make a new branch into my2-libpruio then go back at it.

Absolutely no one will know the solution for you problem, however all of us will toss out some clues.

Myself I would run from that one.

  1. Its stale, no activity for 2 years.
  2. They did not leave instructions on how to build it.
  3. No information about dependencies.

After seeing that, I move on, it appears to be an entrance for a rabbit hole.

Check out the Preparation chapter in the docs, especially the libpruio: Preparation part.

CMake needs custom scripts to handle FB source (which are shipped in the package). For a quick and dirty test you can uncomment the line

#SET(CMAKE_MODULE_PATH “${CMAKE_SOURCE_DIR}/cmake/Modules/”)

in the top section of the main CMakeLists.txt file. This includes the missing scripts and works for a fresh (unchanged) source tree. In order to customize the source, instead you’ll need to install the cmakefbc package (as described in the docs Preperation chapter).

Regards

1 Like

That is very interesting, thank you for sharing that.

Well I was reading about the problem and if you don’t have install all the Build Dependencies for the library libpruio, could be the problem to generate the Makefile when I do the command of the cmake …?

Best Regards,
Rony Vargas

@rony:

Once more: CMake doesn’t work for fbc source code out-of-the-box. Find some info in the debug output:

So the project needs extra CMake scripts.

When you intend to modify the source tree, you’ll need to install the cmakefbc project. After installation the command is

cmakefbc ..

Otherwise, for a quick test, you may either uncomment the above mentioned line in the main CMakeLists.txt file (top directory). Or you may add the projects module path in the command line, like

cmake .. -DCMAKE_MODULE_PATH=../cmake/Modules

Regards

1 Like

Thank you for helping @rony_vargas out with this.

The FreeBasic seems like a cool idea, I will have to look into that with more detail.

It does seem like that would be an excellent entry point for many getting started.

Hence, those starting out would need a verbose getting started package on your landing page. At an entry point you should have a verbose section that has been tested and known working on say, Debian or Ubuntu 22 system. It gets very frustrating when things are not tested and don’t work for those trying them out for the first time.

Sure, that’s my target developing the lib. Hardware access on BBB should be as easy as on the Arduino, in real-time and in a fully featured LINUX environment.

That’s the case for 3.x and 4.x kernel versions. In the beginning (2014) J.Kridner anounced to supply the lib in mainstream, but it never happened.

I coded and tested all scripts necessary for building debian packages. And I provided a PPA for some time. But as a developer, it’s not my task to support new packages for each new kernel version.

RCN provided in mainstream the freebasic package (old 1.01.0 version, current is 1.10) and the lkm module. But the lib binary and the header files or the example and doc packages never found their way to the repository.

Hope the maintainers read your words.

Regards

1 Like

I was suppose to retire March of 2022, well that did not happen. Never planned on what happened so I am elbo deep since I bought some new machinery last year and need to turn that into money. Other problem, I have been sitting in the big chair for the last 20 years. Things have changed so much and I have forgotten so much too. When Deb and I finally retire our plans are to help those that help others, not sure if my skills are even close to what is required for some of these very complex packages.

So don’t give up, stay with it.

I remember the days of GWBasic and Commodore basic, it was fun. It was so simple you could actually do something positive and rewarding.

I installed the cmakefbc package, after it, I installed all the build dependecies, I did the command cmakefbc … it gave me the Makefile, then I did the command make and sudo make install, but I want to compile a program it doesn’t work, what is the problem my friend @DTJF?

Let us check …

Please post the command line output.

I’ve a cbm4032 in my office, just to remember the old days.
cbm4032

It’s still working, and boots in less than two seconds :slight_smile:
cbm4032Prompt

1 Like

Here I did the command cmakefbc

Then I did the command make

Then I did the command make install

After it, I went to do the examples in c t compile a code but it is not working

Which can be the problem my friend @DTJF ? any help

Rony Vargas

o

What’s your issue? Every command worked fine (the linux headers are missing, so you cannot build the lkm). What else do you expect?

It seems that you didn’t execute

sudo ldconfig

yet, so the linker doesn’t find the new library (unless you explicitly specify its full path).

Regards

A hint:
do not work in the source tree as root. Instead log-in as normal user (ie debian) for the builds. Use root only for installing like

sudo make install
sudo make lkm-install
sudo make lkm-uninstall

And
you can mark the text in putty and copy / paste it to a text block here. That’s more convenient than posting PNG-images (for you and me).