我正在尝试使用fortran
编译一个与python
一起使用的f2py
模块。如果删除write(*,*) ...
和stop ...
语句,它会编译并运行,但当我包含其中任何一个语句时,编译将退出并显示错误:
/usr/bin/ld: /share/apps/gcc/4.7.1/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libgfortran.a(stop.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/share/apps/gcc/4.7.1/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libgfortran.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
/usr/bin/ld: /share/apps/gcc/4.7.1/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libgfortran.a(stop.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/share/apps/gcc/4.7.1/lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../lib64/libgfortran.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
gcc
是版本4.7.1,numpy
是1.8.0,我用简单的
f2py -c -m integration integration_module.f90
任何想法或解决方法?
修改
可以在this gist。
中找到文件和输出