1 (edited by Singh.Puneet 27-05-2015 10:24:53)

Topic: poofem-2.3 build fails with PETSC3.X.X

I am facing errors while trying to build parallel version of oofem (poofem).
error#1: oofem + petsc 3.5.X (i guess due to versioning of petsc)
error#2: oofem + petsc 3.4.X / 3.3.X / 3.2.X / 3.1.X

any help/hint (which helps me to build poofem) regarding any of these issues will be very useful.


*********************************************ERROR 1********************************************************

I have CentOS6.5 and following libraries are not at standard path,
all of them have been installed at custom location:-

PETSC-3.5.4
Python-3.4.2
oofem-2.3 (http://www.oofem.org/cgi-bin/OOFEM/down … em-2.3.zip)
ckit  (http://mech.fsv.cvut.cz/software/Ckit.tgz &&)
elixir (http://mech.fsv.cvut.cz/software/Elixir.tgz)
MPICH 
IML

now from OOFEMROOT(oofem2.3)'s build directory i configure in this way:

PETSC_DIR=/root/Downloads/petsc-3.5.4 cmake -DPYTHON_EXECUTABLE=/root/Downloads/PYTHON/bin/python3 -DPYTHON_INCLUDE_DIR=/root/Downloads/PYTHON/include/ -DCMAKE_INSTALL_PREFIX:PATH=/root/Downloads/OOFEM/OOFEM/ -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DUSE_IML="ON" -DIML_DIR=/opt/user1/user1_Installed/Application_Dependencies/include/ -DCKIT_DIR=/opt/user1/user1_Installed/Application_Dependencies/ -DELIXIR_DIR=/opt/user1/user1_Installed/Application_Dependencies/ -DUSE_PARALLEL="ON" -DUSE_PETSC="ON" -DMY_PETSC_DIR=/root/Downloads/petsc-3.5.4 -DMY_PETSC_ARCH=x86_64 ..

Configure log is:

-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /root/Downloads/MPICH3/bin/mpicc
-- Check for working C compiler: /root/Downloads/MPICH3/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /root/Downloads/MPICH3/bin/mpicxx
-- Check for working CXX compiler: /root/Downloads/MPICH3/bin/mpicxx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- checking for module 'PETSc'
--   found PETSc, version 3.5.0
-- Found MPI_C: /root/Downloads/MPICH3/lib/libmpi.so 
-- Found MPI_CXX: /root/Downloads/MPICH3/lib/libmpicxx.so;/root/Downloads/MPICH3/lib/libmpi.so 
-- Looking for C++ include iml/cg.h
-- Looking for C++ include iml/cg.h - found
-- Looking for C++ include iml/gmres.h
-- Looking for C++ include iml/gmres.h - found
-- Found PythonInterp: /root/Downloads/PYTHON/bin/python3 (found suitable version "3.4.2", minimum required is "2.7")
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file execinfo.h
-- Looking for include file execinfo.h - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for access
-- Looking for access - found
-- Looking for cbrt
-- Looking for cbrt - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for M_PI
-- Looking for M_PI - found
-- Looking for M_LN2
-- Looking for M_LN2 - found
-- Performing Test HAVE_MACRO_VA_ARGS
-- Performing Test HAVE_MACRO_VA_ARGS - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found Doxygen: /usr/bin/doxygen (found version "1.6.1")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:
    PYTHON_INCLUDE_DIR
-- Build files have been written to: /root/Downloads/OOFEM/oofem-2.3/build



configuration was success , but while making i get:



[ 75%] Building CXX object src/oofemlib/CMakeFiles/core.dir/calmls.C.o
[ 75%] Building CXX object src/oofemlib/CMakeFiles/core.dir/petscsolver.C.o
/root/Downloads/petsc-3.5.4/include/petscksp.h: In member function ‘oofem::NM_Status oofem::PetscSolver::petsc_solve(oofem::PetscSparseMtrx*, _p_Vec*, _p_Vec*)’:
/root/Downloads/petsc-3.5.4/include/petscksp.h:260: error: too many arguments to function ‘PetscErrorCode KSPSetOperators(_p_KSP*, _p_Mat*, _p_Mat*)’
/root/Downloads/OOFEM/oofem-2.3/src/oofemlib/petscsolver.C:142: error: at this point in file
/root/Downloads/petsc-3.5.4/include/petscksp.h:260: error: too many arguments to function ‘PetscErrorCode KSPSetOperators(_p_KSP*, _p_Mat*, _p_Mat*)’
/root/Downloads/OOFEM/oofem-2.3/src/oofemlib/petscsolver.C:145: error: at this point in file
/root/Downloads/OOFEM/oofem-2.3/src/oofemlib/petscsolver.C: At global scope:
/root/Downloads/OOFEM/oofem-2.3/src/oofemlib/petscsolver.C:48: warning: ‘oofem::__dummy_PetscSolver’ defined but not used
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/petscsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2


Since problem seems to be with PETSC-3.5.4 , so i downloaded PETSC-3.5.0 & updated MY_PETSC_DIR accordingly , but i am getting same error




*************************************************** ERROR 2  *****************************************************************

so i again reverted to PETSC- 3.4.5 via -DMY_PETSC_DIR=/root/Downloads/petsc-3.4.5
but in this case my configure step fails as:

PETSC_DIR=/root/Downloads/petsc-3.4.5 cmake -DPYTHON_EXECUTABLE=/root/Downloads/PYTHON/bin/python3 -DPYTHON_INCLUDE_DIR=/root/Downloads/PYTHON/include/ -DCMAKE_INSTALL_PREFIX:PATH=/root/Downloads/OOFEM/OOFEM/ -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DUSE_IML="ON" -DIML_DIR=/opt/user1/user1_Installed/Application_Dependencies/include/ -DCKIT_DIR=/opt/user1/user1_Installed/Application_Dependencies/ -DELIXIR_DIR=/opt/user1/user1_Installed/Application_Dependencies/ -DUSE_PARALLEL="ON" -DUSE_PETSC="ON" -DMY_PETSC_DIR=/root/Downloads/petsc-3.4.5 -DMY_PETSC_ARCH=x86_64 ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /root/Downloads/MPICH3/bin/mpicc
-- Check for working C compiler: /root/Downloads/MPICH3/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /root/Downloads/MPICH3/bin/mpicxx
-- Check for working CXX compiler: /root/Downloads/MPICH3/bin/mpicxx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- checking for module 'PETSc'
--   package 'PETSc' not found
CMake Error at /opt/user1/user1_Installed/Application_Dependencies/share/cmake-3.0/Modules/FindPkgConfig.cmake:341 (message):
  A required package was not found
Call Stack (most recent call first):
  /opt/user1/user1_Installed/Application_Dependencies/share/cmake-3.0/Modules/FindPkgConfig.cmake:395 (_pkg_check_modules_internal)
  CMakeLists.txt:302 (pkg_check_modules)

-- Found MPI_C: /root/Downloads/MPICH3/lib/libmpi.so 
-- Found MPI_CXX: /root/Downloads/MPICH3/lib/libmpicxx.so;/root/Downloads/MPICH3/lib/libmpi.so 
-- Looking for C++ include iml/cg.h
-- Looking for C++ include iml/cg.h - found
-- Looking for C++ include iml/gmres.h
-- Looking for C++ include iml/gmres.h - found
-- Found PythonInterp: /root/Downloads/PYTHON/bin/python3 (found suitable version "3.4.2", minimum required is "2.7")
-- Looking for include file sys/time.h
-- Looking for include file sys/time.h - found
-- Looking for include file time.h
-- Looking for include file time.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file execinfo.h
-- Looking for include file execinfo.h - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for access
-- Looking for access - found
-- Looking for cbrt
-- Looking for cbrt - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for M_PI
-- Looking for M_PI - found
-- Looking for M_LN2
-- Looking for M_LN2 - found
-- Performing Test HAVE_MACRO_VA_ARGS
-- Performing Test HAVE_MACRO_VA_ARGS - Success
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found Doxygen: /usr/bin/doxygen (found version "1.6.1")
-- Configuring incomplete, errors occurred!
See also "/root/Downloads/OOFEM/oofem-2.3/build/CMakeFiles/CMakeOutput.log".

I have attached CMakeOutput.log file for reference. Please note that MY_PETSC_DIR points to source package , also i tried setting MY_PETSC_DIR to the PETSC 3.X install( bin  conf  include  lib  share ) directory, but configure error remains same.

i have tried further reverting back to previous versions (3.4/3.3/3.2/3.1), but the this configure error remain same.

Post's attachments

CMakeOutput.log 52.98 kb, 1 downloads since 2015-05-27 

You don't have the permssions to download the attachments of this post.

Re: poofem-2.3 build fails with PETSC3.X.X

OOFEM uses the pkgconfig file nowdays (PETSc developers did not want to make an equivalent CMake file). Based on your -D flags, can you confirm that either
/root/Downloads/petsc-3.5.4/x86_64/lib64/pkgconfig
or
/root/Downloads/petsc-3.5.4/x86_64/lib/pkgconfig
exists?

This is the flags that is set to find the *.pc-file

set (ENV{PKG_CONFIG_PATH} "${MY_PETSC_DIR}/${MY_PETSC_ARCH}/lib64/pkgconfig:${MY_PETSC_DIR}/${MY_PETSC_ARCH}/lib/pkgconfig")

3 (edited by Singh.Puneet 27-05-2015 14:52:32)

Re: poofem-2.3 build fails with PETSC3.X.X

ok, i was able to install with a hack (please see **OOFEM INSTALLATION ** section), but  "bin/poofem" binary was not generated under my bin directory, i got "bin/oofem" instead.

also somebody asked me weather this "bin/oofem" binary is parallel ?
so i ran sample examples ( please see **OOFEM Binary Test** section below:) and now i doubt that this binary is parallel one, even though i have used all parallel build flags.

Please help me generating/installing parallel version of oofem!



**************************************************** OOFEM INSTALLATION ****************************


oofem installation with petsc-3.5.X & 3.4.X is not working (die to API differences)
and petsc 3.3 does not generate *.pc file , so i had to manually create a pc file under lib/pkgconfig/ of petsc 3.3 installation directory, and the installation worked!!!

i installed with :
OOFEM_TARGET="poofem-release" PETSC_DIR=/root/Downloads/petsc-3.3-p7 cmake -DPYTHON_EXECUTABLE=/root/Downloads/PYTHON/bin/python3 -DPYTHON_INCLUDE_DIR=/root/Downloads/PYTHON/include/ -DCMAKE_INSTALL_PREFIX:PATH=/root/Downloads/OOFEM/OOFEM/ -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DUSE_IML="ON" -DIML_DIR=/opt/user1/user1_Installed/Application_Dependencies/include/ -DCKIT_DIR=/opt/user1/user1_Installed/Application_Dependencies/ -DELIXIR_DIR=/opt/user1/user1_Installed/Application_Dependencies/ -DUSE_PARALLEL="ON" -DUSE_PETSC="ON" -DMY_PETSC_DIR=/root/Downloads/petsc-3.3-p7 -DMY_PETSC_ARCH=x86_64 -DUSE_LAPACK="ON" -DLAPACK_DIR=/opt/user1/user1_Installed/Application_Dependencies/lib -DX11_DIR="/usr/lib64/:/opt/user1/user1_Installed/Application_Dependencies/lib" -DCMAKE_LIBRARY_PATH="/usr/lib64/:/usr/lib64/X11:/usr/lib/:/opt/user1/user1_Installed/Application_Dependencies/lib:$LD_LIBRARY_PATH" -DCMAKE_EXE_LINKER_FLAGS="-lX11" -DUSE_OPENMP="ON" -DMETIS_DIR=/opt/user1/user1_Installed/Application_Dependencies -DPARMETIS_DIR=/opt/user1/user1_Installed/Application_Dependencies  ..

make gives :

[100%] Building CXX object src/sm/CMakeFiles/sm.dir/j2mplasticmaterial.C.o
[100%] Building CXX object src/sm/CMakeFiles/sm.dir/rankinepm.C.o
[100%] Built target sm
Scanning dependencies of target liboofem
Linking CXX shared library liboofem.so
[100%] Built target liboofem
Scanning dependencies of target oofem
[100%] Building CXX object CMakeFiles/oofem.dir/src/main/main.C.o
Linking CXX executable oofem
[100%] Built target oofem






**************************************OOFEM Binary Test(is this parallel ?)************************************************



I tried setting OOFEM_TARGET to OOFEM_TARGET="poofem-release" as well as "poofem" , but i am getting "oofem" under bin/ directory (was expecting poofem instead).

[root@shavakpuneet bin]# ldd oofem
    linux-vdso.so.1 =>  (0x00007fff528f1000)
    libX11.so.6 => /usr/lib64/libX11.so.6 (0x0000003561000000)
    liboofem.so => /root/Downloads/OOFEM/OOFEM/lib/liboofem.so (0x00002b790216e000)
    libdl.so.2 => /lib64/libdl.so.2 (0x000000355dc00000)
    libmpicxx.so.12 => /root/Downloads/MPICH3/lib/libmpicxx.so.12 (0x00002b7903ad0000)     <----------------- so i guessed this oofem binary is parallel
    libmpi.so.12 => /root/Downloads/MPICH3/lib/libmpi.so.12 (0x00002b7903cf3000)
    libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x0000003569000000)
    libm.so.6 => /lib64/libm.so.6 (0x000000355d400000)
    libgomp.so.1 => /usr/lib64/libgomp.so.1 (0x000000355ec00000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003563c00000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x000000355d800000)
    libc.so.6 => /lib64/libc.so.6 (0x000000355d000000)
    libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00002b7904167000)
    libxcb.so.1 => /usr/lib64/libxcb.so.1 (0x0000003560800000)
    /lib64/ld-linux-x86-64.so.2 (0x000000355cc00000)
    librt.so.1 => /lib64/librt.so.1 (0x000000355e400000)
    libXau.so.6 => /usr/lib64/libXau.so.6 (0x0000003560400000)

but on running with :

[root@shavakpuneet bin]# time mpirun -np 2 ./oofem -f brazil_2d_nl.oofem.in
i get :
                                                             Real time consumed: 000h:00m:48s
                                                             User time consumed: 000h:00m:22s
                                                             Total 0 error(s) and 0 warning(s) reported

                                                             real    0m48.800s
                                                             user    0m45.736s
                                                             sys     0m0.134s

also i tried increasing process count:
[root@shavakpuneet bin]# time mpirun -np 4 ./oofem -f brazil_2d_nl.oofem.in
i get:
                                                       Real time consumed: 000h:01m:41s
                                                       User time consumed: 000h:01m:24s
                                                       Total 0 error(s) and 0 warning(s) reported

                                                       real    1m42.074s
                                                       user    1m37.505s
                                                       sys     0m1.166s


so clearly , this oofem binary does not seem to solve the problem quickly.
Q Am i choosing wrong input file or,
Q The input file(brazil_2d_nl.oofem.in) does not support parallel run ?

Q. How can i generate poofem binary ?
Q. Please help me verify weather the generated oofem binary is parallel or not ?

Re: poofem-2.3 build fails with PETSC3.X.X

Short answer: To run in parallel, you have to add the "-p" flag.

Long answer:
There is no parallel and sequential versions (there used to be a separate binary "poofem" and if you have seen this in any up-to-date documentation, please let me know so that I can correct it).

Instead, nowdays there is only a version with and without MPI-support. The parallel build can still run the sequential analysis if requested.

To run a parallel job, one has to use the "-p" flag:

mpirun -np 4  ./oofem -p  -f my_file.in

When this is done, oofem will look for the files "my_file.in.0" ... "my_file.in.3" (if there exists a "my_file.in", it will simply be ignored).


(We could probably remove the -p flag and simply check if the user is running oofem MPI by counting the processes, though, this is currently not done)





---------
Edit: The GIT version of OOFEM should work with PETSc 3.4 and 3.5.

5 (edited by Singh.Puneet 01-06-2015 11:22:24)

Re: poofem-2.3 build fails with PETSC3.X.X

Thankyou very much for a prompt reply. My previous build was successful
However ,i retried build at some other path on a new machine, i was able to configure on new machine properly using:,

C_INCLUDE_PATH=$user1_install_path/Application_Dependencies/include/:$C_INCLUDE_PATH OOFEM_TARGET="poofem-release" PETSC_DIR=$user1_install_path/Application_Dependencies cmake -DPYTHON_EXECUTABLE=$user1_install_path/bin/python3 -DPYTHON_INCLUDE_DIR=$user1_install_path/include -DCMAKE_INSTALL_PREFIX:PATH=$user1_install_path/ -DCMAKE_C_COMPILER=$MPIC_COMP -DCMAKE_CXX_COMPILER=$MPICXX_COMP -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DUSE_IML="ON" -DIML_DIR=$user1_install_path/Application_Dependencies/include/ -DCKIT_DIR=$user1_install_path/Application_Dependencies -DELIXIR_DIR=$user1_install_path/Application_Dependencies -DUSE_PARALLEL="ON" -DUSE_SLEPC="ON" -DSLEPC_DIR=$user1_install_path/Application_Dependencies -DUSE_PETSC="ON" -DMY_PETSC_DIR=$user1_install_path/Application_Dependencies -DMY_PETSC_ARCH=x86_64 -DUSE_LAPACK="ON" -DLAPACK_DIR=$user1_install_path/Application_Dependencies/lib -DX11_DIR="/usr/lib64/:$user1_install_path/Application_Dependencies/lib" -DCMAKE_LIBRARY_PATH="/usr/lib64/:/usr/lib64/X11:/usr/lib/:$user1_install_path/Application_Dependencies/lib:$LD_LIBRARY_PATH" -DCMAKE_EXE_LINKER_FLAGS="-lX11" -DUSE_OPENMP="ON" -DMETIS_DIR=$user1_install_path/Application_Dependencies -DPARMETIS_DIR=$user1_install_path/Application_Dependencies  ..

but while make(ing) i am facing fresh  errors:

make
Scanning dependencies of target fm
[  0%] Building CXX object src/fm/CMakeFiles/fm.dir/fluidmodel.C.o
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/xmmintrin.h:36,
                 from /opt/user1/user1_Installed/Application_Dependencies/include/petscsys.h:1693,
                 from /opt/user1/user1_Installed/Application_Dependencies/include/petscis.h:7,
                 from /opt/user1/user1_Installed/Application_Dependencies/include/petscvec.h:9,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/petsccontext.h:41,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/engngm.h:65,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/fm/fluidmodel.h:38,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/fm/fluidmodel.C:35:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/mmintrin.h: In function ‘__m64 _mm_cvtsi32_si64(int)’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/mmintrin.h:62: error: can't convert between vector values of different size
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/mmintrin.h: In function ‘int _mm_cvtsi64_si32(__m64)’:

attached: oofem_make.log


where i may be going wrong this time ?
The configure options are almost the same as i had (succesfully) used previously!

Post's attachments

oofem_make.log 122.3 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: poofem-2.3 build fails with PETSC3.X.X

I can only think that you are trying to use compiler setup that is incompatible with whatever you compiled petsc with.
I don't know what you compiled PETSc with, or what $MPICXX_COMP is set to, so I can only speculate.

I would suggest starting to try compiling with as few options as possible, to try and isolate the fault.

7 (edited by Singh.Puneet 01-06-2015 14:53:55)

Re: poofem-2.3 build fails with PETSC3.X.X

Earlier  PETSc-3.3 was not detected by oofem-2.3 , i had to do create some symbolic link & some pc files , only then the oofem-2.3 detected PETSc on my system.
Here is my petsc installation procedure.
my environment variables:

export MPIC_COMP=mpicc
export MPICXX_COMP=mpicxx
export MPIF_COMP=mpifort
export user1_install_path=/opt/user1/user1_Installed/
i had configured PETSC using:

LIBRARY_PATH=$user1_install_path/Application_Dependencies/lib:$LIBRARY_PATH  LD_LIBRARY_PATH=$user1_install_path/Application_Dependencies/lib:$LD_LIBRARY_PATH ./configure  --PETSC_ARCH=x86_64 --with-mpi=1 --CC=$MPIC_COMP --CXX=$MPICXX_COMP --FC=$MPIF_COMP --with-fortran=1 --CFLAGS="-fPIC" --CXXFLAGS="-fPIC" --FFLAGS="-fPIC" --with-shared-libraries=0 --PETSC_DIR="$user1_base_path/Mechanical/OOFEM/petsc-3.3-p7" --PETSC_ARCH=x86_64 --prefix="$user1_install_path/Application_Dependencies" --with-blas-lapack-dir="$user1_install_path/Application_Dependencies" --with-hdf5=1 --with-hdf5-dir="$user1_install_path/Application_Dependencies" --with-fftw=1 --with-fftw-dir="$user1_install_path/Application_Dependencies" --with-metis=1 -with-metis-dir="$user1_install_path/Application_Dependencies" --with-parmetis=1 --with-parmetis-dir="$user1_install_path/Application_Dependencies" --with-openmp=1 --with-pthread=1

Though PETSc subsequently got installed in this way , but PETSc.pc file was not generated (in petsc-3.3-p7) . Since oofem-2.3(cmake) detects petsc via *.pc file , so i had to  manually create pc file within $user1_install_path/Application_Dependencies/lib/pkgconfig.
also i had to create symbolic link  $user1_install_path/Application_Dependencies/x86-64/lib which points to $user1_install_path/Application_Dependencies/lib

Only then the oofem-2.3 detected PETSc installation on my system & oofem configure was success.

my PETSc.pc is attached.

Post's attachments

PETSc.pc 1.67 kb, 3 downloads since 2015-06-01 

You don't have the permssions to download the attachments of this post.

Re: poofem-2.3 build fails with PETSC3.X.X

I can't see anything wrong with the setup. Creating a pc-file should be OK, and really, from OOFEMs point of view, there isn't really anything wrong (it finds all the libraries and headers it needs).
OOFEM only adds very minimal (innocent) flags to the compilation procedure. We don't add many defines (and they are only used internally). There is very little that can go wrong because of OOFEM here.

You can investigate exactly what cmake is doing by running

make VERBOSE=1

which will print out the whole compilation line.
I highly recommend trying this out with minimal features enabled in OOFEM, as in, *only* run cmake and build that first. Then move on to only enabling PETSc and try that.


The error you get seems related to system architecture mismatch. Something compiled with 64bit, while some other header defines 32bit. But none of this code is part of OOFEM. It could be an old compiler bug as well.
You should run one of the example files for PETSc to verify that your petsc installation is working correctly.

9 (edited by Singh.Puneet 02-06-2015 16:01:19)

Re: poofem-2.3 build fails with PETSC3.X.X

i'll try building oofem2.3 with minimal packages/dependencies ,
TRY1:
meanwhile i tried building oofem-master(https://github.com/Micket/oofem)  with petsc master(https://github.com/petsc/petsc) ,& i am getting :
configure log:

C_INCLUDE_PATH=$user1_install_path/include/:$C_INCLUDE_PATH OOFEM_TARGET="poofem-release" PETSC_DIR=$user1_install_path cmake -DPYTHON_EXECUTABLE=$user1_install_path/bin/python3 -DPYTHON_INCLUDE_DIR=$user1_install_path/include -DCMAKE_INSTALL_PREFIX:PATH=$user1_install_path/ -DCMAKE_C_COMPILER=$MPIC_COMP -DCMAKE_CXX_COMPILER=$MPICXX_COMP -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DUSE_IML="ON" -DIML_DIR=$user1_install_path/include/ -DUSE_PARALLEL="ON" -DUSE_PETSC="ON" -DMY_PETSC_DIR=$user1_install_path -DMY_PETSC_ARCH= -DUSE_LAPACK="ON" -DLAPACK_DIR=$user1_install_path/lib -DX11_DIR="/usr/lib64/:$user1_install_path/lib" -DCMAKE_LIBRARY_PATH="/usr/lib64/:/usr/lib64/X11:/usr/lib/:$user1_install_path/lib:$LD_LIBRARY_PATH" -DCMAKE_EXE_LINKER_FLAGS="-lX11" -DUSE_OPENMP="ON" -DMETIS_DIR=$user1_install_path -DPARMETIS_DIR=$user1_install_path  ..-- The CXX compiler identification is GNU 4.4.7
-- The C compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /root/Downloads/COMMON/bin/mpicxx
-- Check for working CXX compiler: /root/Downloads/COMMON/bin/mpicxx -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /root/Downloads/COMMON/bin/mpicc
-- Check for working C compiler: /root/Downloads/COMMON/bin/mpicc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp 
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- A library with BLAS API found.
-- Looking for cheev_
-- Looking for cheev_ - found
-- A library with LAPACK API found.
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23")
-- checking for module 'PETSc'
--   found PETSc, version 3.5.4
-- Found MPI_C: /root/Downloads/COMMON/lib/libmpi.so 
-- Found MPI_CXX: /root/Downloads/COMMON/lib/libmpicxx.so;/root/Downloads/COMMON/lib/libmpi.so 
-- Looking for C++ include iml/cg.h
-- Looking for C++ include iml/cg.h - found
-- Looking for C++ include iml/gmres.h
-- Looking for C++ include iml/gmres.h - found
-- Found PythonInterp: /root/Downloads/COMMON/bin/python3 (found suitable version "3.4.3", minimum required is "2.7")
-- Looking for C++ include unistd.h
-- Looking for C++ include unistd.h - found
-- Looking for C++ include execinfo.h
-- Looking for C++ include execinfo.h - found
-- Looking for access
-- Looking for access - found
-- Looking for cbrt
-- Looking for cbrt - found
-- Looking for isnan
-- Looking for isnan - found
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found Doxygen: /usr/bin/doxygen (found version "1.6.1")
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    IML_DIR
    PYTHON_INCLUDE_DIR



make
Scanning dependencies of target fm
[  0%] Building CXX object src/fm/CMakeFiles/fm.dir/fluidmodel.C.o
In file included from /root/Downloads/oofem-master/src/oofemlib/engngm.h:44,
                 from /root/Downloads/oofem-master/src/fm/fluidmodel.h:38,
                 from /root/Downloads/oofem-master/src/fm/fluidmodel.C:35:
/root/Downloads/oofem-master/src/oofemlib/assemblercallback.h:72: error: ‘nullptr’ was not declared in this scope
/root/Downloads/oofem-master/src/oofemlib/assemblercallback.h:74: error: ‘nullptr’ was not declared in this scope
/root/Downloads/oofem-master/src/oofemlib/assemblercallback.h:90: error: ‘nullptr’ was not declared in this scope
/root/Downloads/oofem-master/src/oofemlib/assemblercallback.h:91: error: ‘nullptr’ was not declared in this scope
In file included from /root/Downloads/oofem-master/src/fm/fluidmodel.C:36:
/root/Downloads/oofem-master/src/oofemlib/element.h: In member function ‘void oofem::Element::ipEvaluator(T*, void (T::*)(oofem::GaussPoint*))’:
/root/Downloads/oofem-master/src/oofemlib/element.h:1055: error: expected initializer before ‘:’ token
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected primary-expression at end of input
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected ‘;’ at end of input
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected primary-expression at end of input
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected ‘)’ at end of input
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected statement at end of input
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected ‘}’ at end of input
/root/Downloads/oofem-master/src/fm/fluidmodel.C: At global scope:
/root/Downloads/oofem-master/src/fm/fluidmodel.C:127: error: expected ‘}’ at end of input
make[2]: *** [src/fm/CMakeFiles/fm.dir/fluidmodel.C.o] Error 1
make[1]: *** [src/fm/CMakeFiles/fm.dir/all] Error 2
make: *** [all] Error 2

( after removing previous files in my build directory!! )i even tried with no flag/configuration options as:
                 cmake  .. && make

-- The CXX compiler identification is GNU 4.4.7
-- The C compiler identification is GNU 4.4.7
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Could NOT find PythonInterp: Found unsuitable version "2.6.6", but required is at least "2.7" (found /usr/bin/python2)
-- Looking for C++ include unistd.h
-- Looking for C++ include unistd.h - found
-- Looking for C++ include execinfo.h
-- Looking for C++ include execinfo.h - found
-- Looking for access
-- Looking for access - found
-- Looking for cbrt
-- Looking for cbrt - found
-- Looking for isnan
-- Looking for isnan - found
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Found Doxygen: /usr/bin/doxygen (found version "1.6.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /root/Downloads/oofem-master/build
i am getting same make error!
(cmake .. && make works in oofem-2.3.zip)

10 (edited by Singh.Puneet 03-06-2015 03:10:42)

Re: poofem-2.3 build fails with PETSC3.X.X

Try 2:

i am getting another error while building oofem-2.3 + petsc-3.3 while make(ing):

LIBRARY_PATH=/root/Downloads/COMMON/lib/:$LIBRARY_PATH LD_LIBRARY_PATH=/root/Downloads/COMMON/lib/:$LD_LIBRARY_PATH C_INCLUDE_PATH=$user1_install_path/include/:$C_INCLUDE_PATH OOFEM_TARGET="poofem-release" PETSC_DIR=$user1_install_path CXXFLAGS="-L/root/Downloads/COMMON/lib -lfftw3_mpi -lfftw3"  make
[  8%] Built target fm
[ 51%] Built target core
[ 93%] Built target sm
[100%] Built target tm
Scanning dependencies of target liboofem
Linking CXX shared library liboofem.so
[100%] Built target liboofem
Scanning dependencies of target oofem
[100%] Building CXX object CMakeFiles/oofem.dir/src/main/main.C.o
Linking CXX executable oofem
{ make verbose output: /root/Downloads/COMMON/bin/mpicxx   -fPIC -Wall -fPIC -fopenmp -g -DDEBUG  -Wl,-rpath  -Wl,/root/Downloads/COMMON/lib  -Wl,--enable-new-dtags -lX11  CMakeFiles/oofem.dir/src/main/main.C.o  -o oofem -rdynamic liboofem.so -ldl -Wl,-Bstatic -llapack -lblas -lpetsc -Wl,-Bdynamic -lmpicxx -lmpi -Wl,-rpath,/root/Downloads/oofem-2.3/build }
liboofem.so: undefined reference to `fftw_mpi_local_size_2d_transposed'
liboofem.so: undefined reference to `fftw_mpi_init'
liboofem.so: undefined reference to `fftw_mpi_local_size_3d_transposed'
liboofem.so: undefined reference to `fftw_mpi_plan_dft_r2c'
liboofem.so: undefined reference to `fftw_execute'
liboofem.so: undefined reference to `fftw_plan_dft_c2r'
liboofem.so: undefined reference to `fftw_execute_dft'
liboofem.so: undefined reference to `fftw_mpi_plan_dft_c2r_2d'
liboofem.so: undefined reference to `ParMETIS_V3_Mesh2Dual'
liboofem.so: undefined reference to `fftw_plan_dft_r2c_1d'
liboofem.so: undefined reference to `fftw_mpi_plan_dft_r2c_2d'
liboofem.so: undefined reference to `fftw_mpi_plan_dft_c2r'
liboofem.so: undefined reference to `fftw_plan_dft_c2r_2d'
liboofem.so: undefined reference to `fftw_plan_dft_r2c'
liboofem.so: undefined reference to `fftw_mpi_plan_dft_r2c_3d'
liboofem.so: undefined reference to `fftw_mpi_plan_dft_c2r_3d'
liboofem.so: undefined reference to `fftw_malloc'
liboofem.so: undefined reference to `fftw_mpi_cleanup'
liboofem.so: undefined reference to `ParMETIS_V3_PartKway'
liboofem.so: undefined reference to `fftw_free'
liboofem.so: undefined reference to `fftw_plan_dft_c2r_1d'
liboofem.so: undefined reference to `fftw_mpi_local_size_transposed'
liboofem.so: undefined reference to `fftw_destroy_plan'
liboofem.so: undefined reference to `fftw_plan_dft_c2r_3d'
liboofem.so: undefined reference to `fftw_plan_dft_r2c_3d'
liboofem.so: undefined reference to `fftw_plan_dft_r2c_2d'
collect2: ld returned 1 exit status
make[2]: *** [oofem] Error 1
make[1]: *** [CMakeFiles/oofem.dir/all] Error 2
make: *** [all] Error 2

Though liboofem.so is generated within oofem2.3/build but still i doubt weather it will work correctly.
i am unable to locate any flag for FFTW within oofem-2.3/CMakeLists.txt

i even tried setting CFLAGS="-L/root/Downloads/COMMON/lib -lfftw3_mpi -lfftw3" as well as FFLAGS="-L/root/Downloads/COMMON/lib -lfftw3_mpi -lfftw3" , further i have created softlink libfftw --> libfftw3 & libfftw_mpi -->  libfftw3_mpi.

also errorenous symbols are present within libraries at search path!:
nm libfftw3.a| grep fftw_plan_dft_c2r_3d
0000000000000f8a T dfftw_plan_dft_c2r_3d_
0000000000002546 T dfftw_plan_dft_c2r_3d__
                 U fftw_plan_dft_c2r_3d
0000000000000000 T fftw_plan_dft_c2r_3d

nm libparmetis.a| grep ParMETIS_V3_Mesh2Dual
                 U ParMETIS_V3_Mesh2Dual
0000000000000000 T ParMETIS_V3_Mesh2Dual
                 U ParMETIS_V3_Mesh2Dual

though i have to manuaaly compile the source providibg additional flag using:

/root/Downloads/COMMON/bin/mpicxx   -fPIC -Wall -fPIC -fopenmp -g -DDEBUG  -Wl,-rpath  -Wl,/root/Downloads/COMMON/lib  -Wl,--enable-new-dtags -lX11  CMakeFiles/oofem.dir/src/main/main.C.o  -o oofem -rdynamic liboofem.so -ldl -Wl,-Bstatic -lfftw3_mpi -lfftw3 -lparmetis -lmetis -llapack -lblas -lpetsc -Wl,-Bdynamic -lmpicxx -lmpi -Wl,-rpath,/root/Downloads/oofem-2.3/build

what needs to be done in this case to auto link fftw3_mpi & parmetis libraries?

Update: 
sed -i 's/-llapack/ -lfftw3_mpi -lfftw3 -lparmetis -lmetis -llapack/g' CMakeFiles/oofem.dir/link.txt just after configure (& before make) fixes this issue!

11 (edited by Singh.Puneet 03-06-2015 08:04:45)

Re: poofem-2.3 build fails with PETSC3.X.X

Try3:
again on a rebuild , i got stuck at :

[ 65%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
[  7%] Built target fm
[ 49%] Built target sm
[ 50%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
Fail to install OOFEM

what might be the error cause here ?

P.S. i know i have posted too many errors today
but i really want to get the oofem installed !

Re: poofem-2.3 build fails with PETSC3.X.X

GCC 4.4 series is to old to compile OOFEM since we make use of C++11 features nowdays. I believe 4.7 series will work (definitely 4.8, and maybe even 4.6)



Linking static libraries requires the libraries to appear after the use (the linker isn't smart, it only parses one-way).
I believe this is the common error when you do
gcc file_uses_Foobar.o -lFoobar
will work, while
gcc -lFoobar file_uses_Foobar.o
will not.
Same applies to libraries (cyclic dependencies sometimes requires the flags to be duplicated).
This only happens with static libraries, and, well, is mostly a result of piecing together the compile line with exporting system variables. These should really be part of the configuration step. If fft is missing from the linking, then it should have been part of the pkgconfig file PETSc.pc

13 (edited by Singh.Puneet 03-06-2015 08:04:26)

Re: poofem-2.3 build fails with PETSC3.X.X

For the time being i heve to stick with gcc 4.4.7 .
I seem to have found a fix for my TRY2(fftw undefined reference),
i guess i now need a fix for just the quoted error, & it seems the following issue arises when i use :  USE_SLEPC="ON"  (i am using slepc3.3-p4+ PetSC3.3). I guess this is due to API version incompatibility.
Now i need a fix so that SlepC must be compatible with PETSc-3.3 as well as oofem2.3. (though i'll also contact Slepc developers )

Singh.Puneet wrote:

Try3:
again on a rebuild , i got stuck at :

[ 65%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
[  7%] Built target fm
[ 49%] Built target sm
[ 50%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2

Re: poofem-2.3 build fails with PETSC3.X.X

i contacted slepc team regarding this issue,Their reply was:

"We made the SLEPc-OOFEM interface back in 2009 (slepc-3.0). Later, in slepc-3.2, there was a change in the argument of EPSDestroy(). This means that the OOFEM developers did not update the SLEPc-OOFEM interface to version 3.3 - maybe they updated the PETSc part only."
-Jose E. Roman (jroman@dsic.upv.es)

Singh.Puneet wrote:

Try3:
again on a rebuild , i got stuck at :

[ 65%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
[  7%] Built target fm
[ 49%] Built target sm
[ 50%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
Fail to install OOFEM

what might be the error cause here ?

P.S. i know i have posted too many errors today
but i really want to get the oofem installed !

Re: poofem-2.3 build fails with PETSC3.X.X

Since no developers are (currently) looking at eigenvalue problems, it's a high risk of it being neglected.
I don't recall exactly what we the situation was for the 2.3 release, but it seems likely that it's exactly as Jose claims.

I don't think there are major changes involved (there are very few calls to SLEPc to begin with), in this case, removing the pointer on a few variables.
I think it's fixed in the git-version of OOFEM, but I haven't checked recently. You can compare the files and probably easily fix it.

16 (edited by Singh.Puneet 03-06-2015 13:39:09)

Re: poofem-2.3 build fails with PETSC3.X.X

I'll now try updating source of oofem-2.3 ,
meanwhile I compiled oofem by incrementally adding dependencies ,and verified that the following oofem-2.3 error creeps in only when i link PETSc-3.3-p4 with hdf5 !

Singh.Puneet wrote:

Thankyou very much for a prompt reply. My previous build was successful
However ,i retried build at some other path on a new machine, i was able to configure on new machine properly using:,

C_INCLUDE_PATH=$user1_install_path/Application_Dependencies/include/:$C_INCLUDE_PATH OOFEM_TARGET="poofem-release" PETSC_DIR=$user1_install_path/Application_Dependencies cmake -DPYTHON_EXECUTABLE=$user1_install_path/bin/python3 -DPYTHON_INCLUDE_DIR=$user1_install_path/include -DCMAKE_INSTALL_PREFIX:PATH=$user1_install_path/ -DCMAKE_C_COMPILER=$MPIC_COMP -DCMAKE_CXX_COMPILER=$MPICXX_COMP -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC" -DUSE_IML="ON" -DIML_DIR=$user1_install_path/Application_Dependencies/include/ -DCKIT_DIR=$user1_install_path/Application_Dependencies -DELIXIR_DIR=$user1_install_path/Application_Dependencies -DUSE_PARALLEL="ON" -DUSE_SLEPC="ON" -DSLEPC_DIR=$user1_install_path/Application_Dependencies -DUSE_PETSC="ON" -DMY_PETSC_DIR=$user1_install_path/Application_Dependencies -DMY_PETSC_ARCH=x86_64 -DUSE_LAPACK="ON" -DLAPACK_DIR=$user1_install_path/Application_Dependencies/lib -DX11_DIR="/usr/lib64/:$user1_install_path/Application_Dependencies/lib" -DCMAKE_LIBRARY_PATH="/usr/lib64/:/usr/lib64/X11:/usr/lib/:$user1_install_path/Application_Dependencies/lib:$LD_LIBRARY_PATH" -DCMAKE_EXE_LINKER_FLAGS="-lX11" -DUSE_OPENMP="ON" -DMETIS_DIR=$user1_install_path/Application_Dependencies -DPARMETIS_DIR=$user1_install_path/Application_Dependencies  ..

but while make(ing) i am facing fresh  errors:

make
Scanning dependencies of target fm
[  0%] Building CXX object src/fm/CMakeFiles/fm.dir/fluidmodel.C.o
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/xmmintrin.h:36,
                 from /opt/user1/user1_Installed/Application_Dependencies/include/petscsys.h:1693,
                 from /opt/user1/user1_Installed/Application_Dependencies/include/petscis.h:7,
                 from /opt/user1/user1_Installed/Application_Dependencies/include/petscvec.h:9,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/petsccontext.h:41,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/engngm.h:65,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/fm/fluidmodel.h:38,
                 from /opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/fm/fluidmodel.C:35:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/mmintrin.h: In function ‘__m64 _mm_cvtsi32_si64(int)’:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/mmintrin.h:62: error: can't convert between vector values of different size
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include/mmintrin.h: In function ‘int _mm_cvtsi64_si32(__m64)’:

attached: oofem_make.log


where i may be going wrong this time ?
The configure options are almost the same as i had (succesfully) used previously!

Re: poofem-2.3 build fails with PETSC3.X.X

Well, I'm not sure why you need HDF5. For use with OOFEM, there are no additional features you obtain by adding HDF5 (same applies to many of the other dependencies you have added). I've never built PETSc with HDF5 support.
OOFEM only uses PETSc for the solver.

There are example projects for PETSc that you could try and compile (I think you would get the same linking error). OOFEM does nothing with HDF5, and doesn't touch any XMM code either.

Re: poofem-2.3 build fails with PETSC3.X.X

With following changes i was able to install OOFEM without any error!

       sed -i "s:EPSDestroy(eps);:EPSDestroy(\&eps);:g"  oofem-2.3/src/oofemlib/slepcsolver.C
        sed -i "s:VecDestroy(Vr):VecDestroy(\&Vr):g"          oofem-2.3/src/oofemlib/slepcsolver.C
        sed -i "s:VecDestroy(Vr2);:VecDestroy(\&Vr2);:g"   oofem-2.3/src/oofemlib/slepcsolver.C
     
       sed -i 's/-llapack/ -lslepc -lparpack -larpack -lprimme -ltrlan_mpi -ltrlan -lblzpack -lfftw3_mpi -lfftw3 -lparmetis -lmetis -llapack -lmpifort -lmpi/g' oofem-2.3/mybuild/CMakeFiles/oofem.dir/link.txt

Is this fine ? or am i supposed to get errors in functionality later at runtime ?

Singh.Puneet wrote:

Try3:
again on a rebuild , i got stuck at :

[ 65%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
[  7%] Built target fm
[ 49%] Built target sm
[ 50%] Building CXX object src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In destructor ‘virtual oofem::SLEPcSolver::~SLEPcSolver()’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:58: error: cannot convert ‘_p_EPS*’ to ‘_p_EPS**’ for argument ‘1’ to ‘PetscErrorCode EPSDestroy(_p_EPS**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C: In member function ‘virtual oofem::NM_Status oofem::SLEPcSolver::solve(oofem::SparseMtrx*, oofem::SparseMtrx*, oofem::FloatArray*, oofem::FloatMatrix*, double, int)’:
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:225: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
/opt/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.C:228: error: cannot convert ‘_p_Vec*’ to ‘_p_Vec**’ for argument ‘1’ to ‘PetscErrorCode VecDestroy(_p_Vec**)’
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/slepcsolver.C.o] Error 1
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2
Fail to install OOFEM

what might be the error cause here ?

P.S. i know i have posted too many errors today
but i really want to get the oofem installed !

Re: poofem-2.3 build fails with PETSC3.X.X

These changes seem reasonable.

20 (edited by Singh.Puneet 27-06-2015 12:49:40)

Re: poofem-2.3 build fails with PETSC3.X.X

i was able to install oofem with gnu compilers ,
when i tried the installation with intel compilers , i end  up with :

Scanning dependencies of target core
make[2]: Leaving directory `/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild'
make -f src/oofemlib/CMakeFiles/core.dir/build.make src/oofemlib/CMakeFiles/core.dir/build
make[2]: Entering directory `/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild'
/share/apps/user1/user1_Installed/Application_Dependencies/bin/cmake -E cmake_progress_report /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild/CMakeFiles
[  7%] Building CXX object src/oofemlib/CMakeFiles/core.dir/classfactory.C.o
cd /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild/src/oofemlib && /share/apps/intel/impi/5.0.3.048/intel64/bin/mpiicpc   -DMPICH_IGNORE_CXX_SEEK -D__FM_MODULE -D__LAPACK_MODULE -D__PARALLEL_MODE -D__PETSC_MODULE -D__SLEPC_MODULE -D__SM_MODULE -D__TM_MODULE -Dliboofem_EXPORTS -fPIC -Wall -fPIC  -DDEBUG -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/xfem -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/iga -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/fm -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/tm -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/tm/cemhyd -I/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/sm -I/share/apps/user1/user1_Installed/Application_Dependencies/include -I/root/Downloads/MPICH3/include -I/share/apps/intel/impi/5.0.3.048/intel64/include    -o CMakeFiles/core.dir/classfactory.C.o -c /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/classfactory.C
In file included from /share/apps/user1/user1_Installed/Application_Dependencies/include/slepcsys.h(33),
                 from /share/apps/user1/user1_Installed/Application_Dependencies/include/slepceps.h(26),
                 from /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.h(42),
                 from /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/classfactory.C(56):
/share/apps/user1/user1_Installed/Application_Dependencies/include/slepcconf.h(1): error: the #endif for this directive is missing
  #if !defined(__SLEPCCONF_H)
^

compilation aborted for /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/classfactory.C (code 2)
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/classfactory.C.o] Error 2
make[2]: Leaving directory `/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild'
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make[1]: Leaving directory `/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild'
make: *** [all] Error 2
[  7%] Built target fm
[  7%] Building CXX object src/oofemlib/CMakeFiles/core.dir/classfactory.C.o
In file included from /share/apps/user1/user1_Installed/Application_Dependencies/include/slepcsys.h(33),
                 from /share/apps/user1/user1_Installed/Application_Dependencies/include/slepceps.h(26),
                 from /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/slepcsolver.h(42),
                 from /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/classfactory.C(56):
/share/apps/user1/user1_Installed/Application_Dependencies/include/slepcconf.h(1): error: the #endif for this directive is missing
  #if !defined(__SLEPCCONF_H)
   ^

compilation aborted for /share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/src/oofemlib/classfactory.C (code 2)
make[2]: *** [src/oofemlib/CMakeFiles/core.dir/classfactory.C.o] Error 2
make[1]: *** [src/oofemlib/CMakeFiles/core.dir/all] Error 2
make: *** [all] Error 2

The file is:

#if !defined(__SLEPCCONF_H)
#define __SLEPCCONF_H

$$3

#ifndef SLEPC_LIB_DIR
#define SLEPC_LIB_DIR "/share/apps/user1/user1_Installed/Application_Dependencies/lib"
#endif

#ifndef SLEPC_HAVE_ARPACK
#define SLEPC_HAVE_ARPACK 1
#define SLEPC_ARPACK_HAVE_UNDERSCORE 1
#endif

#ifndef SLEPC_HAVE_BLZPACK
#define SLEPC_HAVE_BLZPACK 1
#define SLEPC_BLZPACK_HAVE_UNDERSCORE 1
#endif

#ifndef SLEPC_HAVE_TRLAN
#define SLEPC_HAVE_TRLAN 1
#define SLEPC_TRLAN_HAVE_UNDERSCORE 1
#endif

$$4

so should i place #endif at $$3 or $$4 ? (nested or non nested!)


though i tried putting #endif at $$3 i get :
CMakeFiles/oofem.dir/src/main/main.C.o: In function `oofem_finalize_modules()':
main.C:(.text+0x2d67): undefined reference to `SlepcFinalize'
liboofem.so: undefined reference to `EPSSetWhichEigenpairs'
liboofem.so: undefined reference to `EPSCreate'
liboofem.so: undefined reference to `STSetType'
liboofem.so: undefined reference to `EPSGetConvergedReason'
liboofem.so: undefined reference to `EPSDestroy'
liboofem.so: undefined reference to `EPSGetConverged'
liboofem.so: undefined reference to `STSetMatStructure'
liboofem.so: undefined reference to `EPSGetST'
liboofem.so: undefined reference to `EPSSetOperators'
liboofem.so: undefined reference to `EPSSetDimensions'
liboofem.so: undefined reference to `EPSSetFromOptions'
liboofem.so: undefined reference to `EPSSetProblemType'
liboofem.so: undefined reference to `EPSGetIterationNumber'
liboofem.so: undefined reference to `EPSGetEigenpair'
liboofem.so: undefined reference to `EPSSolve'
liboofem.so: undefined reference to `EPSSetTolerances'
make[2]: *** [oofem] Error 1
make[2]: Leaving directory `/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild'
make[1]: *** [CMakeFiles/oofem.dir/all] Error 2
make[1]: Leaving directory `/share/apps/user1-INTEL/finaluser1/ToolsInstaller/Mechanical/OOFEM/oofem-2.3/cdacbuild'
make: *** [all] Error 2
[  7%] Built target fm
[ 51%] Built target core
[ 93%] Built target sm
[100%] Built target tm
[100%] Built target liboofem
Linking CXX executable oofem
CMakeFiles/oofem.dir/src/main/main.C.o: In function `main':
main.C:(.text+0xc85): undefined reference to `SlepcInitialize'
CMakeFiles/oofem.dir/src/main/main.C.o: In function `oofem_finalize_modules()':
main.C:(.text+0x2d67): undefined reference to `SlepcFinalize'
liboofem.so: undefined reference to `EPSSetWhichEigenpairs'
liboofem.so: undefined reference to `EPSCreate'
liboofem.so: undefined reference to `STSetType'
liboofem.so: undefined reference to `EPSGetConvergedReason'
liboofem.so: undefined reference to `EPSDestroy'
liboofem.so: undefined reference to `EPSGetConverged'
liboofem.so: undefined reference to `STSetMatStructure'
liboofem.so: undefined reference to `EPSGetST'
liboofem.so: undefined reference to `EPSSetOperators'
liboofem.so: undefined reference to `EPSSetDimensions'
liboofem.so: undefined reference to `EPSSetFromOptions'
liboofem.so: undefined reference to `EPSSetProblemType'
liboofem.so: undefined reference to `EPSGetIterationNumber'
liboofem.so: undefined reference to `EPSGetEigenpair'
liboofem.so: undefined reference to `EPSSolve'
liboofem.so: undefined reference to `EPSSetTolerances'
make[2]: *** [oofem] Error 1
make[1]: *** [CMakeFiles/oofem.dir/all] Error 2
make: *** [all] Error 2

also /share/apps/user1/user1_Installed/Application_Dependencies/lib/libslepc.a| grep SlepcInitialize
                 U SlepcInitializeCalled
                 U SlepcInitialize_LogEvents
                 U SlepcInitialize_Packages
0000000000000000 T SlepcInitializeFortran
I guess this function is not there in libslepc.a ,
Then WHY GCC not showed the same error  ?
###############################################UPDATE##############################

i have reported this issue to slepc developers!
the slepc configure script did not generate headers properly with icc compilers!
manually edited the slepcconf.h file and put the #endif at the end of file ($$4) solved the issue!