News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

undefined reference to "omp"

Started by Tu22M3, December 08, 2009, 03:56:34 PM

Previous topic - Next topic

Tu22M3

Hello,
I amend my TCP/IP source code,
in /usr/src/sys/netinet/tcp_output.c
add #include<sys/omp.h> and add below code in function of
int tcp_output(struct tcpcb *tp)d

int tid;
omp_set_num_threads(4);
#pragma omp parallel
{
tid=omp_get_thread_num();
printf("%d\n",tid)
}

of course,I add -fopenmp in /usr/src/sys/conf/kern.pre.mk
but get the error as below:

linking kernel.debug
tcp_output.o(.text+0x477):In function 'tcp_output':
/usr/src/sys/netinet/tcp_output.c:162:undefined reference to 'omp_set_num_threads'
tcp_output.o(.text+0x4a2):/usr/src/sys/netinet/tcp_output.c:148:undefined reference to 'GOMP_parallel_start'
tcp_output.o(.text+0x4a2):/usr/src/sys/netinet/tcp_output.c:148:undefined reference to 'GOMP_parallel_end'
/usr/src/sys/netinet/tcp_output.c:165:undefined reference to 'omp_get_num_threads'

What's wrong to my kernel?

Thank you for replies.

Cheers,

-- Wang

MortenMacFly

Quote from: Tu22M3 on December 08, 2009, 03:56:34 PM
What's wrong to my kernel?
I don't know but that's definitely the wrong forum. Your question violates our forum rules and has been locked therefore. Please respect our rules (C::B related questions ONLY) next time.

Also see here:
http://forums.next.codeblocks.org/index.php/topic,8962.0.html
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]