How build Linuxcnc with xenomai3?
- SummerLotus
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 1
20 Oct 2021 13:18 #223665
by SummerLotus
How build Linuxcnc with xenomai3? was created by SummerLotus
Kernel version: 5.4.70
Xenomai version: 3.2
Linuxcnc version: 2.8
I tried to compile linuxcnc in the above environment, and successfully compiled all programs.
But when I run latency-test, it prompts "Note: Using POSIX non-realtime"
The following are my configuration steps:
During make, the posix/pthread.h header file in the uspace_xenomai.cc file cannot be found.
I modified it to cobalt/pthread.h corresponding to xenomai3. Then compile successfully!
But as I said at the beginning, the compiled program runs in a non-real-time environment.
It is not like some people will prompt to use Xenomai POSIX **** at runtime.Of course, the results of latency-test are very bad.
By the way, I used the latency compiled by xenomai to test and achieved very good results, so my xenomai real-time kernel and environment are working.
So, did I do something wrong or should I use a special Linuxcnc branch?
Xenomai version: 3.2
Linuxcnc version: 2.8
I tried to compile linuxcnc in the above environment, and successfully compiled all programs.
But when I run latency-test, it prompts "Note: Using POSIX non-realtime"
The following are my configuration steps:
$ git clone https://github.com/LinuxCNC/linuxcnc.git -b 2.8 linuxcnc-2.8
$ cd linuxcnc-2.8/debian
$ ./configure uspace xenomai (It return success)
$ cd .. $ dpkg-checkbuilddeps (installed all depened)
$ cd src/
$ ./autogen.sh
$ ./configure --with-realtime=uspace
$ make
$ sudo make setuid
$ source ../script/rip-enviroment
During make, the posix/pthread.h header file in the uspace_xenomai.cc file cannot be found.
I modified it to cobalt/pthread.h corresponding to xenomai3. Then compile successfully!
But as I said at the beginning, the compiled program runs in a non-real-time environment.
It is not like some people will prompt to use Xenomai POSIX **** at runtime.Of course, the results of latency-test are very bad.
By the way, I used the latency compiled by xenomai to test and achieved very good results, so my xenomai real-time kernel and environment are working.
So, did I do something wrong or should I use a special Linuxcnc branch?
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19188
- Thank you received: 6432
20 Oct 2021 13:24 #223669
by tommylight
Replied by tommylight on topic How build Linuxcnc with xenomai3?
In a terminal:
uname -a
result ?
uname -a
result ?
Please Log in or Create an account to join the conversation.
20 Oct 2021 13:43 #223671
by PCW
Replied by PCW on topic How build Linuxcnc with xenomai3?
You would not use:
./configure --with-realtime=uspace
With Xenomai since realtime=uspace means POSIX realtime
I don't know but I expect LinuxCNC Xenomai support needs work.
./configure --with-realtime=uspace
With Xenomai since realtime=uspace means POSIX realtime
I don't know but I expect LinuxCNC Xenomai support needs work.
Please Log in or Create an account to join the conversation.
- SummerLotus
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 1
21 Oct 2021 06:28 #223782
by SummerLotus
Replied by SummerLotus on topic How build Linuxcnc with xenomai3?
Attachments:
Please Log in or Create an account to join the conversation.
24 Oct 2021 22:57 #224137
by andypugh
linuxcnc.org/docs/master/html/code/build...nc.html#_build_modes
The test at the configure stage is here: github.com/LinuxCNC/linuxcnc/blob/faab5f...rc/configure.ac#L226
There might be a clue here; github.com/LinuxCNC/linuxcnc/blob/2e75b0...dder/README.txt#L173
Do you have a xeno-config file in the default path?
Replied by andypugh on topic How build Linuxcnc with xenomai3?
I thought that LinuxCNC knew how to use userspace Xenomai realtime, but it has been a very long time since I tried it.You would not use:
./configure --with-realtime=uspace
With Xenomai since realtime=uspace means POSIX realtime
linuxcnc.org/docs/master/html/code/build...nc.html#_build_modes
The test at the configure stage is here: github.com/LinuxCNC/linuxcnc/blob/faab5f...rc/configure.ac#L226
There might be a clue here; github.com/LinuxCNC/linuxcnc/blob/2e75b0...dder/README.txt#L173
Do you have a xeno-config file in the default path?
Please Log in or Create an account to join the conversation.
24 Oct 2021 23:48 - 24 Oct 2021 23:53 #224150
by PCW
Replied by PCW on topic How build Linuxcnc with xenomai3?
Ahh I did not realise that the somewhat misnamed:
./configure --with-realtime=uspace
Is supposed to work for RTAI and Xenomai if the proper files are present.
So, yes certainly possible configure is not finding these files so just building
POSIX realtime dependent LinuxCNC
Seems like
./configure --with-realtime=xenomai
Would be a lot clearer, and would complain about a missing Xenomai build environment
rather than buiding a mystery LinuxCNC version.
./configure --with-realtime=uspace
Is supposed to work for RTAI and Xenomai if the proper files are present.
So, yes certainly possible configure is not finding these files so just building
POSIX realtime dependent LinuxCNC
Seems like
./configure --with-realtime=xenomai
Would be a lot clearer, and would complain about a missing Xenomai build environment
rather than buiding a mystery LinuxCNC version.
Last edit: 24 Oct 2021 23:53 by PCW.
Please Log in or Create an account to join the conversation.
- SummerLotus
- Offline
- Junior Member
Less
More
- Posts: 27
- Thank you received: 1
25 Oct 2021 01:35 - 25 Oct 2021 01:37 #224165
by SummerLotus
Replied by SummerLotus on topic How build Linuxcnc with xenomai3?
I think there is no problem with my xenomai installation~I compiled and installed the following packages in my system~
libxenomai-dev_2.99.0_arm64.deb
xenomai-kernel-source_2.99.0_all.deb
xenomai-runtime_2.99.0_arm64.deb
libxenomai1_2.99.0_arm64.deb
When I use ./configure uspace xenomai or ./configure xenomai, the prompt that appears corresponds to the following.
When I use ./configure --with-realtime=uspace under src, it can be seen that xeno-config was found in the output information, but I am not sure whether it is configured correctly.
When I execute make, it prompts that there is a problem with posix/pthread.h in usapce_xenomai.cc,
so I changed it to cobalt/pthread.h
so that it can be compiled and passed. Then as I said, it is non-real-time.
libxenomai-dev_2.99.0_arm64.deb
xenomai-kernel-source_2.99.0_all.deb
xenomai-runtime_2.99.0_arm64.deb
libxenomai1_2.99.0_arm64.deb
When I use ./configure uspace xenomai or ./configure xenomai, the prompt that appears corresponds to the following.
When I use ./configure --with-realtime=uspace under src, it can be seen that xeno-config was found in the output information, but I am not sure whether it is configured correctly.
When I execute make, it prompts that there is a problem with posix/pthread.h in usapce_xenomai.cc,
so I changed it to cobalt/pthread.h
so that it can be compiled and passed. Then as I said, it is non-real-time.
Attachments:
Last edit: 25 Oct 2021 01:37 by SummerLotus.
Please Log in or Create an account to join the conversation.
28 Oct 2021 17:57 #224601
by andypugh
It seems likely that LinuxCNC needs changes to compile with the current Xenomai.
Replied by andypugh on topic How build Linuxcnc with xenomai3?
What did you change, and where?When I execute make, it prompts that there is a problem with posix/pthread.h in usapce_xenomai.cc,
so I changed it to cobalt/pthread.h
It seems likely that LinuxCNC needs changes to compile with the current Xenomai.
Please Log in or Create an account to join the conversation.
28 Oct 2021 18:02 #224602
by andypugh
Replied by andypugh on topic How build Linuxcnc with xenomai3?
I think that the problem might be that there is a rather naive test for a Xenomai kernel here:
github.com/LinuxCNC/linuxcnc/blob/2e75b0...uspace_common.h#L361
What happens if you change that to look for "-xeno3" instead?
github.com/LinuxCNC/linuxcnc/blob/2e75b0...uspace_common.h#L361
What happens if you change that to look for "-xeno3" instead?
Please Log in or Create an account to join the conversation.
- fsabbatini
- Offline
- Junior Member
Less
More
- Posts: 39
- Thank you received: 67
09 Oct 2022 01:39 #253794
by fsabbatini
Replied by fsabbatini on topic How build Linuxcnc with xenomai3?
I have been working with lcnc and xenomai 3.1 long enough to assure you it works much better than with RTAI. I have been using it with ethercat master from IgH with RTDM drivers for realtek r8169 and intel i210 igb drivers, so far no issues, running cold and smooth
for anyone who wants to test i have a github repo where you can download all the compiled binaries for linux kernel, headers, xenomai libraries and runtime, ethercat master with rtdm drivers and linuxcnc ethercat (lcec) here
xenomai3.1 for lcnc
The part missing is just compiling linuxcnc. To do so just clone the linuxcnc repo and configure it as userpace (--with-realtime=uspace)
when executing lcnc it will say "Note: Using XENOMAI (posix-skin) realtime" as it is using posix skin for making life easier
Best regards
Franco
for anyone who wants to test i have a github repo where you can download all the compiled binaries for linux kernel, headers, xenomai libraries and runtime, ethercat master with rtdm drivers and linuxcnc ethercat (lcec) here
xenomai3.1 for lcnc
The part missing is just compiling linuxcnc. To do so just clone the linuxcnc repo and configure it as userpace (--with-realtime=uspace)
when executing lcnc it will say "Note: Using XENOMAI (posix-skin) realtime" as it is using posix skin for making life easier
Best regards
Franco
The following user(s) said Thank You: SummerLotus, a1904735
Please Log in or Create an account to join the conversation.
Time to create page: 0.179 seconds