Dynamic Linking Problems with Intel Compiler

J

Jeff Hagelberg

I'm trying to create a python module which can be used by a python
interpreter embedded inside a fortran program I have. To do this, I
first created python wrappers for all the functions in my fortran
program using f2py. I then start an embedded python interpreter in c
code which I link against the fortran program. I invoke the fortran
program with a filename containing python code. This file is passed
to the c code which passes it on to the python interpreter which
executes it, causing the python module to be imported and allowing the
python code to control the fortran application.

At least, that is the idea.

The python module I am creating is called mirandaInternal.so. It
contains the python wrappers, but is not linked against object files
for the main fortan program. The idea is that those symbols should be
resolved at run-time.

The problem is that for some reason the symbols are not able to be
resolved. I am using gcc to do the c compiling and ifort (the intel
fortran compiler) to do the fortran compiling and all of the linking.
I have tried using the "-Bdynamic" flag when linking both the
executable and the shared library for the module, but that has not
seemed to help.

Has anyone have any suggestions as to what I need to do to the the
dynamic linking to work properly?

Thanks in advance,

Jeff Hagelberg
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Jeff said:
Has anyone have any suggestions as to what I need to do to the the
dynamic linking to work properly?

You need to pass the -export-dynamic flag to the linker that links
in the embedded Python interpreter. When linking with gcc, this
is achieved through -Xlinker -export-dynamic; whether this works
for ifort as well, I don't know.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top