gfortran

gfortran undefined references

和自甴很熟 提交于 2019-12-24 14:50:27
问题 I'm trying to compile a program that depends on a lot of things. I use and modify the makefile provided to stand for my computer settings, but I keep getting a lot of undefined references in the last step of compilation. The command line that causes the troubles is: gfortran -o ../cosmomc ParamNames.o Matrix_utils.o settings.o IO.o cmbtypes.o Planck_like.o cmbdata.o WeakLen.o & bbn.o lrggettheory.o mpk.o bao.o supernovae.o HST.o SDSSLy-a-v3.o CMB_Cls_simple.o paramdef.o propose.o params_CMB.o

Paralelize mixed f77 f90 Fortran code?

∥☆過路亽.° 提交于 2019-12-24 13:58:34
问题 I have a code written mostly in f77 however there are also routines written with the f90 syntax. I've been reading how to use openMP for each case, but now I have the doubt how should I do it if I have both syntax in the same code? More specifically should I use use omp_lib or include 'omp_lib.h' but in the same .f file I have both sintaxys. what if I use both? I am compiling with gfortran 4.8.4. If I use let's say use omp_lib (meaning f90 syntax) Then I have to use the correspondent syntax !

Does symbol capitalization matter in object files with a linked dll?

烂漫一生 提交于 2019-12-24 13:52:47
问题 I'm trying to get the gfortran compiler working in MATLAB on Windows to create mex files. Gfortran isn't supported, but the Intel Fortran compiler is, which leads me to believe that a Fortran compiler should be able to compile Fortran source using MATLAB libraries. As detailed in my previous question, I get an "undefined reference" error for every symbol that should come from the MATLAB libraries. I thought this was an error with the preprocessor not getting invoked as suggested in a question

Updating gfortran without updating GCC

强颜欢笑 提交于 2019-12-24 12:15:58
问题 Is it possible to update gfortran without updating the GCC in a Linux operating system? 回答1: Well, since gfortran is part of the GCC, just updating gfortran could be a little tricky. However, you can download the gfortran binaries, as well as the required gcc-infrastructure package from the official site. You can unzip the two archives into a folder (e.g., /usr/local/gfortran ) and start using this version of GCC (incl. gfortran ) alongside the version provided by your GNU Linux system. It

Fortran functions with C interface result in undefined references when they try to call each other, why?

三世轮回 提交于 2019-12-24 12:14:04
问题 I have an old fortran code, for various reasons I am modifying it to provide functionality using c++. In this code there are two functions, CALC and CALC2. These functions need to be called from the c++ and they call each other. A sketch of CALC: SUBROUTINE CALC(W,NW,DW,IDMX,JUMP,POINT) bind(C, name="CALC") use iso_c_binding C Some statements IF (LO(36)) CALL CALC2(W,NW,DW,IDMX, .TRUE., 14) C More statements END A sketch of CALC2: SUBROUTINE CALC2(W,NW,DW,IDMX,JUMP,POINT) bind(C, name="CALC2"

gfortran can't find OpenMP library (omp_lib.mod) under MinGW

十年热恋 提交于 2019-12-24 11:56:15
问题 I'm trying to compile a Fortran code that someone has sent me. It compiles fine on my Linux box, now I'm trying to compile it under MinGW on Windows. But when I run the gfortran command to compile and link it, it fails with the following error: undumag_main_omp.f:8175:9: use omp_lib 1 Fatal Error: Can't open module file 'omp_lib.mod' for reading at (1): No such file or directory compilation terminated. I'm using the -fopenmp switch to use OpenMP. I've installed MinGW (5.3.0) using the

Fortran IV, compiling error named constant

六眼飞鱼酱① 提交于 2019-12-24 09:17:46
问题 I am trying to compile an old Fortran IV code using the gcc fortran compiler (gfortran 4.8.1 -4). I run the compiler as: gfortran nrlxrf_a.for -std=legacy. These are the error messages: C:\MinGW\bin>gfortran nrlxrf_a.for -std=legacy NRLXRF_a.for:5525.72: IF ( NFILL.EQ. 0) 1 Error: Cannot assign to a named constant at (1) I have checked the line, and there are no spaces after the end of the statement. NRLXRF_a.for:5531.7: 1 ( HFILL( I), I= 1, NFILL), ( H( IU, I), I= I1, I2) 1 Error: Cannot

Undefined reference to `std::chrono::_V2::system_clock::now()' when linking with gfortran

坚强是说给别人听的谎言 提交于 2019-12-24 08:59:33
问题 I am trying to create an user defined block in INSEL which requires C++ to program and I link it using gfortran. I have the following code in my program // Setting seed for random number generators unsigned seed = static_cast<int> (std::chrono::system_clock::now().time_since_epoch().count()); to set as a seed to my random number generator. When i compile it using g++ (gcc v.5.1.0) it shows no error or warning. My compiling command is g++ -O0 -Wall -c -g3 -std=c++14 -fmessage-length=0 $

Global arrays/structs not accessible in gdb while debugging gfortran executable in Eclipse

烈酒焚心 提交于 2019-12-24 08:36:56
问题 I'm using Eclipse (Neon.3 Release 4.6.3) with gdb 7.11.1 and gfortran 5.4.0, to debug an executable, but it only seems possible to watch local subroutine variables and simple external variables properly. Consider this simplified example: module ext_class type extstruct_type integer(kind=4), ::svar1 integer(kind=4), ::svar2 end type extstruct_type integer(kind=4), save :: extvar integer(kind=4), dimension(4), save :: extarray type (extstruct_type), save :: extstruct end module mod subroutine

creating distributable windows python module with f2py

守給你的承諾、 提交于 2019-12-24 08:13:56
问题 I have written some code with python and f2py, mostly using linux. This all works fine, but now I would like to share this with windows users, so I am trying to make a module that is distributable to users who don't necessarily have gfortran or gcc. I've got access to a windows xp box, am using mingw with gfortran. I can compile and use the module on that machine, but on other machines the pyd created seems to require the dll's libgcc and libgfortran. Here is an example from http://www.scipy