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

Library and MOD FIles

JohnNichols
Valued Contributor III
826 Views
Steve:

I very rarely use other people's library's except those built in.

If I get a library and the associated .MOD files, can I put them in the correct IVF Compiler lib and include directories and then just use a "use etc" call in the program.

The developer suggests I add the library to the source code but I prefer to be able to access it from any future program, without having to copy source files.

Thanks

Simple question but just want to be sure.

JMN

0 Kudos
4 Replies
Steven_L_Intel1
Employee
826 Views
The .mod just needs to be in an include directory the compiler is searching. The .lib needs to be added somehow to the list of libraries the linker uses. An easy way is to add the .lib as if it were a source file, or you can name it under "Additional dependencies" in the Linker property page.
0 Kudos
JohnNichols
Valued Contributor III
826 Views
Steve:

The developer suggested your method, but you have to copy the files over with each new project, easier to make it accessible.

I got it working.

JMN
0 Kudos
Steven_L_Intel1
Employee
826 Views
No, you don't have to copy the files. All you are doing is making a reference to the file in the project. VS doesn't care where the file actually resides.
0 Kudos
joerg_kuthe
Novice
826 Views

You may also add the paths of the .mod and .lib files "globally". Siimply add the path specs to the compiler options:
In the menu go to
Tools
Options
In the Options dialog go to
Intel Visual Fortran
Compiler
Then add the .mod file's path to the Includes.
and the .lib file's path to the Libraries.

The advantage is that you don't have to add these paths to any project that you create then.

However you still will have to reference the .libs explicitely in your projects.

Hope this helps.

Joerg Kuthe
www.qtsoftware.com

0 Kudos
Reply