[英]compilation error with f2py and gfortran: undefined reference to `main'
I recently started using f2py and python2.7 for working on some codes related to an ocean model (ROMS) in Fortran.我最近开始使用 f2py 和 python2.7 来处理与 Fortran 中的海洋模型 (ROMS) 相关的一些代码。 My workstation specifics are Ubuntu 16.04 with python2.7, anaconda2 and gfortran.
我的工作站细节是 Ubuntu 16.04,带有 python2.7、anaconda2 和 gfortran。 I have netcdf and hdf5 libraries installed as well.
我也安装了 netcdf 和 hdf5 库。
The instruction in the makefile is the following (in one line): makefile 中的指令如下(在一行中):
$(F2PY) --fcompiler=gfortran --f90flags=$(F2PY_F90_FLAG) $(F2PY_LIB) $(F2PY_INCLUDE) $(OBJF2PY) -m -c scrip pyscrip.f90
$(F2PY) --fcompiler=gfortran --f90flags=$(F2PY_F90_FLAG) $(F2PY_LIB) $(F2PY_INCLUDE) $(OBJF2PY) -m -c 脚本 pyscrip.f90
where:在哪里:
During compilation, I am getting an error as given:在编译过程中,我收到一个错误:
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function _start: (.text+0x20): undefined reference to 'main' collect2: error: ld returned 1 exit status
I could not understand why this error is showing up.我不明白为什么会出现这个错误。 Is the instruction in the correct order?
指令的顺序是否正确? Does it have something to do with the compiler flags?
它与编译器标志有关吗? Is there any other include file that the code needs (other than netcdf.inc), or any other library (other than netcdf and hdf5 libs)?
是否有代码需要的任何其他包含文件(netcdf.inc 除外)或任何其他库(netcdf 和 hdf5 库除外)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.