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

compile ifort source code in different folder

diedro
Beginner
1,399 Views

Dear all,

I would like to compile a fortran code with ifort. The source code files *.f90 are in different sub-folders.

how can I do?

Thanks

 

 

0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,399 Views

Put the path to the files in your ifort command. This is no different than using cp or any other command. 

0 Kudos
diedro
Beginner
1,399 Views

Dear All, Dear Steve,

thanks. The problem is that I have to many files to do that. I have also tried with:

 ifort -r -r8 *.f90 -lmkl_blas95_lp64 -lmkl_lapack95_lp64 -mkl=sequential

but fortran creates the modules outside the folder so I was not able to use then and fortran itself gived me an error in the second compilation for missing module.

Do I have to create a makefile?

Thanks

0 Kudos
Steven_L_Intel1
Employee
1,399 Views

I would think a makefile wouid be handy for a large project. But you can use "-module path" to specify where modules should be created (and this location is also added to the include path.)

0 Kudos
diedro
Beginner
1,399 Views

Dear Steve, Dear all,

thanks so much

Have a nice day

0 Kudos
Reply