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

Linking modules

adis1
Débutant
547 Visites
Hi, I have some compiled modules in a directory /home/mods/ and a program main.f90 that uses that modules in directory /home/programs.
When I type in the directory /home/programs
ifort -c main.f90 -I/home/mods/
everything goes ok but afterwards, when I try to create the executable file with
ifort -o main main.o -I/home/mods
it gives me undefined references to the modules. How can I create my executable?

Thanks to all
0 Compliments
1 Répondre
Steven_L_Intel1
Employé
547 Visites
-I has no meaning when linking. You have to link against the .o files created when the modules were compiled. A common method is to insert the objects in a .a library and link to that.
0 Compliments
Répondre