- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I have run into a strange problem with linking against a library (in this case: LAPACK). This came up
in exploring a problem with a large program, but I have been able to reproduce it with a trivial one.
The issue is this:
- I have built LAPACK, version 3.2.2, from sources, using the CMake build system that comes with the
source distribution. The only option I set for this build is the build type, Release, rather than Debug,
because the debug version gave the error message that MSVCRTD.DLL could not be found.
- I link the program below with the two resulting libraries using the command-line tools.
- The result is a runtime error R6034.
Here is the program:
I have run into a strange problem with linking against a library (in this case: LAPACK). This came up
in exploring a problem with a large program, but I have been able to reproduce it with a trivial one.
The issue is this:
- I have built LAPACK, version 3.2.2, from sources, using the CMake build system that comes with the
source distribution. The only option I set for this build is the build type, Release, rather than Debug,
because the debug version gave the error message that MSVCRTD.DLL could not be found.
- I link the program below with the two resulting libraries using the command-line tools.
- The result is a runtime error R6034.
Here is the program:
! chklink.f90 --
! Check a problem with linking against LAPACK
!
program chklink
double precision value
value = dlamch( 'e' )
write(*,*) value
end
I compiled and linked with this statement:
ifort chklink.f lapack.lib blas.lib
This gave the following warning:
LINK: warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
But when I run the program I get two message boxes, with the following text:
R6034
An application has made an attempt to load the C rntime library incorrectly.
Please contact the application's support team for more information.
The application failed to initialize properly (0xc0000142). Click on OK to terminate the application.
How can I solve this?
Regards,
Arjen
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try building lapack and blas with /libdir:noauto (Disable Default Library Search Rules), which I always recommend for building static libraries.
Why don't you use lapack from MKL, by the way?
Why don't you use lapack from MKL, by the way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Because I wanted to reproduce a numerical problem that a friend of mine reported. His colleague built the whole program (including LAPACK) from sources and found strange numerical results. When I was finally
able to build and run the program myself, the results were quite in agreement with the expectations, so there is still a riddle.
But in doing so, I stumbled on this one. And another - see my other thread.
Regards,
Arjen
able to build and run the program myself, the results were quite in agreement with the expectations, so there is still a riddle.
But in doing so, I stumbled on this one. And another - see my other thread.
Regards,
Arjen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Forget that other thread - that was shear stupidity/programmer's blindness/...
I invoked the compiler with the right commands (after editing the source file and removing the text that
led to the bizarrely seeming, but completely correct error messages):
ifort chklink.f lapack.lib blas.lib /link /nodefaultlib:msvcrt.lib
and then it worked without any problem.
Regards,
Arjen
I invoked the compiler with the right commands (after editing the source file and removing the text that
led to the bizarrely seeming, but completely correct error messages):
ifort chklink.f lapack.lib blas.lib /link /nodefaultlib:msvcrt.lib
and then it worked without any problem.
Regards,
Arjen

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page