Compiling issue with ifort composer_xe_2015.3.187

2019-03-05 07:41发布

问题:

I am compiling my Fortran code with the latest Fortran compiler composer_xe_2015.3.187 on Ubuntu 14.04 64 bit system.

I am using this compiler flag:

-fp-model precise 

The error message is:

f95: error: precise: No such file or directory
f95: error: unrecognized command line option ‘-fp-model’

The same code does not show this error with older ifort version composerxe-2011.4.191

回答1:

On (Vanilla) Ubuntu, f95 is a link to gfortran (the GNU GCC Fortran compiler), not ifort (Intel's Fortran compiler):

$ which f95 
/usr/bin/f95

$ ls -la /usr/bin/f95
lrwxrwxrwx 1 root root 21 Apr 15  2014 /usr/bin/f95 -> /etc/alternatives/f95

$ ls -la /etc/alternatives/f95
lrwxrwxrwx 1 root root 17 Apr 15  2014 /etc/alternatives/f95 -> /usr/bin/gfortran

gfortran does not support -fp-model.

You should use ifort instead (you probably need to edit the Makefile). Alternatively, you could change the link to point to the ifort binary.