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
PGI Fortran错误:可能未为str(npy.f90)指定PGF90-S-0155-IGNORE_TKR_Fortran_Gfortran_Pgi - Fatal编程技术网

PGI Fortran错误:可能未为str(npy.f90)指定PGF90-S-0155-IGNORE_TKR

PGI Fortran错误:可能未为str(npy.f90)指定PGF90-S-0155-IGNORE_TKR,fortran,gfortran,pgi,Fortran,Gfortran,Pgi,我正在使用将2D数组保存为PythonNumpy.npy格式。我将npy.f90文件复制到当前目录中,在开头添加一行使用m_npy,然后调用save_npy(filename_str,array)以格式保存fortran数组 如前所述,我在Ubuntu OS bash终端中使用以下命令进行编译 然后我运行a.out 现在,如何用同样的方法来处理? 如果我只是用pgfortran替换gfortran,用-Mfree标记-ffree form,我不会得到任何.o文件,也不会得到任何a.out文件 有

我正在使用将2D数组保存为PythonNumpy.npy格式。我将npy.f90文件复制到当前目录中,在开头添加一行
使用m_npy
,然后
调用save_npy(filename_str,array)
格式保存fortran
数组

如前所述,我在Ubuntu OS bash终端中使用以下命令进行编译

然后我运行
a.out

现在,如何用同样的方法来处理? 如果我只是用
pgfortran
替换
gfortran
,用
-Mfree
标记
-ffree form
,我不会得到任何
.o
文件,也不会得到任何
a.out
文件

有人能帮我如何使用
pgfortran
? 提前谢谢

编辑:输出消息

happy@pop-os:~/Desktop/tmp$ pgfortran -v -Mfree -c npy.f90 mycode.f
Export PGI_CURR_CUDA_HOME=/home/happy/my_bin/linux86-64-llvm/2019/cuda/
Export PGI=/home/happy/my_bin
npy.f90:

/home/happy/my_bin/linux86-64-llvm/19.10/bin/pgf901-llvm npy.f90 -opt 1 -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp haswell -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -stdinc /home/happy/my_bin/linux86-64-llvm/19.10/include-gcc70:/home/happy/my_bin/linux86-64-llvm/19.10/include:/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/local/include:/usr/include/x86_64-linux-gnu:/usr/include -cmdline '+pgfortran npy.f90 -v -Mfree -c' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __amd64 -def __amd64__ -def __k8 -def __k8__ -def __MMX__ -def __SSE__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -def __PGLLVM__ -def __extension__= -freeform -vect 48 -x 54 1 -x 70 0x40000000 -x 195 0x8000 -x 70 0x40000000 -x 68 0x1 -y 163 0xc0000000 -x 189 0x10 -freeform -stbfile /tmp/pgfortranB7GGrMytczLF.stb -modexport /tmp/pgfortranZ7GGzy9hSI0F.cmod -modindex /tmp/pgfortranl7GGHBiTp5v_.cmdx -output /tmp/pgfortrand7GGj9WNwCEi.ilm
  0 inform,   0 warnings,   0 severes, 0 fatal for m_npy
PGF90-S-0155-IGNORE_TKR may not be specified for str (npy.f90)
  0 inform,   0 warnings,   1 severes, 0 fatal for dict_str
PGF90-S-0155-IGNORE_TKR may not be specified for str (npy.f90)
PGF90-S-0155-IGNORE_TKR may not be specified for fin_str (npy.f90)
  0 inform,   0 warnings,   2 severes, 0 fatal for shape_str
PGF90/x86-64 Linux 19.10-0: compilation completed with severe errors
pgfortran-Fatal-f901 completed with exit code 1

mycode.f:

/home/happy/my_bin/linux86-64-llvm/19.10/bin/pgf901-llvm mycode.f -opt 1 -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp haswell -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -stdinc /home/happy/my_bin/linux86-64-llvm/19.10/include-gcc70:/home/happy/my_bin/linux86-64-llvm/19.10/include:/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/local/include:/usr/include/x86_64-linux-gnu:/usr/include -cmdline '+pgfortran mycode.f -v -Mfree -c' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __amd64 -def __amd64__ -def __k8 -def __k8__ -def __MMX__ -def __SSE__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -def __PGLLVM__ -def __extension__= -nofreeform -vect 48 -x 54 1 -x 70 0x40000000 -x 195 0x8000 -x 70 0x40000000 -x 68 0x1 -y 163 0xc0000000 -x 189 0x10 -freeform -stbfile /tmp/pgfortran77GGX0Qc9YSv.stb -modexport /tmp/pgfortrant7GG5AHHUZit.cmod -modindex /tmp/pgfortranR7GGbYmdj1kO.cmdx -output /tmp/pgfortranJ7GGP3RNrkVW.ilm
PGF90-S-0155-IGNORE_TKR may not be specified for str (mycode.f)
PGF90-S-0155-IGNORE_TKR may not be specified for fin_str (mycode.f)
  0 inform,   0 warnings,   2 severes, 0 fatal for julia_set_complex_polinomial
PGF90/x86-64 Linux 19.10-0: compilation completed with severe errors
pgfortran-Fatal-f901 completed with exit code 1

Unlinking /tmp/pgfortrand7GGj9WNwCEi.ilm
Unlinking /tmp/pgfortranB7GGrMytczLF.stb
Unlinking /tmp/pgfortranZ7GGzy9hSI0F.cmod
Unlinking /tmp/pgfortranl7GGHBiTp5v_.cmdx
Unlinking /tmp/pgfortranJ7GGP3RNrkVW.ilm
Unlinking /tmp/pgfortran77GGX0Qc9YSv.stb
Unlinking /tmp/pgfortrant7GG5AHHUZit.cmod
Unlinking /tmp/pgfortranR7GGbYmdj1kO.cmdx

该标题具有误导性,因为用于编译和链接的方法很好。实际的错误是因为正在编译的代码使用了一个新的Fortran特性,即PGI还不支持的假定秩。此项目只需使用gfortran,或者更新源代码,使其不使用假定秩。

能否提供编译和链接的完整命令行和输出,以及添加“-v”(详细)标志?希望这能提供更多细节来确定问题。输出太长,可以放入注释中
pgfortran-v-Mfree-c npy.f90 mycode.f
produeces only
m_npy.mod
。gfortran曾用于生成
npy.o
mycode.o
。输出中几乎没有服务器。所以问题是您遇到了严重错误?这将阻止生成对象文件。怎么了?尽管没有“-v”标志,您是否可以发布编译的完整输出?请注意,最好是用更新的信息编辑您的原始帖子。你能提供的信息越详细,人们就越容易帮助你。我用输出消息编辑了这篇文章。“仅使用gfortran”可以替换为“使用支持假定秩的编译器”,或者有其他东西使这一点特定于gfortran?因为OP使用gfortran,我建议他使用它。但您是正确的,如果其他编译器支持假定秩,他也应该能够使用它。请注意,PGI(最近被重新命名为NVIDIA的HPC编译器)添加新Fortran功能的途径是通过我们在社区参与下开发的Flang F18项目。()
happy@pop-os:~/Desktop/tmp$ pgfortran -v -Mfree -c npy.f90 mycode.f
Export PGI_CURR_CUDA_HOME=/home/happy/my_bin/linux86-64-llvm/2019/cuda/
Export PGI=/home/happy/my_bin
npy.f90:

/home/happy/my_bin/linux86-64-llvm/19.10/bin/pgf901-llvm npy.f90 -opt 1 -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp haswell -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -stdinc /home/happy/my_bin/linux86-64-llvm/19.10/include-gcc70:/home/happy/my_bin/linux86-64-llvm/19.10/include:/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/local/include:/usr/include/x86_64-linux-gnu:/usr/include -cmdline '+pgfortran npy.f90 -v -Mfree -c' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __amd64 -def __amd64__ -def __k8 -def __k8__ -def __MMX__ -def __SSE__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -def __PGLLVM__ -def __extension__= -freeform -vect 48 -x 54 1 -x 70 0x40000000 -x 195 0x8000 -x 70 0x40000000 -x 68 0x1 -y 163 0xc0000000 -x 189 0x10 -freeform -stbfile /tmp/pgfortranB7GGrMytczLF.stb -modexport /tmp/pgfortranZ7GGzy9hSI0F.cmod -modindex /tmp/pgfortranl7GGHBiTp5v_.cmdx -output /tmp/pgfortrand7GGj9WNwCEi.ilm
  0 inform,   0 warnings,   0 severes, 0 fatal for m_npy
PGF90-S-0155-IGNORE_TKR may not be specified for str (npy.f90)
  0 inform,   0 warnings,   1 severes, 0 fatal for dict_str
PGF90-S-0155-IGNORE_TKR may not be specified for str (npy.f90)
PGF90-S-0155-IGNORE_TKR may not be specified for fin_str (npy.f90)
  0 inform,   0 warnings,   2 severes, 0 fatal for shape_str
PGF90/x86-64 Linux 19.10-0: compilation completed with severe errors
pgfortran-Fatal-f901 completed with exit code 1

mycode.f:

/home/happy/my_bin/linux86-64-llvm/19.10/bin/pgf901-llvm mycode.f -opt 1 -nostatic -x 19 0x400000 -quad -x 59 4 -x 15 2 -x 49 0x400004 -x 51 0x20 -x 57 0x4c -x 58 0x10000 -x 124 0x1000 -tp haswell -x 57 0xfb0000 -x 58 0x78031040 -x 47 0x08 -x 48 4608 -x 49 0x100 -stdinc /home/happy/my_bin/linux86-64-llvm/19.10/include-gcc70:/home/happy/my_bin/linux86-64-llvm/19.10/include:/usr/lib/gcc/x86_64-linux-gnu/9/include:/usr/local/include:/usr/include/x86_64-linux-gnu:/usr/include -cmdline '+pgfortran mycode.f -v -Mfree -c' -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __LP64__ -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __amd64 -def __amd64__ -def __k8 -def __k8__ -def __MMX__ -def __SSE__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -def __PGLLVM__ -def __extension__= -nofreeform -vect 48 -x 54 1 -x 70 0x40000000 -x 195 0x8000 -x 70 0x40000000 -x 68 0x1 -y 163 0xc0000000 -x 189 0x10 -freeform -stbfile /tmp/pgfortran77GGX0Qc9YSv.stb -modexport /tmp/pgfortrant7GG5AHHUZit.cmod -modindex /tmp/pgfortranR7GGbYmdj1kO.cmdx -output /tmp/pgfortranJ7GGP3RNrkVW.ilm
PGF90-S-0155-IGNORE_TKR may not be specified for str (mycode.f)
PGF90-S-0155-IGNORE_TKR may not be specified for fin_str (mycode.f)
  0 inform,   0 warnings,   2 severes, 0 fatal for julia_set_complex_polinomial
PGF90/x86-64 Linux 19.10-0: compilation completed with severe errors
pgfortran-Fatal-f901 completed with exit code 1

Unlinking /tmp/pgfortrand7GGj9WNwCEi.ilm
Unlinking /tmp/pgfortranB7GGrMytczLF.stb
Unlinking /tmp/pgfortranZ7GGzy9hSI0F.cmod
Unlinking /tmp/pgfortranl7GGHBiTp5v_.cmdx
Unlinking /tmp/pgfortranJ7GGP3RNrkVW.ilm
Unlinking /tmp/pgfortran77GGX0Qc9YSv.stb
Unlinking /tmp/pgfortrant7GG5AHHUZit.cmod
Unlinking /tmp/pgfortranR7GGbYmdj1kO.cmdx