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

Is there a convenient way to include *.lib and *.mod files into a project?

OP1
New Contributor III
388 Views
Assume that I have a solution MY_SOL which contains a projectMY_PROG (a console application) and another project MY_LIB (a static library). MY_LIB is set as aproject dependency for MY_PROG.

MY_PROG needs MY_LIB.lib and MY_LIB.mod. Up to now I have always configuredthis manually (by explicitly settingConfiguration properties/Fortran/General/Additional Include Directories,Configuration Properties/Linker/Additional Include Directories, and Configuration Properties/Linker/Input/Additional Dependencies).
This is tedious at best when you have many, manyprojects/libraries in your solution. Setting MY_LIB as a dependency for MY_PROG will only tell the compiler to recompile/rebuild the library (if needed) when I compile or build MY_PROG, it seems it doesn't tell the compiler to look for the *.lib and *.mod files (in the respective DEBUG or RELEASE directories - depending on the type of configuration chosen for MY_PROG).

I have the feeling that this approach is not the most efficient. Is there another way to achieve this?

Thanks,

Olivier
0 Kudos
2 Replies
Steven_L_Intel1
Employee
388 Views
You don't need to do anything for the .LIB - that will be taken care of automatically. For now, you do need to add the additional include directories. I think, though, that this will become unnecessary as well in a future version.
0 Kudos
Arjen_Markus
Honored Contributor I
388 Views

You might consider a tool like autotools or CMake. Especially the latter, since you are using MS Visual Studio now. The idea with CMake is that it generates a complete solution with projects for you, while you specify the dependencies once and only once. You can still use Visual Studio for building and debugging, but the description of the structure of your program comes from CMakeList.txt files.

CMake lives at http://www.cmake.org

Whether this will be useful in your case, is a matter that only you can decide upon. CMake is available on various platforms and it configures your project using the compiler it can find or is instructed to use.

Regards,

Arjen

0 Kudos
Reply