[Trilinos-Users] [EXTERNAL] Trilinos, epetra and komplex problem

Ivan Gladich igladich at sissa.it
Wed Jun 19 01:41:09 MDT 2013


Dear Brent
thank you very much for your help.

I switched to the g++ compiler and moves the -lepetra and -lkomplex 
flags before all the others...I have others problems...
I just add the line
#include "Epetra_SerialDenseMatrix.h"
to the simple.c file in

../trilinos-11.2.3-Source_MPI/packages/komplex/example/komplex_hb/simple.c

So the first lines of my code looks like
#include "azk_komplex.h"
#include "az_aztec.h"
#include "Epetra_SerialDenseMatrix.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#ifdef AZTEC_MPI
#include <mpi.h>
#endif
...

 >g++ simple_2.c 
-I/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include 
-L/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/lib 
-lkomplex -lepetra -liomp5 -lpthread -lmkl_intel_lp64 -lmkl_intel_thread 
-lmkl_core
---------------
In file included from 
/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include/az_f77func.h:48:0,
from 
/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include/az_aztec.h:75,
from 
/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include/azk_komplex.h:159,
from simple_2.c:44:
/usr/include/string.h:548:5: error: ‘__locale_t’ has not been declared
/usr/include/string.h:549:33: error: nonnull argument references 
non-pointer operand (argument 1, operand 3)
/usr/include/string.h:552:18: error: ‘__locale_t’ has not been declared
/usr/include/string.h:553:33: error: nonnull argument references 
non-pointer operand (argument 1, operand 4)
In file included from 
/u/shared/programs/x86_64/gcc/4.5.2/include/c++/4.5.2/bits/localefwd.h:42:0,
from /u/shared/programs/x86_64/gcc/4.5.2/include/c++/4.5.2/ios:42,
from /u/shared/programs/x86_64/gcc/4.5.2/include/c++/4.5.2/ostream:40,
from /u/shared/programs/x86_64/gcc/4.5.2/include/c++/4.5.2/iostream:40,
from 
/u/shared/programs/x86_64/openmpi/1.6.4/gcc/4.4.7/include/openmpi/ompi/mpi/cxx/mpicxx.h:53,
from /u/shared/programs/x86_64/openmpi/1.6.4/gcc/4.4.7/include/mpi.h:2087,
from 
/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include/az_aztec.h:101,
from 
/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include/azk_komplex.h:159,
from simple_2.c:44:
/u/shared/programs/x86_64/gcc/4.5.2/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu/bits/c++locale.h:52:23: 
error: ‘uselocale’ was not declared in this scope
/u/shared/programs/x86_64/gcc/4.5.2/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu/bits/c++locale.h:52:45: 
error: invalid type in declaration before ‘;’ token
/u/shared/programs/x86_64/gcc/4.5.2/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu/bits/c++locale.h: 
In function ‘int std::__convert_from_v(__locale_struct* const&, char*, 
int, const char*, ...)’:
/u/shared/programs/x86_64/gcc/4.5.2/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu/bits/c++locale.h:72:53: 
error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
/u/shared/programs/x86_64/gcc/4.5.2/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu/bits/c++locale.h:97:33: 
error: ‘__gnu_cxx::__uselocale’ cannot be used as a function
simple_2.c: In function ‘int main(int, char**)’:
simple_2.c:113:47: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:114:47: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:117:46: error: invalid conversion from ‘void*’ to ‘int*’
simple_2.c:119:38: error: invalid conversion from ‘void*’ to ‘int*’
simple_2.c:121:41: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:122:41: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:123:41: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:124:41: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:125:42: error: invalid conversion from ‘void*’ to ‘double*’
simple_2.c:126:42: error: invalid conversion from ‘void*’ to ‘double*’
-----------------------

These are modules loaded on my workstation
Currently Loaded Modulefiles:
1) mkl/11.0 2) openmpi/1.6.4/gcc/4.4.7 3) gcc/4.5.2

the last lines seem a problem of c vs. c++ syntax...but the error in 
"error: ‘__locale_t’ has not been declared" I do not have clue
Thanks again for your suggestions

Ivan

On 06/18/2013 04:46 PM, Perschbacher, Brent M wrote:
> Ivan,
>    The compiler isn't complaining about a missing Epetra_ConfigDefs.hpp, it
> is complaining about a missing header that is being included by
> Epetra_ConfigDefs.hpp. There are a couple things wrong with your compile
> line for simple.c that you'll need to fix if you want to compile examples
> and your own code against Trilinos. The first, and the cause of your
> current issue, is that you are using the C compiler when you need to be
> using the C++ compiler. The missing header "algorithm" is part of the C++
> standard library which is not included by the C compiler. To fix this just
> replace the "gcc" in your compile line with g++. Once you've done that
> you'll run into another issue which you haven't yet, but we can fix
> easily. You are adding the Trilinos libraries after your blas and lapack
> libraries(mkl) which will cause you linking errors with Epetra. You need
> to move your "-lkomplex" and "-lepetra" to before your other -l's to
> ensure proper linking. Once you make those changes you should be able to
> compile and link your simple example.
>
> I hope this helps.
>
> Brent
>
> On 6/18/13 5:40 AM, "Ivan Gladich"<igladich at sissa.it>  wrote:
>
>> Dear Trilinos users
>>        I am a new user of Trilinos library and I have a problem to call
>> epetra for matrix storage
>> I need to solve a simple linear system A*x=b where A is a complex matrix
>> and b a complex vector.
>> I installed Trilinos package using the following script
>> --------------------------------
>> #!/bin/bash
>> export
>> TRILINOS_DIR="/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IV
>> AN/opt/"
>> export USE_MPI="ON"
>> export ccmake=/u/sbp/igladich/opt/cmake-2.8.11-Linux-i386/bin
>> /u/sbp/igladich/opt/cmake-2.8.11-Linux-i386/bin/cmake \
>> -D TrilinosFramework_ENABLE_MPI:BOOL=$USE_MPI \
>> -D CMAKE_INSTALL_PREFIX:PATH=$TRILINOS_DIR \
>> -D
>> TPL_BLAS_LIBRARIES:STRING="-I/u/shared/programs/x86_64/mkl/11.0.1/mkl/incl
>> ude
>> -L/u/shared/programs/x86_64/mkl/11.0.1/mkl/lib/intel64 -lmkl_intel_lp64
>> -lmkl_intel_thread -lmkl_core -liomp5 -lpthread" \
>> -D TPL_LAPACK_LIBRARIES:STRING="-lmkl_lapack95_lp64" \
>> -D TPL_ENABLE_MPI:BOOL=ON \
>> -D BUILD_SHARED_LIBS:BOOL=ON \
>> -D CMAKE_BUILD_TYPE:STRING=RELEASE \
>> -D Trilinos_ENABLE_Fortran:BOOL=ON \
>> -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
>> -D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
>> -D Trilinos_ENABLE_TESTS:BOOL=ON \
>> -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
>> -D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON \
>> -D Trilinos_ENABLE_TrilinosCouplings:BOOL=ON \
>> $EXTRA_ARGS \
>> ../
>> make -j2 install
>> ---------------------------
>> The installation went well
>> Moreover, I was able to compile and execute the the example case in
>>
>> /u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI/packages/komplex
>> /example/komplex_hb/simple.c
>>
>> Using
>>
>> gcc simple.c
>> -I/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/inclu
>> de
>> -L/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/lib
>> -liomp5
>> -lpthread -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core  -lkomplex
>>
>> Now I would like to store my matrix using the utility
>> #include "Epetra_SerialDense_Matrix.h"
>>
>> I started adding the following two lines
>>
>> #include "Epetra_ConfigDefs.h"
>> #include  "Epetra_SerialDenseMatrix.h"
>>
>> to my simple.c example with the flag -lepetra in the compilation line...
>>
>> gcc simple_2.c
>> -I/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/inclu
>> de
>> -L/u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/lib
>> -liomp5
>> -lpthread -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core  -lkomplex
>> -lepetra
>>
>> In file included from simple_2.c:46:0:
>> /u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include
>> /Epetra_ConfigDefs.h:51:21:
>> fatal error: algorithm: No such file or directory
>> compilation terminated.
>>
>> But if I check/
>> ls
>> /u/sbp/sbpstore2/igladich/libs/trilinos-11.2.3-Source_MPI_IVAN/opt/include
>> /
>>
>> Epetra_ConfigDefs.h
>>
>> is really there..
>>
>> Sorry for the (probable) trivial question but I am a new users ...maybe
>> I have lost something important
>>
>> Thanks in advance for any possible help
>> Best Regards
>> Ivan Gladich
>>
>> -- 
>> ------
>> Ivan Gladich, Ph.D.
>> Research Assistant
>> International School for Advanced Studies (SISSA)
>> Via Bonomea 265, I-34136, Trieste,
>> Italy
>>
>> Room: 331
>> Tel: +390403787335
>> e-mail: igladich at sissa.it
>> web page: http://people.sissa.it/~igladich/
>>
>> _______________________________________________
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
>> http://software.sandia.gov/mailman/listinfo/trilinos-users
>


-- 
------
Ivan Gladich, Ph.D.
Research Assistant
International School for Advanced Studies (SISSA)
Via Bonomea 265, I-34136, Trieste,
Italy

Room: 331
Tel: +390403787335
e-mail: igladich at sissa.it
web page: http://people.sissa.it/~igladich/



More information about the Trilinos-Users mailing list