GennSev
GennSev

Reputation: 1646

Undefined reference to `omp_get_max_threads_'

I'm getting the following errors trying to compile a project: (fortran, using gfortran)

undefined reference to `omp_get_max_threads_'

undefined reference to `omp_get_thread_num_'

Problem is, my GCC version is 4.4.3, which was suppose to support OpenMP.

Upvotes: 58

Views: 121825

Answers (3)

orientchen1978
orientchen1978

Reputation: 186

gcc -program.c -o obj -fopenmp

Upvotes: 2

yyfn
yyfn

Reputation: 767

The code needs to be compiled with -fopenmp.

Upvotes: 23

Jonathan Dursi
Jonathan Dursi

Reputation: 50927

With gcc, you need to compile and link with -fopenmp to enable OpenMP. Other compilers have different options; with intel it's -openmp, with pgi it's -mp, etc.

Upvotes: 101

Related Questions