Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Inability to compile mex files with openMp and gfortran
Replies: 1   Last Post: Jan 31, 2013 4:49 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Michele Catalano

Posts: 10
Registered: 10/2/09
Inability to compile mex files with openMp and gfortran
Posted: Oct 15, 2009 12:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Dear All,

I'm trying to compile a fortran source code with mex compiling options. I would introduce openMp statements to fasten the jobs. I'm using gfortran.

While I can compile by shell, when I compile with option file engopts.sh I get errors such as:

simulDSGEengProva.o: In function `MAIN__':
simulDSGEengProva.F90:(.text+0x9222): undefined reference to `GOMP_parallel_start'
simulDSGEengProva.F90:(.text+0x922f): undefined reference to `GOMP_parallel_end'
simulDSGEengProva.o: In function `MAIN__.omp_fn.0':
simulDSGEengProva.F90:(.text+0xa737): undefined reference to `omp_get_num_threads'
simulDSGEengProva.F90:(.text+0xa73e): undefined reference to `omp_get_thread_num'
collect2: ld returned 1 exit status

mex: link of 'simulDSGEengProva' failed.

I think it is due to compiler inability to link against some library, in particular that related with openMp i.e., libgomp.

I attach the options in engopts.sh file:

FFLAGS="$MFLAGS -fopenmp -fexceptions "
FLIBS="$RPATH $MLIBS -L/usr/lib/ -lm -lstdc++"

What could be the problem?

thanks in advance

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.