- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi fellow members of the community,
When linking external libraries in intel fortran, is it possible to explicitly specify whether each library is static or dynamic?
My environment is,
x86_64 GNU/Linux
ifort version 2021.9.0
For example
ifort aaa.o bbb.o -O2
-I/opt/local/x86_64/apps/oneapi/2023/subapps/eccodes/lib64/include
-I/usr/include
-L/opt/local/x86_64/apps/oneapi/2023/lib
-L/usr/lib64
-o ... /out.exe
-lm -lmfhdf -ldf -ltirpc -lsz -ljasper -ljpeg -lz -lstdc++
In my environment, I have both of these libraries. (libdf.a, libmfhdf.a, libdf.so, libmfhdf.so)
However, I would like to use the static library because the shared library has a disable fortran interface.
Also, these libraries (libjasper.so, libjpeg.so) are only dynamic libraries.
On the other hand, these libraries (libz.a, libz.so) and others have both.
If I add the static option, an error occurs for the libraries that only have dynamic libraries, and I cannot compile them.
In the above situation, I want to link only these libraries (libdf.a, libmfhdf.a) with static libraries.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am happy to report that I have solved the problem.
If I add the -Bstatic option to the libraries (libdf.a, libmfhdf.a) that I want to be static libraries only, the compilation went through.
Thank you very much to everyone who looked at this question.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am happy to report that I have solved the problem.
If I add the -Bstatic option to the libraries (libdf.a, libmfhdf.a) that I want to be static libraries only, the compilation went through.
Thank you very much to everyone who looked at this question.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page