How build Linuxcnc with xenomai3?

More
20 Oct 2021 13:18 #223665 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:
$ 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.

More
20 Oct 2021 13:24 #223669 by tommylight
In a terminal:
uname -a
result ?

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

More
20 Oct 2021 13:43 #223671 by PCW
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.

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

More
21 Oct 2021 06:28 #223782 by SummerLotus
Kernel is:
>> Linux debian10 5.4.70-xeno3 #3 SMP PREEMPT Sat Oct 16 13:37:44 UTC 2021 aarch64 GNU/Linux

The kernel is compiled manually by myself, and the latency test under xenomai shows that the real-time work I need under the current environment is normal
 
Attachments:

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

More
24 Oct 2021 22:57 #224137 by andypugh

You would not use:

./configure --with-realtime=uspace

With Xenomai since realtime=uspace means POSIX realtime
 

I thought that LinuxCNC knew how to use userspace Xenomai realtime, but it has been a very long time since I tried it. 

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.

More
24 Oct 2021 23:48 - 24 Oct 2021 23:53 #224150 by PCW
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.
Last edit: 24 Oct 2021 23:53 by PCW.

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

More
25 Oct 2021 01:35 - 25 Oct 2021 01:37 #224165 by SummerLotus
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.
Attachments:
Last edit: 25 Oct 2021 01:37 by SummerLotus.

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

More
28 Oct 2021 17:57 #224601 by andypugh

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

 

What did you change, and where?

It seems likely that LinuxCNC needs changes to compile with the current Xenomai. 

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

More
28 Oct 2021 18:02 #224602 by andypugh
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?

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

Time to create page: 0.170 seconds
Powered by Kunena Forum