我最近开始使用f2py和python2.7编写一些与Fortran中的海洋模型(ROMS)相关的代码。我的工作站是Ubuntu16.04和python2.7、anaconda2和gfortran。我也安装了netcdf和hdf5库。在
makefile中的指令如下(在一行中):
$(F2PY) --fcompiler=gfortran --f90flags=$(F2PY_F90_FLAG) $(F2PY_LIB) $(F2PY_INCLUDE) $(OBJF2PY) -m -c scrip pyscrip.f90
其中:
在编译过程中,我得到一个给定的错误:
/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
我不明白为什么会出现这个错误。说明书的顺序正确吗?它和编译器标志有关吗?代码是否需要其他include文件(除了netcdf.inc.公司),或任何其他库(netcdf和hdf5库除外)?在
目前没有回答
相关问题 更多 >
编程相关推荐