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

Perschbacher, Brent M bmpersc at sandia.gov
Tue Jun 18 08:46:50 MDT 2013


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




More information about the Trilinos-Users mailing list