Ticket #636 (closed bug: wontfix)

Opened 5 months ago

Last modified 4 months ago

MPICH2 and .NET issues

Reported by: "T. Farago" <farago1@…> Owned by: jayesh
Priority: major Milestone: mpich2-1.1.1
Component: mpich2 Keywords:
Cc:

Description

My project is built with the "multi-threaded DLL" runtime library
using MSVC 2008.

For MPI I include <mpi.h> and its two library files cxx.lib and
mpi.lib. Simply compiling and linking the project results in the
following error(s):

Linking...
LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
(?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall
std::exception::exception(class std::exception const &)"
(??0exception@std@@QAE@ABV01@@Z) already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: virtual char const
* __thiscall std::exception::what(void)const "
(?what@exception@std@@UBEPBDXZ) already defined in
MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(typinfo.obj) : error LNK2005: "public: void __thiscall
type_info::_type_info_dtor_internal_method(void)"
(?_type_info_dtor_internal_method@type_info@@QAEXXZ) already defined
in MSVCRT.lib(MSVCR90.dll)
LIBCMT.lib(typinfo.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
(??0type_info@@AAE@ABV0@@Z) already defined in MSVCRT.lib(ti_inst.obj)
LIBCMT.lib(typinfo.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator=(class type_info const &)"
(??4type_info@@AAEAAV0@ABV0@@Z) already defined in
MSVCRT.lib(ti_inst.obj)
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of
other libs; use /NODEFAULTLIB:library
I:\trunk\bin\Release\graph.exe : fatal error LNK1169: one or more
multiply defined symbols found


So I ignore "libcmt.lib" and get the following warning(s):

graph.obj : warning LNK4248: unresolved typeref token (01000066) for
'ADIOI_FileD'; image may not run
cxx.lib(initcxx1.obj) : warning LNK4099: PDB 'vc80.pdb' was not found
with 'C:\MPICH2\lib\cxx.lib' or at 'i:\trunk\bin\Release\vc80.pdb';
linking object as if no debug info

The program crashes at startup during initialisation saying something
about "unhandled exception of type System.TypeInitializationException
in Unknown Module"

How can this be solved?
Best regards,
T. Farago

Attachments

part0001.html (4.6 KB) - added by Jayesh Krishna 5 months ago.
Added by email2trac
part0001.2.html (0.8 KB) - added by Jayesh Krishna 5 months ago.
Added by email2trac
part0001.3.html (2.0 KB) - added by Jayesh Krishna 5 months ago.
Added by email2trac
part0001.4.html (1.0 KB) - added by T. Farago 5 months ago.
Added by email2trac

Change History

Changed 5 months ago by T. Farago

  • id set to 636

This message has 0 attachment(s)

Changed 5 months ago by Jayesh Krishna

Added by email2trac

Changed 5 months ago by Jayesh Krishna

 Hi,
  Can you try compiling your code with the multithreaded static runtime
lib (/MT)? Also if you don't need the C++ MPI interfaces you can remove
cxx.lib from the list of dependencies.

Regards,
Jayesh

-----Original Message-----
From: mpich2-bugs-bounces@mcs.anl.gov
[mailto:mpich2-bugs-bounces@mcs.anl.gov] On Behalf Of mpich2
Sent: Thursday, June 04, 2009 6:42 AM
To: undisclosed-recipients:
Subject: [mpich2-maint] #636: MPICH2 and .NET issues

---------------------------------------------+--------------------------
---------------------------------------------+----
 Reporter:  "T. Farago" <farago1@zonnet.nl>  |        Type:  bug
   Status:  new                              |    Priority:  major
Milestone:                                   |   Component:  mpich2
---------------------------------------------+--------------------------
---------------------------------------------+----


 {{{

 My project is built with the "multi-threaded DLL" runtime library  using
MSVC 2008.

 For MPI I include <mpi.h> and its two library files cxx.lib and  mpi.lib.
Simply compiling and linking the project results in the  following
error(s):

 Linking...
 LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)"
 (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR90.dll)
 LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall
std::exception::exception(class std::exception const &)"
 (??0exception@std@@QAE@ABV01@@Z) already defined in
 MSVCRT.lib(MSVCR90.dll)
 LIBCMT.lib(stdexcpt.obj) : error LNK2005: "public: virtual char const
 * __thiscall std::exception::what(void)const "
 (?what@exception@std@@UBEPBDXZ) already defined in
 MSVCRT.lib(MSVCR90.dll)
 LIBCMT.lib(typinfo.obj) : error LNK2005: "public: void __thiscall
type_info::_type_info_dtor_internal_method(void)"
 (?_type_info_dtor_internal_method@type_info@@QAEXXZ) already defined  in
MSVCRT.lib(MSVCR90.dll)
 LIBCMT.lib(typinfo.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
 (??0type_info@@AAE@ABV0@@Z) already defined in MSVCRT.lib(ti_inst.obj)
 LIBCMT.lib(typinfo.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator=(class type_info const &)"
 (??4type_info@@AAEAAV0@ABV0@@Z) already defined in
 MSVCRT.lib(ti_inst.obj)
 LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of  other
libs; use /NODEFAULTLIB:library  I:\trunk\bin\Release\graph.exe : fatal
error LNK1169: one or more  multiply defined symbols found


 So I ignore "libcmt.lib" and get the following warning(s):

 graph.obj : warning LNK4248: unresolved typeref token (01000066) for
'ADIOI_FileD'; image may not run
 cxx.lib(initcxx1.obj) : warning LNK4099: PDB 'vc80.pdb' was not found
with 'C:\MPICH2\lib\cxx.lib' or at 'i:\trunk\bin\Release\vc80.pdb';
linking object as if no debug info

 The program crashes at startup during initialisation saying something
about "unhandled exception of type System.TypeInitializationException
 in Unknown Module"

 How can this be solved?
 Best regards,
 T. Farago
 }}}


--
Ticket URL: <https://trac.mcs.anl.gov/projects/mpich2/ticket/636>

Changed 5 months ago by Jayesh Krishna

Added by email2trac

Changed 5 months ago by Jayesh Krishna

Hi,
 Can you send us a sample code that does not work for you ?

Regards,
Jayesh

Changed 5 months ago by Jayesh Krishna

Added by email2trac

Changed 5 months ago by Jayesh Krishna

Hi,
 I wanted to have a sample code that you could not compile with "static
multithreaded runtime lib (/MT)" .

Regards,
Jayesh

  _____

From: fafarago@gmail.com [mailto:fafarago@gmail.com] On Behalf Of T.
Farago
Sent: Saturday, June 06, 2009 1:24 PM
To: Jayesh Krishna
Subject: Re: [mpich2-maint] #636: MPICH2 and .NET issues



2009/6/5 Jayesh Krishna <jayesh@mcs.anl.gov>


Hi,
 Can you send us a sample code that does not work for you ?


Hi Jayesh,

See my previous mail. But I've attached the source code. Use visual studio
and compile with /clr (.NET runtime) and /MD (dynamic runtime libraries).

Best regards, Tamas

Changed 5 months ago by T. Farago

Added by email2trac

Changed 5 months ago by T. Farago

2009/6/8 mpich2 <mpich2-maint@mcs.anl.gov>

> Hi,
>  I wanted to have a sample code that you could not compile with "static
>  multithreaded runtime lib (/MT)" .
>
>  Regards,
>  Jayesh
>

Hi,

As I said before: "Unfortunately .NET (/clr) and multithreaded static lib
(/MT) are incompatible, you cannot even compile the project."

Visual Studio says: "Command line error D8016: '/MT' and '/clr' command-line
options are incompatible". So the only way to compile a .NET project is to
use the _dynamic_ runtime libraries. MPI works just fine with the static
runtime libraries, but my issues were with MPI in combination with .NET.

Best regards, Tamas

Changed 4 months ago by thakur

  • owner set to jayesh
  • milestone set to mpich2-1.1.1

Changed 4 months ago by jayesh

  • status changed from new to closed
  • resolution set to wontfix

Hi,

Sorry for the delayed response. Since MPICH2 is compiled with VS static runtime lib you will have conflicts when compiling your .NET code. I would suggest you taking a look at MPI.NET by Indiana university folks (http://www.osl.iu.edu/research/mpi.net/). You will need MSMPI (Microsoft's MPI) to compile your code though (We haven't tested whether the lib works with MPICH2). Hope it helps.

Regards, Jayesh

WARNING! You need to either login using OpenID here or enter your email address here before you can create or edit tickets. Otherwise the ticket will get treated as spam. More information on creating tickets can be found here.

Don't forget to add your email address to the cc list to make sure that you get updated of the ticket status.

Add/Change #636 (MPICH2 and .NET issues)

Author



Change Properties
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.