写或停止语句打破f2py编译

时间:2014-07-09 22:12:33

标签: python numpy fortran f2py

我正在尝试使用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

中找到文件和输出

0 个答案:

没有答案