Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Fortran 编译nr.f90时出错_Fortran_Fortran90 - Fatal编程技术网

Fortran 编译nr.f90时出错

Fortran 编译nr.f90时出错,fortran,fortran90,Fortran,Fortran90,我需要在Fortran 90代码中使用MRQMIN子例程。在该子例程中还有一些其他模块nrtype.90,nrutil.f90和nr.f90。我正在用这些命令编译所有这些模块和我自己的代码 ifort -c nrtype.90 ifort -c nrutil.f90 ifort -c nr.f90 ifort test.f90 nrtype.o nrutil.o nr.o -o test 但我收到了这个错误 /tmp/ifortcx4Tb3.o: In function `m

我需要在Fortran 90代码中使用MRQMIN子例程。在该子例程中还有一些其他模块
nrtype.90
nrutil.f90
nr.f90
。我正在用这些命令编译所有这些模块和我自己的代码

ifort -c nrtype.90  
ifort -c nrutil.f90  
ifort -c nr.f90    
ifort test.f90 nrtype.o nrutil.o nr.o -o test 
但我收到了这个错误

/tmp/ifortcx4Tb3.o: In function `mrqmin_IP_mrqmin_private_':  
   test.f90:(.text+0x4041): undefined reference to `gaussj_'  
   test.f90:(.text+0x4896): undefined reference to `covsrt_'     
   test.f90:(.text+0x48a5): undefined reference to `covsrt_' 

在编译过程中我是否遗漏了一些东西?

nr.f90
只提供子例程的接口,而不是子例程本身

您必须分别编译
gaussj.f90
covsrt.f90
,并指定它们(我为
gfortran
尝试了它,但它也应该与
ifort
一起使用):


我在mrqmin子例程和nr.f90中都有gaussj和covsrt函数。MRQMIN使用这三个模块,nr.f90使用nrtype.f90。我在MRQMIN和nr.f90中有“use”命令。但是我没有函数“mrqmin\u IP\u mrqmin\u private”,所以函数
gaussj
covsrt
,以及子程序
mrqmin
在文件
nr.f90
的同一个模块中?不,mrqmin是我在主代码“test.f90”中使用的子程序所有其他模块都由mrqmin使用,但这两个功能同时用于nr.f90和mrqminthanks。对于gaussj.f90,它起了很大的作用,但是您能给我发送我也可以下载covsrt.f90的链接吗?我找不到它我使用了你提供的链接(它在同一个目录中);-)
gfortran -c gaussj.f90
gfortran -c covsrt.f90
gfortran test.f90 mrqmin.o nr.o nrtype.o nrutil.o gaussj.o covsrt.o