thouis / numpy-trac-migration

numpy Trac to github issues migration
2 stars 3 forks source link

Link option missing ? (Trac #2104) #5900

Open numpy-gitbot opened 11 years ago

numpy-gitbot commented 11 years ago

Original ticket http://projects.scipy.org/numpy/ticket/2104 on 2012-04-12 by trac user medernac, assigned to atmention:pearu.

Hello,

I tried to use f2py like this: f2py -c -m dpolft dpolft.f

and obtain this error: undefined reference to `MAIN__'

It appears that some arguments are missing when linking the dpolft.so shared object.

I have modified this file: numpy/distutils/fcompiler/gnu.py

with:

    # 'linker_so'    : [None, "-g", "-Wall"],
    'linker_so'    : [None, "-g", "-shared -fPIC -Wall"],

and now it compiles.

Hope this helps.

Best regards,

Emmanuel Medernach

numpy-gitbot commented 11 years ago

atmention:rgommers wrote on 2012-04-14

I don't know anything about f2py, but it looks to me like it should be using GnuFCompiler.pic_flags and GnuFCompiler.get_flags_linker_so(). Changing the line as suggested here is not the right solution for numpy.distutils I think.