Skip to contentSkip to conversation

Xenomai Simulator

Xenomai-help Stephan Zimmermann 2 participants 4 messages Nov 2, 2006 – Nov 3, 2006

lore
Share & tools
lore
#0 lore raw

Hi, I am actually trying to set up the Simulator, which turns out to be not so easy...

What I did:
I installed Xenomai 2.2.4 (kernel patches) with Kernel 2.6.17.14, on Debian 3.1 using it's standard compiler gcc-3.3. Then I downgraded the compiler (I need to, if I want c++ to work with the simulator, right?) to version 2.95 and compiled and installed xenomai and xenosim, which seems to be ok.

Now I wanted to try out the Simulation on a very minimal project using the native skin. (I posted the source some days ago because of another problem)

What I got:
Calling
"gcc -I/usr/xenomai/include -g -c main.cpp "
works without any problem, a following call
"gcc -o test main.o -lnative -L/usr/xenomai/lib"
works also with no problem.

But calling
"gcic -I/usr/xenomai/include -g -c main.cpp "
leads to :

In file included from /usr/xenomai/include/nucleus/thread.h:23,

                 from /usr/xenomai/include/native/task.h:26,
                 from main.c:5:

/usr/xenomai/include/nucleus/timer.h: In function `xntlist_insert':
/usr/xenomai/include/nucleus/timer.h:80: syntax error before xntlholder_t' /usr/xenomai/include/nucleus/timer.h:80: syntax error before ->' /usr/xenomai/include/nucleus/timer.h: At top level:
/usr/xenomai/include/nucleus/timer.h:144: syntax error before `XNARCH_DECL_DISPLAY_CONTEXT' /usr/xenomai/include/nucleus/timer.h:144: warning: no semicolon at end of struct or union
--- snip ---

I really have no idea what to do, to fix this.

Thanks for any hint,
greetings, Stephan

#1 lore raw

Am Donnerstag, 2. November 2006 14:53 schrieb Stephan Zimmermann:

Quoted 3 lines

Hi, I am actually trying to set up the Simulator, which turns out to be not so easy...

<..>

Quoted 3 lines

But calling
"gcic -I/usr/xenomai/include -g -c main.cpp "
leads to :

Does your C++ programm compile cleanly under gcc-2.95? If not, you are out of luck, as the simulator was developped under gcc-2.95.

As far as I know, porting it to a newer version would be a considerable effort. I think Gilles mentioned some problems in a earlier mail some months ago.

Best regards

Signature · 1 line
Niklaus Giger
#2 lore raw

Am Donnerstag, 2. November 2006 17:17 schrieb Niklaus Giger:

Quoted 4 lines

Am Donnerstag, 2. November 2006 14:53 schrieb Stephan Zimmermann:

Quoted 2 lines

Hi, I am actually trying to set up the Simulator, which turns out to be not so easy...

Quoted 8 lines

<..>

Quoted 3 lines

But calling
"gcic -I/usr/xenomai/include -g -c main.cpp "
leads to :

Does your C++ programm compile cleanly under gcc-2.95? If not, you are out of luck, as the simulator was developped under gcc-2.95.

I did not even come to trying to compile my C++ application under gcc-2.95, as my testprogram - which is free of any c++ code - doesn't work. (The testprogram simply shadows the maintask and returns, some five lines of code..., as I just see, the code I posted recently contains "std::cout << something..." calls, I removed them and removed everything not needed, didn't mention that before)

#include <sys/mman.h>
#include <stdio.h>
#include "native/task.h"
#include "native/timer.h"
RT_TASK maintask;
int count = 0;

int main(void){
	int err;
	unsigned long overrun = 0; 
	printf("test...\n");
	mlockall(MCL_CURRENT | MCL_FUTURE);
	err = rt_task_shadow (&maintask,"maintask",10,0);
	return 0;
}
Quoted 4 lines

As far as I know, porting it to a newer version would be a considerable effort. I think Gilles mentioned some problems in a earlier mail some months ago.

#3 lore raw

Am Freitag, 3. November 2006 09:13 schrieb Stephan Zimmermann:

Quoted 27 lines

Am Donnerstag, 2. November 2006 17:17 schrieb Niklaus Giger:

Quoted 4 lines

Am Donnerstag, 2. November 2006 14:53 schrieb Stephan Zimmermann:

Quoted 2 lines

Hi, I am actually trying to set up the Simulator, which turns out to be not so easy...

Quoted 8 lines

<..>

Quoted 3 lines

But calling
"gcic -I/usr/xenomai/include -g -c main.cpp "
leads to :

Does your C++ programm compile cleanly under gcc-2.95? If not, you are out of luck, as the simulator was developped under gcc-2.95.

I did not even come to trying to compile my C++ application under gcc-2.95, as my testprogram - which is free of any c++ code - doesn't work. (The testprogram simply shadows the maintask and returns, some five lines of code..., as I just see, the code I posted recently contains "std::cout << something..." calls, I removed them and removed everything not needed, didn't mention that before)

#include <sys/mman.h>
#include <stdio.h>
#include "native/task.h"
#include "native/timer.h"
RT_TASK maintask;
int count = 0;

Quoted 9 lines
int main(void){
	int err;
	unsigned long overrun = 0;
	printf("test...\n");
	mlockall(MCL_CURRENT | MCL_FUTURE);
	err = rt_task_shadow (&maintask,"maintask",10,0);
	return 0;
}

For the simulator you must have a root_thread_init instead of a main procedure.

Have a look at ksrc/skins/üsos+/demos/satch.c. Try to make sim in this directory and test whether the resulting exec works.

Best regards

Signature · 1 line
Niklaus Giger