Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

gFortran to iFortran static build

$
0
0

Background: I maintain a large legacy Fortran77 code with that has, for many years, been successfully compiled and linked under a c-shell with gFortran and g++, now under OS X Yosemite. I am moving the code from gFortran to Intel Fortran in an attempt to address some 32-bit pointer issues that seem to be cropping up as I increase the size of internal arrays. My first attempt to compile the Fortran code with ifort was successful but the link to the c++ binary is problematic as I need to access the static Intel 64-bit fortran libraries like I do under gFortran.

The batch file I use under gFortran is below where screamer is the code name and cprog is the c++ shell that I am using:

gfortran -c -O02 -mcmodel=medium *.f

ar crv screamer64.a *.o

rm *.o

ranlib screamer64.a

g++ -c cprog.cpp

g++ -o screamer64 cprog.o screamer64.a /usr/local/lib/libgfortran.a /usr/local/lib/libquadmath.a /usr/local/lib/gcc/x86_64-apple-darwin14.4.0/5.1.0/libgcc.a

 

Compiling with ifort (V15.0.3) will work (after removing the optimization). But the final g++ link will fail because the ifort specific library calls are not addressed in that command line. The manual is vague about the library calls needed for a static build. Suggestions?


Viewing all articles
Browse latest Browse all 3270

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>