Compilation with x64 platform - Internal error

Compilation with x64 platform - Internal error

hello,I am trying to compile a big program with a lot of .f and .f90 files using x64 platform, the compilation stops with Code 1 to one of the .f programs giving me the error message of Internal Error. but when I tried this with Win32 platform there is no error. please give me any advice.Also when I tried to build the whole solution with win32 platform, the compiler stops after compilation giving the next message :Error 13 fatal error LNK1104: cannot open file 'LIBC.lib' LINK Error 13 fatal error LNK1104: cannot open file 'LIBC.lib' LINKThis project was built in the past and works with CVF, and I convert the make file in IVF and I add common files (.inc), also it uses Array Visualizer and I add some includes and libraries according the release notes. I am sorry I am trying to give you a picture as I can not send you the whole project as it is an academic work in progress.Thank you in advance.Matthaios

AttachmentSize
Downloadapplication/octet-stream mpp.f51.18 KB
8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Please read this recent thread on a similar problem.

Thank you for the reccomendation I can not understand unfortunately the options /MD ,/MT for the compiler, really I do not know where are these options, please give me an advice.I have the 2 of these 3 libraries files, libc.lib and libcmt.lib , I set some paths and now I receive this messages1>Linking...1>LIBC.lib(crt0dat.obj) : error LNK2005: __cinit already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: _exit already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __exit already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __cexit already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __C_Exit_Done already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __C_Termination_Done already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __exitflag already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __wpgmptr already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __pgmptr already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: ___winitenv already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __wenviron already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: ___initenv already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __environ already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: ___wargv already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: ___argv already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: ___argc already defined in LIBCMT.lib(crt0dat.obj)1>LIBC.lib(crt0dat.obj) : error LNK2005: __umaskval already defined in LIBCMT.lib(crt0dat.obj)1>LINK : fatal error LNK1104: cannot open file 'dfor.lib'Nevertheless you anwser me only to one part of my question, please check my problem with the attached file to my #1 post where I face an INTERNAL ERROR compiling in x64 platform instead of Win32 platform.thank you in advance.

Best Reply

First, I tried to compile your mpp.f file, and it is missing too many files to compile. That is, there are several "include" files missing, as well as missing mod files.

If you get an internal error, that is always a compiler issue, although sometimes we can give some information about a workaround.

However, you don't say what version of the compiler you are using, or what command line options you are using to compile the program, so it's hard to know where to begin to give you advice.

If you cannot share the code because it is under development, you will have to try and remove code from your program yourself until you can find out what set of statements are causing problems with the compiler.
If you have a small standalone program, we might be able to help you resolve the problem.

Next, your link messages show two problems.
One problem is that you are trying to link against dfor.lib. That is a CVF library. Either you have it explicitly listed in your Project->Properties->Linker->input property, or you are linking against an object file that was created by CVF and has not yet been recompiled with Intel Fortran. You cannot mix the object files, if you are going to link against object files they *must* all have been recompiled with Intel Fortran. And, you cannot link an Intel Fortran object against dfor.lib, that will not work.

The other question was about the C-libraries, and the /MD vs /MT switches described in the other thread.
A little background; Visual C/C++ provides its runtime libraries in different "flavors" such as single-threaded (libc or /ML) multi-threaded (libcmt or /MT) and DLL (msvcrt or /MD). All of these libraries have the same entry points, the difference is whether they are thread-safe (libc vs libcmt)or whether the library is linked in as a DLL (msvcrt). So, your error messages are coming out because you are linking against *both* the single threaded (libc) and multi-threaded (libcmt) libraries; you see a conflict because the entry points are named the same in both libraries.
To resolve that, go to Project->Properties->Fortran->Libraries and fix the "Runtime library" field. If you have a mixed Fortran/C program, make sure that the Fortran libraries match the C/C++ libraries (found at Project->Properties->C/C++->Code Generation)

-- Lorri

Mr Lorri, many thanks for your explanations I have tried a lot of things, inside my project I have a library
f2kcli.lib, which I opened with a notepad and I found inside defaultlib: dfor.lib
That's why I tried to find the source code f2kcli.f90 in the internet, when I removed this lib file and turn it into the module f2kcli.f90,firtsly the internal error from the compiler inside the mpp.f file disappears ... I get compiled all the project BUT I got 1300 errors while linking inside the .obj files of my project.Then I found some precompiled libraries f2kcli.lib and f2kcli.mod files compiled for Win64 and intelVF8.0 (I am using IVF 2011 update 8 )and I used them instead of the older ones, and the result is to take again the same error that it that it cannot open library "LIBC.LIB"I have some other questions in the field of convertion from CVF to IVF (where I get all this problems) but I will open another thread.many thanks again for your really helpful reccomendations

You can remove f2kcli. Its functionality has been included in ifort for several years. It did support early ifort, as it did CVF, with a reconfigure.
Maybe you should address her as Ms. Lorri.

I am not sure If this is possible as there is inside the code (one of the .f90 files) the command "Use f2kcli" and of course inside there are some calls of "GET_COMMAND" and "GET_COMMAND_ARGUMENT" subroutines. I tried to to remove (f2kcli.lib and f2kcli.f90) but I faced linking problems with the include paths.

PS Mrs Lorri I am sorry for "Mr"

You can use an empty module f2kcli, and the routines GET_COMMAND and GET_COMMAND_ARGUMENTS are intrinsic routines, so the compiler will use these instead of user-defined routines by the same name.

That way, you will have very little to change in the code itself.

Regards,

Arjen

Leave a Comment

Please sign in to add a comment. Not a member? Join today