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

How to create my own Fortran library for Intel Fortran Compiler?

royxu
Beginner
696 Views
Hello,
I have some Fortran source codes and want to build one library for them. In CVF, I have a library which can let me call the subroutines in this library. However when I use Intel Fortran Compiler, the old library for CVF doesn't work. I have to make a new library for all these source codes then I can still call those subroutines.
So my question is how to make our own Fortran library in the Intel Fortran Compiler.

Thanks!

Roy
0 Kudos
3 Replies
Steven_L_Intel1
Employee
696 Views
Same way you did in CVF. Either create a Fortran Static Library project including the sources you want, or use the LIB command from the command line to create the library.
0 Kudos
royxu
Beginner
696 Views
Thanks, Steve! I did creat my nagfl.lib library file and many other object files. I added the path of nagfl.lib into Tool->Option->Intel Fortran->Library. Now I want to run my Fortran programs but got the following error message:

1>------ Build started: Project: simu1031, Configuration: Debug Win32 ------
1>Linking...
1>Fatal error cannot open "dfor.lib"
1>Link: error: problem during multi-file optimization compilation (code 1)
1>Link: error: problem during multi-file optimization compilation (code 1)
1>
1>Build log written to "file://C:Documents and SettingsAll UsersDocumentsSample Sizesimu1031DebugBuildLog.htm"
1>simu1031 build failed.
1>
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Then I remove the path of nagfl.lib from
Tool->Option->Intel Fortran->Library, I still got the same error message. It seems to me the program doesn't really need the link to the new library. What does it mean "cannot open dfor.lib"?

Any suggestion?

Thanks!

Roy
0 Kudos
Steven_L_Intel1
Employee
696 Views
The message about dfor.lib means that one or more of the object or library files you are using was built with Compaq Visual Fortran. You must recompile all Fortran sources with the Intel compiler - and that may mean getting a new version of the NAG library that is built for use with Intel Fortran.

Try doing a "Rebuild" of the project to see if that solves the dfor.lib issue. If not, look at any object or library files that are not rebuilt from source and get new versions built with Intel Fortran.
0 Kudos
Reply