Author Topic: undefined reference to "omp"  (Read 6991 times)

Tu22M3

  • Guest
undefined reference to "omp"
« on: December 08, 2009, 03:56:34 pm »
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

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: undefined reference to "omp"
« Reply #1 on: December 08, 2009, 04:01:41 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.codeblocks.org/index.php/topic,8962.0.html
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ