Compile Linux Kernel ,RTAI and LinuxCNC from Source Code

  • BeagleBrainz
  • Visitor
  • Visitor
5 years 5 months ago #209443 by BeagleBrainz
No probs.

But in all honesty the prepackaged kernel is going to be the best option.

Even if you build your own kernel, and do the config yourself(which can be a minefield, and remember not to build a debug kernel), you'll still want to have the kernel make process build the deb packages. This will ensure everything is where the Debian package manager expects everything.

What you are doing is introducing 2 variables into building Linuxcnc.
1: Is the kernel built correctly and have all the packages be put where the various package tools expect everything.
2. Is Linuxcnc correctly building against your RTAI kernel.

So if you really want to build things.

First Install a known prepackaged kernel.
Then grab the linuxcnc sources from git and build against the prepackaged kernel.
Run your latency tests.

Then you can install the kernel you built and build Linuxcnc against the kernel you built & installed.
Run your latency tests.

See which gives the best results.

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

More
5 years 5 months ago #209444 by Arthur_L
I just want to go through the overall compilation step by step. This is just one of my interests. I also think that there are other people who want to be like me, just enjoy the process. To be honest, the kernel I configured and the real-time performance of rtai will definitely be terrible and there is no doubt about it Because I don’t understand these too much.If I want to understand and apply linuxcnc in depth, I might use your real-time kernel deb package, because you have tested these real-time features for a long time, and the shortcomings have been optimized and improved by you. Finally I still want to thank you for your selfless dedication to the community

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

More
5 years 5 months ago #209445 by Arthur_L
In fact, I successfully compiled and installed the kernel version 4.14.111 and RTAI version 5.2 (downloaded from the RTAI official website) on Ubuntu 16.04. However, when compiling linuxcnc, the compilation failed. Then, I knew, linuxcnc needs specific modified RTAI. As you said, compiling the kernel and RTAI is really simple, just install the dependent libraries and execute make and make install, etc.And I Fellow README.INSTALL from github.com/NTULINUX/RTAI , download linux kernel (4.19.152) and RTAI(latest from github.com/NTULINUX/RTAI).

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

More
5 years 5 months ago - 4 years 9 months ago #209447 by Arthur_L
I Fellow README.INSTALL 

1. ./configure --enable-cpus=1 --with-linux-dir=/home/xxx/Downloads/linux-4.19.152
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
.....

2 make
3 sudo make install

It looks like the installation was successful but i run the test :

xxx@xxx:/usr$ cd realtime/
xxx@xxx:/usr/realtime$ cd testsuite/
xxx@xxx:/usr/realtime/testsuite$ ls
display latency run
xxx@xxx:/usr/realtime/testsuite$ sudo ./run
[sudo] password for xxx:
.runinfo is /usr/realtime/testsuite/.runinfo
No RTAI modules loaded.
Running insmod on /usr/realtime/testsuite/.runinfo...
CANNOT FIND MAILBOX
Cleaning up...
RTAI successfully unloaded.
Removing /tmp/runinfo...
Done.
xxx@xxx:/usr/realtime/testsuite$ uname -a
Linux xxx 4.19.152-rtai-amd64 #1 Wed May 19 11:14:24 CST 2021 x86_64 x86_64 x86_64 GNU/Linux

I have no ideas. If I still can't compile successfully, I will install the deb package, but I don't want to give up.
Last edit: 4 years 9 months ago by Arthur_L.

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

More
5 years 5 months ago #209448 by Bari
Please post your dmesg after running the test suite but before rebooting.

It looks like you built it properly.

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

More
5 years 5 months ago #209449 by Arthur_L
Sorry i had reboot..... I Sorry ...

if you want to look the mesg. i can compile RTAI again.

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

Time to create page: 0.358 seconds
Powered by Kunena Forum