Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Problems with oop, type-bound procedures

Robert_van_Amerongen
New Contributor III
1,889 Views
Hi,

my first attempt (as a Intel Visual Fortran newbe) what to convert some existing F95 software into F2003 software by usingobject oriented stuff. An existing program with many subroutines; a few of them uses a type including two type-bound procedures. The module with this type is "used" two times.If I do a call to one of these procedures the linker complanes:

bereken.obj : error LNK2005: DYNTYPE_PACK_0.0.1 already defined in lees_takken.obj

bereken.obj : error LNK2005: TBPLIST_PACK_0.0.1 already defined in lees_takken.obj

nr.exe : fatal error LNK1169: one or more multiply defined symbols found

The module that is related to the error is "branchmod", and is "used" both in "lees_takken" and "bereken". If I replace the call to this tbp in "bereken" by a call to a regular procedure, everything went fine.

The full compiler output (with some editting) that was produced is as follows:

(Start:)"

C:\\Documents and Settings\\van amerongen\\if03\\reijer>ifort /free /extfor:f03

/warn:all

/module:"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\module"

nr.f03 nodesmod.f03 brancmod.f03 tran3mod.f03 admitmod.f03 nrjacmod.f03

fdjacmod.f03 lees_busses.f03 lees_takken.f03 maak_admi.f03 bereken.f03

"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\module\\module.lib"

"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\subrou\\netwerk\\netwerk.lib"

"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\subrou\\sparsmat\\sparsmat.lib"

/link /stack:64000000

Intel Visual Fortran Compiler Professional for applications running on IA-32,

Version 11.1 Build 20090511 Package ID: w_cprof_p_11.1.035

Copyright (C) 1985-2009 Intel Corporation. All rights reserved.

Microsoft Incremental Linker Version 9.00.21022.08

Copyright (C) Microsoft Corporation. All rights reserved.

-out:nr.exe

-subsystem:console

/stack:64000000

nr.obj

nodesmod.obj

brancmod.obj

tran3mod.obj

admitmod.obj

nrjacmod.obj

fdjacmod.obj

lees_busses.obj

lees_takken.obj

maak_admi.obj

bereken.obj

"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\module\\module.lib"

"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\subrou\\netwerk\\netwerk.lib"

"c:\\documents and settings\\van amerongen\\mijn documenten\\evs\\f03\\subrou\\sparsmat\\sparsmat.lib"

bereken.obj : error LNK2005: DYNTYPE_PACK_0.0.1 already defined in lees_takken.obj

bereken.obj : error LNK2005: TBPLIST_PACK_0.0.1 already defined in lees_takken.obj

nr.exe : fatal error LNK1169: one or more multiply defined symbols found

C:\\Documents and Settings\\van amerongen\\if03\\reijer>

"(end)

What is going on here? What do I have to do to use tbp problem-less?

Thanks for any help

Robert

0 Kudos
17 Replies
Steven_L_Intel1
Employee
1,889 Views
Please try a current compiler - the problem you describe sounds like one that was fixed in a more recent update. The current update is Update 6 (11.1.065).
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
Dear Steve,

thank you for your quick response. I am afraid,however, that at present I am more far from a solution. I removed the 11.1.035 version including the VS2008 shell. And I downloaded and installed the 11.1.065 version including the VS2008 Shell. Running the compiler from the commandline starts with the message:

"C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32.bat" (English translation from Dutch:) the file cannot be recognized as either an internal or external command, a program or a batch bestand."

If I continu and start the ifort compiler program, then the compilation seems to be correct, but the linkerfails with the message;

"ifort: error #10037: could not find 'link' "

What do I have to do to get the train back on its rail?

Robert
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
Uninstall and reinstall. Let me know if that doesn't help.
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
I did uninstall and reinstall. But the situation remains the same. What next step can I take? Is the VS2008 verion 9.0 different from the one on the original CD with the Intel 11.1.035? Is it a good idea to uninstall everyting, return to the CD and install both VS2008 and Intel 11.1.035 from that CD, uninstall the intel 035only and try a download form the compiler 065?

Robert
0 Kudos
mecej4
Honored Contributor III
1,889 Views
The linker, librarian, etc., are installed in the Visual Studio directory tree. The Fortran compiler calls the batch file vsvars32.bat in order to set up the paths for those tools in the environment (%PATH%, %INCLUDE%, %LIB%, etc.).

The error message shows that the Fortran startup batch files (ifortvars.bat, ifortvars32.bat) did not know where to find the Visual Studio files.

Can you locate the directory where Visual Studio is installed? Can you locate LINK.EXE inside that directory?
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
I think I am confused by what you are trying to do. 11.1 supports VS2008. 9.0 does not. Are you trying to use 9.0 with the VS2008 Shell? That won't work.
0 Kudos
mecej4
Honored Contributor III
1,889 Views
Steve, the only 9-s in Robert's posts refer to the VS directory, not the Intel Fortran Compiler. He has tried different minor releases of Intel Fortran 11.1, with VS2008, if I am not mistaken.
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
Oh, I see where I got confused.

Uninstall Intel Visual Fortran. Uninstall Microsoft Visual Studio 2008 Shell. Uninstall "Microsoft Tools and Libraries for Intel Visual Fortran", if present. Then install w_cprof_p_11.1.065.exe (not the _novsshell version).
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
Steve,

there is a "Microsoft Tools and Libraries for Intel Visual Fortran" on my machine, but it refuses to be uninstalled. The uninstall program asks for a folder with a "shell.msi" file but there is no such a file. Any idea how Ican take this hurdle?

Robert
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
Download and install the Windows Installer Cleanup Utility and have it remove the item.
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
Dear Steve,

I did not use your cleanup utility, it pointed towards problems with any Office package. The website of Microsoft is unclear how to handle problems like the one I did encounter. I found, however, a solution by reinstalling the additional tools BEFORE removing the VS2008Shell. After that, I installed the Compiler and VS2008 from the 11.1.065 file. So now the compiler, the VS2008 Shell and the Microsoft Tools and Libraries etc. are from the same executable.

Unfortunately, the problems as found earlier (see June 28, 2010; 3:09 PM) remains the same. So we did not come any further.

Just to remember: when I started with Intel I installed the Shell and the compiler from the DVD. Everything was fine then, with both VS2008 and command-line usage. After that I downloaded Platform SDK for Windows 7 and since that time the VS2008 shell signals that it cannot find the compiler installed. I started a separate thread on this subject. Later, the problems with OOP did show up, reason to start this thread.

In the mean time I did remove the SDK and have the 11.1.065 version installed. Nevertheless there seems something disturbing us. The use of the compiler on the commandline is correct afa the compile phase is concerned, but fails during linking. In VS2008 the message on "not installed" persists.
For your information: I am running Window XP SP

What next action do you suggest?

Robert
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
The problem is that the set of folders VS uses for "Executable files" contains this line:

$(WindowsSdkDir)bin

This is how it finds the linker. When you installed the separate SDK, this overwrote the original setting of this location, which is stored in the registry. Reinstalling VS Shell might fix it, but the simpler soluttion I think is to find the directory containing link.exe, which is probably C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN, and add it to the list in Tools > Options > Intel Visual Fortran > Compilers > Executable Files. You may also need to make a related change under Library Files, locating the folder containing kernel32.lib and adding it to the Library Files list.

Please note that I will be out of the office for a week starting tomorrow, so won't be able to respond further here until next Friday. You can contact Intel Premier Support if you don't get the help you need here.
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
Steve,

in addition to the above: there are more components installed om my machine during the VS2008/Intel install. Searching I found:

- the NetFramework 3.5 SP1
- Microsoft Visual Studio Web Authoring Component
- more that one (!!) C++ compiler.

Is it possible that we found here a trouble maker?

Robert
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
No - I think it was simply installing the Windows SDK. I'm not entirely sure why that should be the case, since the SDK should provide the same components. Perhaps it did not "register" itself correctly.
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
After a short break I returned to the problem. The suggestion to add the folders for both executables and libraries failed; the VS has lost the pathes when VS is closed and restarted. The "vsvars32.bat" file is still not present, despite removing and reinstalling the Intel compiler and the VS shell.In whatever situation, the VS shell still refuses to recognise the Intel compiler or find a path to it. Nothing changed thus.

For the command line usage things are a bit different. The missing "vsvars32.bat" file is by-passed by adding the executable folder to the path in the environment variables. The libs are found by explicitely add these, including the full path, in a .bat-file that is used to compile and the link the programs. (I don't know another way tolet the linker search for the libs.)So that at least gives a workable situation with the 11.1.065 version. And I am glad that the type-bound procedure troubles with which this thead started has disappeared.

It is clear that there must something be done to get the situation as it is meant to work. What more can I do?

Thanks for your help,
Robert
0 Kudos
Steven_L_Intel1
Employee
1,889 Views
If you have VS Shell, there is no vsvars32.bat nor is such a file referenced. if the changes you make under Tools > Options > Intel Fortran disappear when you restart Visual Studio, there is a more serious problem there.
0 Kudos
Robert_van_Amerongen
New Contributor III
1,889 Views
It seems that there is a problem! About the vsvars32.bat: see the previous contributions to this thread. I will make a break with this and I will continu if either a new os is installed or the machine is completely replaced. I do not want to take action to the registry! For the mean time the situation is not the ideal one, but it is workable.
0 Kudos
Reply