[Trilinos-Users] mingw: linking problem trilinos and clapack

Bartlett, Roscoe A rabartl at sandia.gov
Tue Feb 2 08:44:04 MST 2010


Christoph,

Sorry I missed you use of 'nm' later in the email.

Look and see what gets configured in:

    packages/teuchos/src/Teuchos_config.h

If F77_BLAS_MANGLE is not what you expect then something is wrong with the configure input or something.

Also, can you build the native Trilinos tests?  Try to configure with:

   -DTrilinos_ENABLE_Teuchos=ON -DTrilinos_ENABLE_TESTS=ON

Do the Teuchos tests build and link?  If not, then manually modify the configured Teuchos_config.h file until you get it to work.

- Ross


> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of Christoph Hasenbein
> Sent: Tuesday, February 02, 2010 8:22 AM
> To: trilinos-users at software.sandia.gov
> Subject: Re: [Trilinos-Users] mingw: linking problem trilinos and
> clapack
> 
> Dear Ross,
> 
> thank you for your answer. I have to apologize for my long error
> message. Sometimes it is difficult to decide whether it is too long or
> just right. Somewhere hidden after the first error message is what I
> already tried to solve the problem.
> 
> Following your advice gives
> 
> $ nm libblas.a | grep dtrmm
>  dtrmm.c.obj:
>  00000000 T _dtrmm_
> 
> I already tried to modify this cmake variable. I have the problem that
> I'm not able to actually set it right.
> 
> By default Trilinos searches for a name without underbar in front so I
> have to add this in the variable. I already tried
> 
> (name,NAME) _name ##_
> 
> but this gives me the second error of my previous mail.
> 
> _(name,NAME) name ##_
> yields to
> 
> [  0%] Building CXX object
> packages/teuchos/src/CMakeFiles/teuchos.dir/Teuchos_BLAS.cpp.obj
> In file included from c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS.cpp:30:
> c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:308: error:
> variable or field 'F77_BLAS_MANGLE' declared void
> c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:308: error:
> 'drotg' was not declared in this scope
> c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:308: error:
> 'DROTG' was not declared in this scope
> 
> and
> (_name,NAME) name ## _
> gives
> 
> In file included from c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS.cpp:30:
> c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:309: error:
> declaration of C function 'void name_(const int*, double*,
> const int*, double*, const int*, double*, double*)' conflicts with
> c:/msys/1.0/home/christoph/trilinos-10.0.4-
> Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:308: error:
> previous declaration 'void name_(double*, double*, double*,
> double*)' here
> 
> I have no idea how this variable works so maybe someone could give me a
> hint.
> 
> Best regards,
> 
> Christoph
> 
> Am Dienstag 02 Februar 2010 14:21:01 schrieben Sie:
> > Christoph,
> >
> > I would guess that you have a name mangling problem.  Can you use
> >  'nm' to see what the names of the BLAS routines actually are?  For
> >  example, if you built the library 'libblas.a' you would search:
> >
> >    $ nm libblas.a | grep -i dtrmm
> >
> > See what that returns.
> >
> > If you need to manually adjust the name mangling then you can do that
> >  on the configure line by setting, for example:
> >
> >     -DF77_BLAS_MANGLE:STRING="(name,NAME) name ## _"
> >
> > You can change the case, underscores etc., to force a match.
> >
> > The joys of mix language programming!
> >
> > Cheers,
> >
> > - Ross
> >
> >
> > ---------------------------------------------------------------------
> > -- Dr. Roscoe A. Bartlett
> > Sandia National Laboratories
> > Department of Optimization and Uncertainty Estimation
> > Trilinos Software Engineering Technologies and Integration Lead
> > (505) 844-5097
> >
> > > -----Original Message-----
> > > From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> > > users-bounces at software.sandia.gov] On Behalf Of Christoph Hasenbein
> > > Sent: Tuesday, February 02, 2010 3:42 AM
> > > To: trilinos-users at software.sandia.gov
> > > Subject: [Trilinos-Users] mingw: linking problem trilinos and
> > > clapack
> > >
> > > Hello everyone,
> > >
> > > I hope this is the right place to ask this question.
> > >
> > > I have used MSVC till now and everything works fine. As Microsoft
> > > doesn't seem to include a profiler I tried to use mingw/msys and
> > > gprof. I
> > > have this working without Trilinos (using cminpack).
> > >
> > > I have managed to compile clapack and Trilinos with mingw. When I
> > > try to link my own project I get the following error:
> > >
> > > Linking CXX executable AbsorberWieInAspenZumTesten.exe
> > > /C/msys/1.0/bin/g++.exe   -g
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/AbsorberWieInAspenZumTe
> > >sten .cpp.obj"
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/absorber.cpp.obj"
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/fcnabsorber.cpp.obj"
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/helpfunctionsabsorber.c
> > >pp.o bj"
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/ex1.cpp.obj"
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/helpfunctions.cpp.obj"
> > > "CMakeFiles/AbsorberWieInAspenZumTesten.dir/stratimikos.cpp.obj"
> > > -o AbsorberWieInAspenZumTesten.exe -Wl,--out-
> > > implib,libAbsorberWieInAspenZumTesten.dll.a -Wl,--major-image-
> > > version,0,--minor-image-version,0  -
> > > L/C/msys/1.0/home/christoph/git_CO2_Wash/Programmable/../../trilino
> > >s- 10.0.4-
> > > Source/gccDebug/lib -
> > > L/C/msys/1.0/home/christoph/git_CO2_Wash/Programmable/../../clapack
> > >- 3.2.1-
> > > CMAKE/gccDebug/SRC -
> > > L/C/msys/1.0/home/christoph/git_CO2_Wash/Programmable/../../clapack
> > >- 3.2.1-
> > > CMAKE/gccDebug/BLAS/SRC -
> > > L/C/msys/1.0/home/christoph/git_CO2_Wash/Programmable/../../clapack
> > >- 3.2.1-
> > > CMAKE/gccDebug/F2CLIBS/libf2c -
> > > L/C/msys/1.0/home/christoph/git_CO2_Wash/Programmable/../cminpack -
> > > L/C/msys/1.0/home/christoph/git_CO2_Wash/Programmable -Wl,-Bstatic
> > > - lf2c
> > > -lepetra -lepetraext -lteuchos -lnox -lnoxepetra -Wl,-Bdynamic -
> > > lcminpack -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32
> > > - loleaut32 -luuid -lcomdlg32 -ladvapi32
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/gccDebug/lib\libepetra.a(Epetra_BLAS.cpp.obj):Epetra_BLAS.cp
> > >p: (.text+0xab): undefined reference to `dtrmm_'
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/gccDebug/lib\libepetra.a(Epetra_BLAS.cpp.obj):Epetra_BLAS.cp
> > >p: (.text+0x11f): undefined reference to `strmm_'
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/gccDebug/lib\libepetra.a(Epetra_BLAS.cpp.obj):Epetra_BLAS.cp
> > >p: (.text+0x1a6): undefined reference to `dsymm_'
> > >
> > > ...
> > >
> > > Checking libblas.a with nm I see that each function has a underbar
> > > in front of its name, for example
> > >
> > > $ nm libblas.a | grep dtrmm
> > > dtrmm.c.obj:
> > > 00000000 T _dtrmm_
> > >
> > > I think that this has something to do with name mangling. My idea
> > > was to
> > > change this with the cmake variable F77_BLAS_MANGLE. Setting this
> > > to "UNDEFINED" it makes it search for the name in capitals. I tried
> > > things like
> > > "(name,NAME) _name ##_" (without quotes) but it fails with
> > >
> > > $ make
> > > [  0%] Building CXX object
> > > packages/teuchos/src/CMakeFiles/teuchos.dir/Teuchos_BLAS.cpp.obj
> > > In file included from c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS.cpp:30:
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:309: error:
> > > declaration of C function 'void _name_(const int*, double*,
> > > const int*, double*, const int*, double*, double*)' conflicts with
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:308: error:
> > > previous declaration 'void _name_(double*, double*, double*,
> > > double*)' here
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:310: error:
> > > declaration of C function 'double _name_(const int*, const
> > > double*, const int*)' conflicts with
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:309: error:
> > > previous declaration 'void _name_(const int*, double*, const
> > > int*, double*, const int*, double*, double*)' here
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:311: error:
> > > declaration of C function 'void _name_(const int*, const
> > > double*, const double*, const int*, double*, const int*)' conflicts
> > > with
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:310: error:
> > > previous declaration 'double _name_(const int*, const
> > > double*, const int*)' here
> > > c:/msys/1.0/home/christoph/trilinos-10.0.4-
> > > Source/packages/teuchos/src/Teuchos_BLAS_wrappers.hpp:312: error:
> > > declaration of C function 'void _name_(const int*, const
> > > double*, const int*, double*, const int*)' conflicts with
> > >
> > >
> > > while compiling Trilinos.
> > >
> > > www.mingw.org seems to be down at the moment so I kindly would like
> > > to ask if you have an idea how to proceed.
> > >
> > > Best regards,
> > >
> > > Christoph Hasenbein
> > >
> > > _______________________________________________
> > > Trilinos-Users mailing list
> > > 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