[Trilinos-Users] linking debug on Windows

Bartlett, Roscoe A rabartl at sandia.gov
Tue Jun 15 22:32:34 MDT 2010


Matthew,

My guess is that there are some inconsistent compiler options between the library build and your client project.  What is strange about this is that I think the function you are showing is actually an inline function and should not result in any object code that needs to be linked in.  My guess is that the libraries were built in release mode so that no object code was created for the inline function and then your client project is being built in debug mode that is expecting the inline function to not be inlined and is expecting to find the object code for this function in the library.  I am not sure how you would confirm this with the Windows IDE.  On Linux/Unix, I would just dump out the exact compile, archive, and link command lines and use nm and grep to find the link symbols to see what is going on.

Can you show the exact compiler options used to build the Trilinos libraries and your exact compiler options that are being used in your client project?  I don't know if you can export this type of info with an IDE but that is the info you need to track this down I suspect.

Cheers,

- Ross


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of Matthew Koch
> Sent: Tuesday, June 15, 2010 10:01 PM
> To: trilinos-users at software.sandia.gov
> Subject: Re: [Trilinos-Users] linking debug on Windows
> 
> The exact compiler error message is:
> 
> C:\trilinos-10.2.1-Source-serial-bin\include\Teuchos_RCPDecl.hpp(934):
> error: expected a type specifier
> 	void free( T* ptr ) { }
>   	     ^
> 
> On 6/15/2010 7:58 PM, David Cole wrote:
> > What's the exact compiler error message (copy / paste in a reply) ...
> ?
> >
> >
> > On Tue, Jun 15, 2010 at 8:49 PM, Matthew Koch <mkoch at txcorp.com
> > <mailto:mkoch at txcorp.com>> wrote:
> >
> >     On 6/15/2010 4:03 PM, Bartlett, Roscoe A wrote:
> >      > Matthew,
> >      >
> >      > We have no testing for a situation like this.
> >      >
> >      > Are you using shared libraries or static libraries?  Only
> limited
> >     Trilinos code is being tested with shared libraries and there is
> no
> >     testing for mixing MSVC++ and Intel on Windows.
> >
> >     We are using the static libraries.
> >      >
> >      > What does the compiler documentation say about this?  I tried
> to
> >     look online to see if this issue is addressed and I can't find
> anything.
> >
> >     My google queries have also been less than fruitful and the
> compiler
> >     documentation doesn't really
> >     elaborate on this error in particular.
> >      >
> >      > I am not sure what I would suggest.  We don't have the setup
> to
> >     experiment with this platform and mixing MSVC++ and Intel
> compiled
> >     code on Windows.  Can you experiment some with this?
> >
> >     I have done quite a bit of experimentation already.  As far as I
> can
> >     tell, this is less of a problem
> >     with mixing the compilers, and more a configuration issue.  I've
> >     reached that conclusion based on
> >     being able to compile the Teuchos code with the Intel compiler
> and
> >     still not being able to link it
> >     into the external project as I get the same errors in
> >     Teuchos_RCPDecl.hpp.  Thus, my guess is there
> >     is something missing in the external project's configuration
> (either
> >     compiler flags or preprocessor
> >     definitions) when building debug. But then again, I could be
> totally
> >     misinterpreting what's going on
> >     in the hpp file as I am not familiar with this code.
> >      >
> >      > If you can find a simple portable solution to this problem we
> >     might be able to incorporate the fix into the code base.
> >
> >     Of course, I will share a solution if I can find one, but at this
> >     point I'm pretty much at a total
> >     loss as to what to try next.
> >
> >     --Matt
> >
> >      >
> >      > Thanks,
> >      >
> >      > - Ross
> >      >
> >      >
> >      >> -----Original Message-----
> >      >> From: trilinos-users-bounces at software.sandia.gov
> >     <mailto:trilinos-users-bounces at software.sandia.gov>
> >     [mailto:trilinos- <mailto:trilinos->
> >      >> users-bounces at software.sandia.gov
> >     <mailto:users-bounces at software.sandia.gov>] On Behalf Of Matthew
> Koch
> >      >> Sent: Tuesday, June 15, 2010 3:50 PM
> >      >> To: trilinos-users at software.sandia.gov
> >     <mailto:trilinos-users at software.sandia.gov>
> >      >> Subject: [Trilinos-Users] linking debug on Windows
> >      >>
> >      >> Hi,
> >      >>
> >      >> I am trying to link a debug version of Trilinos 10 (MSVC 9
> 2008)
> >     into a
> >      >> project that builds with the
> >      >> Intel compiler, but keep running into a problem with lines
> like the
> >      >> following in Teuchos_RCPDecl.hpp:
> >      >>
> >      >> 934  void free( T* ptr ) { }
> >      >>
> >      >> the compiler says that it expected a type specifier between
> void and
> >      >> free.  Everything works fine in
> >      >> release, and Trilinos builds in debug, but the error is
> thrown when
> >      >> that file gets included in the
> >      >> other project.  Is there some flag that I'm missing in the
> other
> >      >> project's debug configuration that
> >      >> would skip or modify this code?
> >      >>
> >      >> Thank you,
> >      >> Matthew Koch
> >      >>
> >      >> _______________________________________________
> >      >> Trilinos-Users mailing list
> >      >> Trilinos-Users at software.sandia.gov
> >     <mailto:Trilinos-Users at software.sandia.gov>
> >      >> http://software.sandia.gov/mailman/listinfo/trilinos-users
> >      >
> >
> >     _______________________________________________
> >     Trilinos-Users mailing list
> >     Trilinos-Users at software.sandia.gov
> >     <mailto:Trilinos-Users at software.sandia.gov>
> >     http://software.sandia.gov/mailman/listinfo/trilinos-users
> >
> >
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list