This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

dorsal build of slepc fails

+2 votes

I am trying to build FEniCS 1.2.0 using dorsal with rhel6 platform package (I am using
Scientific Linux 6.4). I successfully compiled the packages through petsc, but
then slepc fails with the message

    Checking environment...
Checking PETSc installation...
ERROR: Unable to link with PETSc
ERROR: See "arch-installed-petsc/conf/configure.log" file for details
Failure with exit status: 1
Exit message: There was a problem configuring slepc-3.3-p3.

The file arch-installed-petsc/conf/configure.log shows that the problem was

/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib/libpetsc.so: undefined reference to `_SCOTCHintRandVal'

Any help would be appreciated! Here is the whole arch-installed-petsc/conf/configure.log:

PETSc install directory: /home/faculty/arnold/fenics/FEniCS-sl6-1.2.0
PETSc version: 3.3
PETSc architecture: arch-installed-petsc
SLEPc source directory: /home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/src/slepc-3.3-p3
SLEPc install directory: /home/faculty/arnold/fenics/FEniCS-sl6-1.2.0
================================================================================
Checking PETSc installation...
#include "petscksp.h"
EXTERN_C_BEGIN
EXTERN_C_END
int main() {
PetscInitialize(PETSC_NULL,PETSC_NULL,PETSC_NULL,PETSC_NULL);
VecCreate(PETSC_NULL,PETSC_NULL);
MatCreate(PETSC_NULL,PETSC_NULL);
KSPCreate(PETSC_NULL,PETSC_NULL);
return 0;
}
make: Entering directory `/tmp/slepc-P8ZEaA'
mpicxx -o checklink.o -c -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O -fPIC -I/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/include -I/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/include -I/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/include/trilinos -I/usr/include/openmpi-i386 -D__INSDIR__=./ checklink.c
mpicxx -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -O   -o checklink checklink.o  -Wl,-rpath,/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib -L/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib  -lpetsc -lX11 -lpthread -Wl,-rpath,/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib -lcmumps -ldmumps -lsmumps -lzmumps -lmumps_common -lpord -lparmetis -lmetis -Wl,-rpath,/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib -L/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib -lml -lscalapack -lblacs -lHYPRE -lptesmumps -lptscotch -lptscotcherr -lumfpack -lamd -llapack -lblas -Wl,-rpath,/usr/lib/openmpi/lib -L/usr/lib/openmpi/lib -Wl,-rpath,/usr/lib/gcc/i686-redhat-linux/4.4.7 -L/usr/lib/gcc/i686-redhat-linux/4.4.7 -lmpi_f90 -lmpi_f77 -lgfortran -lm -lm -lmpi_cxx -lstdc++ -lrt -lm -lz -lz -lmpi_cxx -lstdc++ -ldl -lmpi -lgcc_s -lpthread -ldl 
/home/faculty/arnold/fenics/FEniCS-sl6-1.2.0/lib/libpetsc.so: undefined reference to `_SCOTCHintRandVal'
collect2: ld returned 1 exit status
make: *** [checklink] Error 1
make: Leaving directory `/tmp/slepc-P8ZEaA'
ERROR: Unable to link with PETSc
asked Jul 19, 2013 by dnarnold FEniCS User (2,360 points)

Indeed it is, thanks for pointing that out. So now two of us can't build FEniCS correctly
under Scientific Linux 6. Anyone have a suggestion?

I suggest asking Johannes Ring on mailing list.

Try uncommenting line

/* #define intRandVal               _SCOTCHintRandVal Already a macro */

in scotch_6.0.0_esmumps\src\esmumps\module.h. I don't know why is it outcommented at all but it could help. Also note that there may be some version conflicts as used pestc.package may download its own SCOTCH. You may try switching to petsc-hpc.package.

Also note that there may be some version conflicts as used pestc.package may download its own SCOTCH.

It seems like that. I checked libscotch.so of versions 5.1.12 and 6.0.0 and latter defines _SCOTCHintRandVal while former not. PETSc-3.3 pulled by dorsal probably downloads automatically SCOTCH version 5.1.12 while you install 6.0.0 and link some libraries against it.

1 Answer

+2 votes
 
Best answer

Indeed the problem was that petsc builds its own version of the scotch libraries using
version 5.1.12b_esmumps (thanks, Jan). I fixed this by creating a petsc-local-scotch.package file and replacing "petsc" with "petsc-local-scotch" in my dorsal platform file. The new package file tells petsc not to build a new scotch but rather to use the one already created by dorsal. Below is the file petsc-local-scotch.package. Together with a couple of other fixes (one to build the boost libraries, and a modification of the include dirs for trilinos), this enabled a complete build fenics of fenics on ScientificLinux 6.4.

NAME=petsc-3.3-p6
SOURCE=http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/
PACKING=.tar.gz
BUILDCHAIN=autotools
MAKEOPTS="PETSC_DIR=\${PWD} PETSC_ARCH=${PETSC_ARCH}"
TARGETS=(all install)

CONFOPTS="COPTFLAGS=-O2
          --with-debugging=0 --with-shared-libraries=1
          --with-clanguage=cxx --with-c-support=1"

if [ "${SCOTCH_DIR}" ]; then
    CONFOPTS="${CONFOPTS} --with-ptscotch=1
                          --with-ptscotch-include=${SCOTCH_DIR}/include
                          --with-ptscotch-lib=[${SCOTCH_DIR}/lib/libptesmumps.a,${SCOTCH_DIR}/lib/libptscotch.a,${SCOTCH_DIR}/lib/libptscotcherr.a,${SCOTCH_DIR}/lib/libscotch.a,${SCOTCH_DIR}/lib/libscotcherr.a]"
    for external_pkg in umfpack hypre mumps scalapack blacs metis parmetis; do
        CONFOPTS="${CONFOPTS} --download-${external_pkg}=1"
    done
else
    for external_pkg in umfpack hypre mumps scalapack blacs ptscotch scotch metis parmetis; do
        CONFOPTS="${CONFOPTS} --download-${external_pkg}=1"
    done
fi

if [ "${TRILINOS_DIR}" ]; then
    CONFOPTS="${CONFOPTS} --with-ml=1
              --with-ml-lib=${TRILINOS_DIR}/lib/libml.so
              --with-ml-include=${TRILINOS_DIR}/include/trilinos"
fi

if [ "${CUDA_DIR}" ] && [ "${CUSP_DIR}" ]; then
    CONFOPTS="${CONFOPTS} --with-cuda=1 --with-cuda-dir=${CUDA_DIR}
    --with-cusp=1 --with-cusp-dir=${CUSP_DIR}
    --with-thrust=1 --with-thrust-dir=${CUDA_DIR}/include"
fi

package_specific_register () {
    export PETSC_DIR=${INSTALL_PATH}
    unset PETSC_ARCH
}
answered Jul 24, 2013 by dnarnold FEniCS User (2,360 points)

I've created a Dorsal bug report that links to this question:

https://bitbucket.org/fenics-project/dorsal/issue/9/linking-problem-with-petsc-and-scotch

...