- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a project I coded myself in VS 2019 Intel 2023. It works fine in Debug config, with Run time libraries /libs:static and Intel Math Kernel /qmkl:sequential. The results are correct!!! BUT when I build it w/Release config, I get "Link warning link 4098:Default lib can conflict with other lib use /NODEFAULTLIBS library" and the results are wrong!!! When I add /NODEFAULTLIBS to the link directive, I get 46 unresolved LNK 2019 errors. I recognize a few MKL that I used, the rest are unrecognizable to me. The compiler recognizes a conflict, but it does not highlight it. How do I find the one that creates the conflict???
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The compiler isn't involved here - it's the linker. I generally find this particular diagnostic unhelpful in its suggestion to use /nodefaultlibs. Usually, this problem occurs when you have a mix of DLL and static libraries being linked in. Did you check to see that your selection of static libraries was carried over into the release configuration?
Asking for a link map and reading the map file can also help identify the issue. It happens when a symbol has been found in one library but a reference to an object in another library also defines that same symbol.
I'll also comment that your paraphrasing and excerpting the diagnostics interferes with people trying to help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the /libs:static is present in both Debug and Release configurations, as shown below.
I can get both Debug and release to link w/o warnings and to calculate the correct results only if I add /libdir:noauto and run inside VS, but adding /libdir:noauto overwrites the libs:/static (I know that because the .exe in both Debug and Release folders do not run, because it is missing mkl_sequential.2.dll).
If I remove /libdir:noauto (change it to NO) the results are incorrect because the eigenvalues, which are calculated by MKL, are incorrect "Eigenvalue 1 is numerically infinite or undetermined".
I just updated to oneAPI 2025. The problem persists.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
True - /libdir:noauto overrides both /libs and /Qmkl. But I see you have specified Debug Multithreaded for the Release configuration, which may conflict with the C code in some of the libraries. Try changing to the non-debug version.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In Release config. I tried 4 options of Runtime Library:
--Multithreaded
--Multithread (/libs:dll ...
--Debug Multithread (/libs:static ...
--QuickWin /libs:qwin
with...
/Qmkl:sequential (to use mkl for the calculation of the eigenvalues)
and
/libdir:noauto (which is my attempt to produce a static .exe that includes all the necesary libraries)... my code calculates correctly inside VS, but the .exe does not run standalone, displaying this:
libifcoremdd.dll was not found
mkl_sequential.2.dll was not found
libmmdd.dll was not found
With Runtime libraries:
--Debug Multithread (/libs:static ...
--/Qmkl:sequential
and
Disable Default Library Search Rules: NO (instead if /libdir:noauto) ...
...I get warning LNK4098, & the results are incorrect. Incorrect results are computed by MKL. I am sure because in the code, I put a write() statement to print MKL errors if any, and that is what I get, the MKL cannot compute the eigenvalues, and thus the results are incorrect.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you use /libdir:noauto you must specify all of the libraries to be used (or rely on some object not compiled that way to pull them in.) Clearly you're getting references to DLL libraries.
I suggest you take this to the MKL forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, I'll open a post on the MKL forum, but let me share this with you.
The code has worked since 2010 with minor modifications over time, until recently I changed a few arrays from fixed dimensions, such as
integer parameter n=8;
double precision variable(n,3)
to
allocatable variable(:,:)
read(1,*) n
allocate(variable(n,3))
Now, I reverted to the original version, and everything works. The static *.exe produces correct results!!!
Apparently, using allocatable() is the cause of the problems.
Both Debug and Release work well, with configuration:
Runtime library: Debug Multithreaded (/libs:static /threads /dbglibs)
Use MKL: Sequential (/Qmkl:sequential)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page