Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Compiling with modules

b3826120b
Beginner
582 Views
I have got these programme which has a series of .f and .f90 files. For my .f90 files, they uses modules. However when I tried compiling them using intel fortran 8.0 for linux, I realise that some of the .f90 files did not produce .obj files but only .mod files. I received a message from the compiler that action were not performed on these .f90 files.
However I could still compile and make all these files and obtain an executable a.out
However when I run the executable, I receive the following error:

error while loading shared libraries: libcxa.so.5: cannot open shared object file: No such file or directory

Not too sure what is the error here. Would appreciate any help on these points.

Sample of my makefile script:

Code:

SHELL=/bin/sh (as I am using bash)


OBJ_DIR=../../../obj_linux.d/victor.d/victoral.d (Location of object files)

MOD_OBJ=../ (Location of module files)


COMPIL77=/opt/intel/bin/ifort  

COMPIL90=/opt/intel/bin/ifort -g  -B108 -en -p ${MOD_OBJ}


LISTE_OBJ= 

${OBJ_DIR}/angdif.o

${OBJ_DIR}/victor_interface.o


all : $(LISTE_OBJ)


${OBJ_DIR}/angdif.o : ./angdif.f

${COMPIL77} -c ./angdif.f -o ${OBJ_DIR}/angdif.o


${OBJ_DIR}/victor_interface.o : ./victor_interface.f90 ${MOD_DIR}/valpha.o

${COMPIL90} -c ./victor_interface.f90 -o ${OBJ_DIR}/victor_interface.o

clean : 


rm -f ${LISTE_OBJ}



0 Kudos
3 Replies
Steven_L_Intel1
Employee
582 Views
You need to find out why the compiler didn't produce a .obj. It should always do that. If you can't figure it out, submit a test case to Intel Premier Support.
0 Kudos
joe_krahn
Beginner
582 Views
The runtime error is because libcxa.so.5 is not in your shared library path. You have to include the Intel directory where that shared lib resides using the LD_LIBRARY_PATH environment variable, or (if you have root access) by specifying the directory in /etc/ld.so.conf (and running ldconfig).

As for not creating object files, maybe you just did not check the right directory? You would not be able to link otherwise.
0 Kudos
Steven_L_Intel1
Employee
582 Views
Not necessarily. Some modules don't create global symbols that would require the .obj.
0 Kudos
Reply