Hello there, also a newbie here.
So far, all pages I found about this subject recommend editing your .basrc file. I have tried many things, like adding all of these at the end of my .bashrc file, all failures:
source /opt/intel/composer_xe_2015.3.187/bin/intel64/ifortvars.sh intel64
source ~/opt/intel/composer_xe_2015.3.187/bin/ifortvars.sh intel64
source /root/opt/intel/composer_xe_2015.3.187/bin/intel64/ifortvars.sh intel64
The last one actually messed up my terminal, don't recommend it (when you start the terminal, you're not a superuser yet, so you don't have permission to access root, and it goes wrong, apparently).
The change that made a difference was actually this one:
PATH="/opt/intel/composer_xe_2015.3.187/bin/intel64:$PATH" export PATH LD_LIBRARY_PATH="/opt/intel/composer_xe_2015.3.187/compiler/lib/intel64:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH
After that, this is the kind of response I get from the terminal:
leonardo@Leonardo-linux:~$ which ifort
leonardo@Leonardo-linux:~$ ifort -v
ifort version 15.0.3
ifort: command line error: no files specified; for help type "ifort -help"
So it seems that things are OK, but they're not.
When I try this other command, this is what comes out of the terminal:
leonardo@Leonardo-linux:~/lib$ sudo make -f makefile
ifort -c -O2 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I/lib/src/grib_api-1.13.1/include erf.f90
/bin/bash: ifort: command not found
make: *** [erf.o] Error 127
Can someone help me? Here's a snippet of the makefile:
HELL = /bin/bash MAIN = FLEXPART_IFORT # FC = ifort INCPATH = /lib/src/grib_api-1.13.1/include LIBPATH1 = /lib/src/grib_api-1.13.1/lib LIBPATH2 = /lib/jasper-1.900.1/lib LIBPATH3 = ~/root/opt/intel/composer_xe_2015.3.187/bin/intel64 #FFLAGS = -O3 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I$(INCPATH) FFLAGS = -O2 -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I$(INCPATH) #FFLAGS = -fbounds-check -m64 -mcmodel=medium -fconvert=little-endian -frecord-marker=4 -I$(INCPATH) LDFLAGS = $(FFLAGS) -L$(LIBPATH3) -L$(LIBPATH2) -L$(LIBPATH1) -lgrib_api_f90 -lgrib_api -lm -ljasper # MODOBJS = \ par_mod.o com_mod.o \ OBJECTS = \ writeheader.o assignland.o\ $(MAIN): $(MODOBJS) $(OBJECTS) $(FC) *.o -o $(MAIN) $(LDFLAGS) $(OBJECTS): $(MODOBJS) %.o: %.f90 $(FC) -c $(FFLAGS) $< clean: rm *.o *.mod
As you probably figured out, if you read the more comprehensible parts of the thread, your sudo command discards your path settings as well as taking away your ownership of any files it creates.
If you had a makefile including an install target requiring sudo (but not fort), normal usage would be
After that completes
sudo make install