- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am quite new to fortran. I have a intel fortran 9.1 version on win32 XP OS. I had also installed MS Visual studio 2005 before installing fortran IA-32.
Its working fine in the case of simple fortran codes like finding out volume of sphere etc. I can execute them from Visual studio as well as command line in the build environment.
But when I try to execute a code (say file.f90) which has to run along with a set of object files in the same directory I get the error message......(Unlike the previous case I use nmake here).
Fatal error cannot open "LIBC"
ifort: error: problem during multi-file optimization compilation (code 1)
NMAKE : fatal error U1077: 'ifort' : return code '0x1'
Stop.
I am able to get file.obj. But I guess the problem arises when it tries to link file.obj and other object files. I have even tried to set ignore libc library in the linker(from previous posts). It doesnt work.
I have pasted makefile below..........
#
# Makefile for building ls971
# on 'Windows '
# for diuble precision SMPD
ls971: dyn21.obj
ifort -q -o ls971 dyn21.obj
libdyna.lib libansysdp.lib shell32.lib /F:10000000 -link -force -nodefaultlib:msvcrt.lib
dyn21.obj: dyn21.f
ifort -c -W0 -WB -unroll -Qfp_port -G7 -4Yportlib -Qfpp2 /assume:byterecl /fltconsistency
-DPCWIN -DINTEL -DOPENMP -Qopenmp -DAUTODOUBLE -4R8 -4I8 -QxK dyn21.f
I would really appreciate any help here. Thanks.
Madhav.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VS2005 does not provide libc.lib - this is explained in the Intel Fortran Compiler Release Notes. I would guess that the libraries you are linking to were built with an earlier version of Visual C++ so they reference libc.lib. For static libraries, only the multithread version (libcmt.lib) is available. The Fortran compiler will default to /MT when it has been installed specifying command-line compatibility with VS2005.
Unfortunately, it is generally not just a case of telling the linker to ignore libc, as with C/C++, the compiler generates different code for single and multithread code, or static and DLL.
You can try using /nodefaultlib:libc.lib, but you say it doesn't work. I'm not sure why that would be, perhaps you did not specify it in the right place.
I am always uncomfortable when I see /nodefaultliib and /force in a build script - they're usually covering up for mistakes made elsewhere.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
But I get a warning message
LINK : warning LNK4044: unrecognized option '/F:10000000'; ignored
libansysdp.lib(lm_new.obj) : warning LNK4217: locally defined symbol _time imported in function _l_buf_2
Can I ignore them? Or is there anything that should be done to supress them.
Madhav.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/F is an ifort switch. The equivalent linker switch is /stack. But /stack is meaningless when building a DLL - I'm not sure if that's what you're doing.
The linker warning 4217 can be ignored. It is saying that you have a DLLIMPORT for a symbol that is defined in the DLL. This is common when building Fortran DLLs and is harmless.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Madhav.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VS2005 does not provide libc.lib - this is explained in the Intel Fortran Compiler Release Notes. I would guess that the libraries you are linking to were built with an earlier version of Visual C++ so they reference libc.lib. For static libraries, only the multithread version (libcmt.lib) is available. The Fortran compiler will default to /MT when it has been installed specifying command-line compatibility with VS2005.
Unfortunately, it is generally not just a case of telling the linker to ignore libc, as with C/C++, the compiler generates different code for single and multithread code, or static and DLL.
You can try using /nodefaultlib:libc.lib, but you say it doesn't work. I'm not sure why that would be, perhaps you did not specify it in the right place.
I am always uncomfortable when I see /nodefaultliib and /force in a build script - they're usually covering up for mistakes made elsewhere.
I inserted it in the following statement; it is not working though. Is this the right usage of this switch?
ifort -q -o ls971 dyn21.obj libdyna.lib libansysdp.lib shell32.lib /F:10000000 -link -force -nondefaultlib:libc.lib -nodefaultlib:msvcrt.lib
Thank you in advance,
Aref
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As you are linking libansys, you should be paying for a license and support, so this is not the place for advice.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ifort -w -q -o ls971.exe dyn21.obj dyn21b.obj libdyna.lib libansys.lib shell32.lib -link -force -nodefaultlib:libc.lib -nodefaultlib:msvcrt.lib
Am I using this switch in the right place?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
However, I recommend getting a version of the libraries you're using that are compatible with VS2005 or VS2008.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

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