Quote:
Originally Posted by sonu kumar
so is it possible that setting environment for ifort can affect installed gfortran compiler?
|
Absolutely not. The environment provides just search paths for specific executables, shared objects, man pages and so on... but what a compiler needs is hard-coded in the compiler itself. In other words, when you run the gfortran compiler it will look for specific objects in its own locations, when you run ifort it will look for other specific object in its own locations. Things will never mixed-up.
The only issue to take in mind is that if you need to compile some specific libraries from source (take as example Unidata's Netcdf libraries) you have to compile them using the same compiler you're planning to use. Or better, compile them twice and use one version or the other at your need.
An example will clarify. On my system I use both ifort and gfortran and in both cases I need Netcdf libraries. Hence I installed a copy in
using ifort. In addition I installed another copy in
Code:
/usr/local/netcdf-3.6.3-gfortran/
this time using gfortran.
Every time I have to compile a program which requires netcdf using ifort, I do:
Code:
ifort -I/opt/netcdf-3.6.3/include my_program.f90 -L/opt/netcdf-3.6.3/lib -lnetcdf
and every time I have to compile a program which requires netcdf using gfortran, I do:
Code:
gfortran -I/usr/local/netcdf-3.6.3-gfortran/include my_program.f90 -L/usr/local/netcdf-3.6.3-gfortran/lib -lnetcdf
Hope it's a little more clear. Be sure, it will be even more clear as soon as you will start to use both the compilers!