Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

create (make) a fortran library

rasa
Beginner
1,029 Views
Can someone point me to the directions for creating a FORTRAN library (instead of an executable) that can be used by other fortran code?

I am looking for intrsructions similar to the following:
http://www.oceanographers.net/forums/showthread.php?378-How-to-make-a-FORTRAN-library

Thanks.
0 Kudos
6 Replies
mecej4
Honored Contributor III
1,029 Views
The Intel Fortran User Guide has a whole chapter, Building Applications, which contains sections on building libraries.

In a nutshell, you give the Fortran compiler the /c option to stop it from calling the linker. Then, you use the librarian to build the static library:

C:\> lib.exe /out:mylib.lib *.obj

0 Kudos
Steven_L_Intel1
Employee
1,029 Views
Or in Visual Studio, create a Fortran Static Library project.
0 Kudos
rasa
Beginner
1,029 Views
Thanks for the quick response.

Does one need build separate libraries for 32-bit and 64-bit environments?
0 Kudos
Steven_L_Intel1
Employee
1,029 Views
Yes, one does.
0 Kudos
rasa
Beginner
1,029 Views
Sorry for bumping this one after a long time.

I had managed to create the library, add the library and path and then compile.

I am getting errors in the format of :
[bash]Error	17	 error LNK2019: unresolved external symbol _UTILS_mp_TIME_STAMP referenced in function _SMOD_mp_PROCESS_S.N	smod.obj	
[/bash]

I had enabled /Qopenmp on both. Is there something else I should watch out for? Should the compile options match exactly between the library and the project?

Thanks.
0 Kudos
Steven_L_Intel1
Employee
1,029 Views
These routines are in your code, and it has nothing to do with /Qopenmp. You need to make sure that you link against the object or library created when module UTILS was compiled.
0 Kudos
Reply