Dynamic Linking Problems with Intel Compiler

Discussion in 'Python' started by Jeff Hagelberg, Sep 10, 2004.

  1. 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
     
    Jeff Hagelberg, Sep 10, 2004
    #1
    1. Advertising

  2. Jeff Hagelberg wrote:
    > 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
     
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Sep 10, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ryan Mitchley

    Move constructors and Intel compiler

    Ryan Mitchley, Jan 12, 2004, in forum: C++
    Replies:
    0
    Views:
    351
    Ryan Mitchley
    Jan 12, 2004
  2. Jeff Hagelberg
    Replies:
    0
    Views:
    297
    Jeff Hagelberg
    Sep 10, 2004
  3. Replies:
    1
    Views:
    2,068
    mlimber
    Jul 11, 2006
  4. whatnext
    Replies:
    9
    Views:
    441
  5. Kazik�
    Replies:
    4
    Views:
    1,391
    Jonathan Lee
    Jul 6, 2009
Loading...

Share This Page