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

Christoph Hasenbein christoph.hasenbein at tuhh.de
Tue Feb 2 03:42:11 MST 2010


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/AbsorberWieInAspenZumTesten.cpp.obj" 
"CMakeFiles/AbsorberWieInAspenZumTesten.dir/absorber.cpp.obj" 
"CMakeFiles/AbsorberWieInAspenZumTesten.dir/fcnabsorber.cpp.obj" 
"CMakeFiles/AbsorberWieInAspenZumTesten.dir/helpfunctionsabsorber.cpp.obj" 
"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/../../trilinos-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.cpp:
(.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.cpp:
(.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.cpp:
(.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



More information about the Trilinos-Users mailing list