- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Our Windows 7 64-bit application was built with Intel Composer XE 2013 Update 1 (package 119) using the command
ifort /dll /real-size:128 /double-size:128 application.f dlsode.f
We are upgrading to Windows 10 and Intel Visual Fortran Intel 64 Compiler 19.1.3.311 Build 20201010_000000 and want to compile dlsode.f with a lower optimization level /O1. Using the commands
ifort /c /O1 /real-size:128 /double-size:128 dlsode.f
ifort /dll /real-size:128 /double-size:128 application.f dlsode.obj
I get the link error
LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
According to previous posts in this forum regarding LNK4098, dlsode.obj and application.obj are using different run-time libraries. When I replaced the first ifort command with
ifort /c /O1 /libs:dll /real-size:128 /double-size:128 dlsode.f
the dll seemed to build correctly and executed correctly. Was this the correct solution? What is the correct solution using the /NODEFAULTLIB option?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, using /libs:dll consistently was the correct choice. /NODEFAULTLIB is almost always the wrong choice (despite the claim in the error message.)
What you have is what DEC (now Intel) developer Lorri Menard called "MCLS" or "Mixed C Library Syndrome". Her original Visual Fortran Newsletter article on the topic is no longer around, but the concept remains. Unlike the Intel Fortran support libraries, the Microsoft Visual C/C++ libraries don't like being mixed, with debug and non-debug versions combined, or similarly static and DLL. The reason is that the MSVC compiler generates different code depending on which library type you specify. Since the Fortran support library is written in C, that issue carries over to Fortran builds. (Intel Fortran doesn't generate different code for these cases.)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, using /libs:dll consistently was the correct choice. /NODEFAULTLIB is almost always the wrong choice (despite the claim in the error message.)
What you have is what DEC (now Intel) developer Lorri Menard called "MCLS" or "Mixed C Library Syndrome". Her original Visual Fortran Newsletter article on the topic is no longer around, but the concept remains. Unlike the Intel Fortran support libraries, the Microsoft Visual C/C++ libraries don't like being mixed, with debug and non-debug versions combined, or similarly static and DLL. The reason is that the MSVC compiler generates different code depending on which library type you specify. Since the Fortran support library is written in C, that issue carries over to Fortran builds. (Intel Fortran doesn't generate different code for these cases.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Thank you very much for your prompt and thorough reply.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page