2020年8月10日星期一

fortran

 Why do the GCC C/C++ compilers seem to recognize Fortran code in the errors
Fortran 90 compiling issue
Fortran 77 Tutorial
https://web.stanford.edu/class/me200c/tutorial_77/
gcc.exe error Missing libwinpthread-1.dll, but it is not missing
mingw-and-missing-dlls
Implied DO
fortran debugging
Debug Fortran Code with GDB
How to print Fortran arrays in GDB?
gfortran----Non-Fortran-Main-Program
Known Causes of Trouble with GNU Fortran
Arrays in subprograms
Sub-Array Manipulations in Fortran90
files_input_output.pdf
fortran77电子书
应该在open语句中加入模式参数,指定文件是用于读取还是写入,这样能避免文件名错误。



最终的解决方案:
1、对于丢失dll的问题,将mingw的bin目录加入PATH
2、 undefined reference to的问题:可以使用gcc编译,但要使用gfortran进行链接。

you can compile with gcc as long as you link with gfortran:
gcc -c foo.f95
gcc -c bar.f95
gfortran -o program foo.o bar.o


 If you were working on a project that has portions in a mixture of languages, you would have to link with gcc and supply the necessary options, e.g.
gcc -c c_component.c
g++ -c c++_component.cpp
gfortran -c fortran_component.f95
gcc -o  program c_component.o   c++_component.o   fortran_component.o   -lstdc++   -lgfortran

没有评论: