Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
19 May 2021 01:03 - 11 Jan 2022 03:14 #209430
by Arthur_L
Compile Linux Kernel ,RTAI and LinuxCNC from Source Code was created by Arthur_L
I like compile and install linuxcnc from the source code.I like hands-on, and I can enjoy the experience of compiling and running from the source code. Through this process, I can learn a lot. I don’t like the kind of deb packages that have been generated.
First, I want to compile and install the linux kernel and rtai from the source code. The linux kernel version I compiled is 4.14.111 and the rtai version is 5.2, but I get an error when compiling linuxcncs. The RTAI official website release version matches the Linux kernel version. My question is, does rtai need to be modified, in other words, linuxcnc needs a dedicated RTAI?
I don't have to use this version of the kernel and RTAI. I mean, I want to use the latest kernel and RTAI that can support linuxcnc to compile and run.
First, I want to compile and install the linux kernel and rtai from the source code. The linux kernel version I compiled is 4.14.111 and the rtai version is 5.2, but I get an error when compiling linuxcncs. The RTAI official website release version matches the Linux kernel version. My question is, does rtai need to be modified, in other words, linuxcnc needs a dedicated RTAI?
I don't have to use this version of the kernel and RTAI. I mean, I want to use the latest kernel and RTAI that can support linuxcnc to compile and run.
Last edit: 11 Jan 2022 03:14 by Arthur_L.
Please Log in or Create an account to join the conversation.
19 May 2021 01:42 #209434
by Bari
Replied by Bari on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
The only help available are the readme files posted here:
github.com/NTULINUX/RTAI
github.com/NTULINUX/RTAI
Please Log in or Create an account to join the conversation.
19 May 2021 02:07 #209435
by Arthur_L
Replied by Arthur_L on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
Thanks for Reply.
1、I will download linux kernel (4.19.152) right now
2、I will download rtai right now from github.com/NTULINUX/RTAI
3、Fellow README.INSTALL
4 、I will replied for a minute
1、I will download linux kernel (4.19.152) right now
2、I will download rtai right now from github.com/NTULINUX/RTAI
3、Fellow README.INSTALL
4 、I will replied for a minute
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
19 May 2021 03:55 #209438
by BeagleBrainz
Replied by BeagleBrainz on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
What's the issue with the deb packages, what is wrong with them, where & how do they need improving ?
Building the from source is a simple process. It doesn't give you an insight into how a package works.
They are used by hundreds of users with no issues.
I make deb packages from source for ease of installation, rather than having A RIP installation, plus the machine I build on is way way faster at compiling. If I want to know how Linuxcnc works, I use it what is was intended for, controlling a cnc machine, read the docs and have a look at the source.
Running a machine & reading docs will give you the best insight.
I could teach my mother, who is in her 60's how to compile from source, the only thing she will learn from that is how to build from source, not any insight into how it works.
If you really don't like deb packages, which seems strange, you can always go this way, www.linuxfromscratch.org/ , which I did once build a working Linuxcnc setup from, but when all is said & done, whilst it is fun, there really is no advantage.
After coming from Slackware & Redhat background, I really appreciate how easy it is to install software via deb packages.
If you really really want to cause yourself mental harm and waste hours chasing libraries and building from source, with no clear list of libraries and dependencies, install Slackware 14.2 and then install gitlab.
Building the from source is a simple process. It doesn't give you an insight into how a package works.
They are used by hundreds of users with no issues.
I make deb packages from source for ease of installation, rather than having A RIP installation, plus the machine I build on is way way faster at compiling. If I want to know how Linuxcnc works, I use it what is was intended for, controlling a cnc machine, read the docs and have a look at the source.
Running a machine & reading docs will give you the best insight.
I could teach my mother, who is in her 60's how to compile from source, the only thing she will learn from that is how to build from source, not any insight into how it works.
If you really don't like deb packages, which seems strange, you can always go this way, www.linuxfromscratch.org/ , which I did once build a working Linuxcnc setup from, but when all is said & done, whilst it is fun, there really is no advantage.
After coming from Slackware & Redhat background, I really appreciate how easy it is to install software via deb packages.
If you really really want to cause yourself mental harm and waste hours chasing libraries and building from source, with no clear list of libraries and dependencies, install Slackware 14.2 and then install gitlab.
Please Log in or Create an account to join the conversation.
19 May 2021 05:02 #209440
by Arthur_L
Replied by Arthur_L on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
I sorry,I may have expressed an error, I am not saying that deb is not good。I don’t know much about deb packages, I apologize for what I said。I just want to configure my own linux kernel in the future. It seems that the deb package cannot be compiled and configured.So,iI don't dislike it,but it may not meet my needs.At the same time, thank you very much for the contribution. I will pay attention to my way of speaking
The following user(s) said Thank You: BeagleBrainz
Please Log in or Create an account to join the conversation.
19 May 2021 05:27 #209442
by Arthur_L
Replied by Arthur_L on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
At the same time, I just want to compile the three parts of kernel, rtai, and linuxcnc, just like my title says.I apologize again for the misunderstanding caused by my expression.
The following user(s) said Thank You: BeagleBrainz
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
19 May 2021 05:36 #209443
by BeagleBrainz
Replied by BeagleBrainz on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
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.
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.
The following user(s) said Thank You: Arthur_L
Please Log in or Create an account to join the conversation.
19 May 2021 05:59 #209444
by Arthur_L
Replied by Arthur_L on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
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.
19 May 2021 06:20 #209445
by Arthur_L
Replied by Arthur_L on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
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.
19 May 2021 06:34 - 11 Jan 2022 03:17 #209447
by Arthur_L
Replied by Arthur_L on topic Compile Linux Kernel ,RTAI and LinuxCNC from Source Code
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.
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: 11 Jan 2022 03:17 by Arthur_L.
Please Log in or Create an account to join the conversation.
Time to create page: 0.116 seconds