linuxcnc cmake project

  • Grotius
  • Grotius's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
14 Nov 2022 22:32 - 14 Nov 2022 22:37 #256734 by Grotius
linuxcnc cmake project was created by Grotius
Hi,

Tommy thanks for your last comment. I'm ok.

I thought, it would be handy to create a cmake project for linuxcnc.
Then users can source the linuxcnc project in a editor like qt.

So far i am impressed. It's not fertig yet, but when doing the install over excisting install, lcnc just runs.

Two day's ago i cloned the linuxcnc repository : github.com/grotius-cnc/linuxcnc and started coding.

There is already a problem to solve : Classicladder does not compile. Feel free to help.
pixmap not found....

A lot of the sources are in now.  rtapi, hal, python, emc, nml, etc.
Rtlib has to done tomorrow.

If you want to try yourself, just a few commands :

git clone github.com/grotius-cnc/linuxcnc
(remove the excisting build dir, or empty it)
mkdir build
cd build
cmake ..
make
make install (sudo make install)
It will install files in your local lcnc clone only.

Then open the cmakelists.txt in a code editor, this will look like below :

image of the editor loaded the cmakelists.txt
Last edit: 14 Nov 2022 22:37 by Grotius.
The following user(s) said Thank You: tommylight

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

More
15 Nov 2022 02:05 #256748 by cmorley
Replied by cmorley on topic linuxcnc cmake project
IIRC Rene was working on something similar.
The following user(s) said Thank You: Grotius

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

  • Grotius
  • Grotius's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
15 Nov 2022 15:00 #256774 by Grotius
Replied by Grotius on topic linuxcnc cmake project
Hi Chris,

I looked on his github account, but no project similar to this.
From what i have seen, Rene-dev is a skilled coder.

I hope this project will suceed anyway.. It's quite a huge chunk of code.

Today i had some problems with the only static library in lcnc called : liblinuxcnc.a

I wonder why they did made a static library? Did they had problems and try to solve things this way?
There is problably a reason for that i don't know at this moment.

Cmake was not happy. With compiling it causes a reallocation error. For me now unsolvable.
After a few hours, i decided to modify the original lcnc submakefiles to create a shared library instead of a static one.

So i replaced the .a to .so in the submakefiles. And was sure the build was clean. After rebuild lcnc run's on the shared
library.

So i am quite happy with this. Now lets go on to get a step forward.

Also i question myself why did the use version numbers for the shared library's to so.0 ?
I see no reason to do this.

So far one step ahead. Technically without modifying the source code. If you consider a make file is no source code.







 
The following user(s) said Thank You: tommylight

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

More
15 Nov 2022 22:05 #256804 by HansU
Replied by HansU on topic linuxcnc cmake project
Try to connect with Rene directly. You will find his email address on some archives from the dev mailing list (He organized the online meeting in august this year for example).
The following user(s) said Thank You: Grotius

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

  • Grotius
  • Grotius's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
17 Nov 2022 00:48 #256911 by Grotius
Replied by Grotius on topic linuxcnc cmake project
Hi Hans,

I can open a issue on his github channel to get in contact. Thanks for the hint.

Today was not so easy. A few steps forward.

I managed to get classicladder & halscope compiled. Halmeter was compiled the day before.

For sure the classicladder code was a difficult one to forge into a cmake project.
Classicladder has a config.h file that has to be renamed in the future. Now there are multiple config.h file's in lcnc with
different code. Not so handy.

I was trying to get halui forged into a cmake project, but this one is also a difficult one to get compiled. I did not manage
to get it compiled yet. It depends on multiple libs, and somewhere it goes wrong.

I updated the github code, i added a working directory "cmake", here i tested some things.











 
The following user(s) said Thank You: tommylight

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

  • Grotius
  • Grotius's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
17 Nov 2022 14:10 #256932 by Grotius
Replied by Grotius on topic linuxcnc cmake project
Hi, a short update.

Today i managed to get halui compiled in a cmake project.

This now ensures liblinuxcncini.so, liblinuxcnchal.so, libtooldata.so, liblinuxcnc.a are compiled ok.

So far this was the most difficult one because it depends on above 4  library's.

My strategy to solve the halui 500+ compile errors was :
  • Try to compile the cmake project with original compiled lcnc library's and original include paths. This did not succeed first, cmake was messing up include paths for .so librarys. I looked for another way to link library's into the cmake project. After some testing, this worked ok.
  • Swap out the lcnc libs one by one with your own compiled libs to get exactly the lib where you messed things up.
So far in the cmake project, compiled succesfully :
  • rtapi
  • module_helper
  • liblinuxcnchal
  • hal_lib
  • halcmd
  • halmeter
  • halscope
  • liblinuxcncini
  • libnml
  • lliblinuxcnc
  • components/threads (compiling a rt component for rtlib)
  • libtooldata
  • classicladder
  • halui
The rest of the day i will add some less difficult libs to the cmake project.

 
The following user(s) said Thank You: tommylight

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

More
17 Nov 2022 23:49 #256989 by andypugh
Replied by andypugh on topic linuxcnc cmake project
I suspect that the place to look for rene's cmake stuff is in his linuxCNC fork:

github.com/rene-dev/linuxcnc/tree/end-cmake
The following user(s) said Thank You: Grotius

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

  • Grotius
  • Grotius's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
19 Nov 2022 15:58 - 19 Nov 2022 21:01 #257113 by Grotius
Replied by Grotius on topic linuxcnc cmake project
Hi Andy,

Thanks for the link !! It's really usefull to see how he did it. I can use some of his code coming day's. For example the
preprocces for halcompile. The .comp to .c file preprocess. I am not really a fan of the output of this process.
It makes the code almost unreadable for users. I think there could be made a more dedicate parser in the future that
at least creates some readable c code.

Yesterday i had problems compiling the ~/linuxcnc/tlc/linuxcnc.so library. This is solved now.
Somehow the -fPIC flag was not used by cmake. This one is needed by liblinuxcnc.a
When doing it in a different way, it worked, and errors where gone.

Have modified some include headers that where like : #include"../afile" to #include"afile" where the build system
is responcible for the include path. I think this is a logic step to take.

Have mentioned the liblinuxcnc.a can be just liblinuxcnc.so. There is no real reason it has to be static so far i can see.

Now linux axis start's when i replaced the ~/tcl/linuxcnc.so file. Good news. A few more tiny libs to go now.

The project at the moment, all compiling,

# ~/bin
rtapi
module_helper
# ~/lib

liblinuxcnchal
liblinuxcncini
libtooldata
libnml
liblinuxcnc
libposemath
libpyplugin
librs274
libcanterp


# ~/rtlib
hal_lib
components/threads

# ~/bin
halcmd
halmeter
halscope
classicladder
halui
halrmt
pci_write
pci_read
io
iov2
motion_logger
sai

linuxcncsrv
milltask
linuxcncrsh
schedrmt
linuxcnclcd
# ~/tlc
linuxcnc_tlc
hal_tlc
# ~/lib/python
lineardeltakins_py
rotarydeltakins_py
hal_py
togl_py
linuxcnc_py
gcode_py

after doing "make install", axis finally starts. Now that is nice.I have to do rtlib's coming time.



 
Last edit: 19 Nov 2022 21:01 by Grotius. Reason: udpate
The following user(s) said Thank You: tommylight

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

More
21 Nov 2022 15:30 #257226 by andypugh
Replied by andypugh on topic linuxcnc cmake project

Thanks for the link !! It's really usefull to see how he did it. I can use some of his code coming day's. For example the
preprocces for halcompile. The .comp to .c file preprocess. I am not really a fan of the output of this process.
It makes the code almost unreadable for users.
 

I don't think this matters, the intermediate C code is almost always deleted during the process and isn't really meant to be seen by humans. 
The following user(s) said Thank You: Grotius

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

  • Grotius
  • Grotius's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
21 Nov 2022 20:07 - 21 Nov 2022 20:12 #257254 by Grotius
Replied by Grotius on topic linuxcnc cmake project
Hi Andy,

Yes for normal usage this should be the case.

So far so good. The cmake project is fertig.


The lcnc source code is left original. This can be build as usual.

Then for programmers, they could do the cmake build step. Then the libs are overwritten by the cmake build after "make install".

The install process is then :

remove or clean build dir.
in ~linuxcnc/cmake dir :
mkdir build
cd build
cmake ..
make
make install

For ethercat users, ethercat is also included as a cmake build project.
github.com/grotius-cnc/linuxcnc/tree/mai.../components/ethercat
 Included robot project example  :
github.com/grotius-cnc/linuxcnc/blob/mai...s/qt_occt/screen.jpg

Going to complete this coming day's :
github.com/grotius-cnc/linuxcnc/blob/mai...ts/qt_nml/screen.jpg

After above nml is fertig, going to make a c++ gremlin screen.
After that going to look to integrate the kdl kinematics into the lcnc source.
After that going to look to integrate the scurve into lcnc source.

Now the cmake build system is working i have for the first time in years a full fetched lcnc visible source on
my pc.







 
Last edit: 21 Nov 2022 20:12 by Grotius. Reason: typo
The following user(s) said Thank You: tommylight, Aciera

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

Time to create page: 0.081 seconds
Powered by Kunena Forum