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

libpetsc.so: undefined symbol: _SCOTCHintRandVal

+2 votes

Hello,

I'm currently attempting to install fenics on one of our cluster machines. So far I have managed to build fenics using dorsal. I then proceed to install petsc4py using pip and virtualenv (by pointing my PETSC_DIR at the fenics installation).

When I'm done I can import dolfin in my scripts, however when I attempt to import petsc4py I receive the following exception.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-f4a6ff127338> in <module>()
----> 1 from petsc4py import PETSc

/exports/work/geos_eps_williams/FEniCS/petsc4py/lib/python2.6/site-packages/petsc4py/PETSc.pyc in <module>()
      1 ARCH = None
      2 from petsc4py.lib import ImportPETSc
----> 3 PETSc = ImportPETSc(ARCH)
      4 PETSc._initialize()
      5 del PETSc

/exports/work/geos_eps_williams/FEniCS/petsc4py/lib/python2.6/site-packages/petsc4py/lib/__init__.pyc in ImportPETSc(arch)
     27     """
     28     path, arch = getPathArchPETSc(arch)
---> 29     return Import('petsc4py', 'PETSc', path, arch)
     30 
     31 def getPathArchPETSc(arch=None):

/exports/work/geos_eps_williams/FEniCS/petsc4py/lib/python2.6/site-packages/petsc4py/lib/__init__.pyc in Import(pkg, name, path, arch)
     62     pathlist = [os.path.join(path, arch)]
     63     fo, fn, stuff = imp.find_module(name, pathlist)
---> 64     module = imp.load_module(fullname, fo, fn, stuff)
     65     module.__arch__ = arch # save arch value
     66     setattr(sys.modules[pkg], name, module)

ImportError: /exports/work/geos_eps_williams/FEniCS/fenics1/install/lib/libpetsc.so: undefined symbol: _SCOTCHintRandVal

My platform file looks like the following. Incidentally if I uncomment slepc, the fenics build fails with a similar error message, i.e. the the slepc build fails because of the same undefined symbol in libpetsc.so.

# Fedora 14

# This build script assumes that you have several packages already
# installed via Fedora's yum using the following command:
#
# su -c 'yum install -y redhat-lsb bzr bzrtools subversion \
# libxml2-devel gcc gcc-c++ openmpi-devel openmpi numpy swig wget \
# vtk-python atlas-devel suitesparse-devel blas-devel \
# lapack-devel cln-devel ginac-devel python-devel cmake \
# ScientificPython mpfr-devel armadillo-devel gmp-devel CGAL-devel \
# cppunit-devel flex'
#
# If you have multiple MPI libraries installed, make sure the
# appropriate version is selected. For this, on a 32-bit operating
# system, run:
#
# module load openmpi-i386
#
# or on a 64-bit operating system, run:
#
# module load openmpi-x86_64
#
# After Dorsal has completed, please make sure the following
# environment variable is set before running any Python DOLFIN
# programs:
#
# export BOOST_DIR=${INSTALL_PATH}
#
# Also, if you are using SELinux, you may need to disable it to run
# DOLFIN programs.
##

# Platform specific variables
default PETSC_ARCH=linux-gnu-cxx-opt
default SCOTCH_ARCH=pc_linux2
default UMFPACK_INCLUDE_DIR=/usr/include/suitesparse

# Define the packages this platform needs
PACKAGES=(
boost
swig
vtkdata
vtk
parmetis
scotch
trilinos
petsc
#slepc
# swiginac
cgal
scientificpython
fiat
ferari
ufc
ufl
ffc
# syfi
viper
instant
dolfin
)

My os is scientific linux (SE6). Any help would be greatly appreciated!

Kind regards
Les

asked Jun 28, 2013 by lnagy FEniCS Novice (250 points)

undefined symbol: _SCOTCHintRandVal probably means that SCOTCH library is not found or wrong version is found. Adjust your LD_LIBRARY_PATH. Did you compile all the FEniCS dependencies against same SCOTCH?

My LD_LIBRARY_PATH seems correct in that it contains the directory with all the fenics libraries. In particular it contains libpetsc.so. Checking with nm reveals that _SCOTCHintRandVal is an undefined symbol in this library.

$> nm libpetsc.so | grep _SCOTCHintRandVal
                 U _SCOTCHintRandVal

The same directory also contains libscotch.a which does seem to define the symbol but is a static library so it won't be affected by LD_LIBRARY_PATH (if I have that correct).

I build FEniCS using dorsal, so I assume that dependencies are compiled against the same scotch. When I build petsc4py, I change my PETSC_DIR variable to point at my FEniCS install location, so I also assume that it is built against those libraries.

Hello. I am trying to build FEniCS from dorsal on Scientific Linux 6.4,
and seem to have run into the same problem as you: the build of slepc fails
with the message

libpetsc.so: undefined symbol: _SCOTCHintRandVal

Did you figure how a way around this (other than not building slepc)?

Thanks -- Doug

EDIT: converted to comment. Jan Blechta

Comment changed to answer, please see below.

@Inagy, can you convert this into answer as this solves the problem (although not ideally).

Hi Jan, Is there way for me to 'upgrade' a comment to an answer, or should I just copy/paste an answer and hide the comment?

Now I see that only downgrade from answer to comment is supported... Click edit and copy source of comment...

2 Answers

0 votes
 
Best answer

Hello,

I'm afraid I wasn't able to figure out why dorsal was building the PETSc libraries with undefined SCOTCH symbols. My solution was to build all dependencies manually and then to build and install dolfin myself. Strangely, building PETSc manually resulted in a shared object which didn't produce this error - though I'm not sure why since I believe I build PETSc in the same manner as dorsal. For completeness my configure options for PETSc look like (taken from configure.log):

--configModules=PETSc.Configure
--optionsModule=PETSc.compilerOptions
--download-umfpack=1
--download-hypre=1
--download-mumps=1
--download-scalapack=1
--download-blacs=1
--download-ptscotch=1
--download-scotch=1
--download-metis=1
--download-parmetis=1
--download-sundials=1
--with-debugging=0
--with-shared-libraries=1
--with-clanguage=cxx
--with-c-support-1
--with-mpi-dir=[some_dir_to_mpi]
--prefix=[some_dir_to_install]
COPTFLAGS=O2

I think that the only difference is that I build PETSc with sundials support (though this didn't make any difference when I was playing around with trying to get things to work). Perhaps one of the dorsal devs could comment on the PETSc options used?

answered Jul 21, 2013 by lnagy FEniCS Novice (250 points)
selected Jul 21, 2013 by Jan Blechta

I had a similiar issue on SE6 and solved in the same way: building manually petsc, slepc, and tao.

+2 votes

I found out how to tell petsc not to build its own, older version of scotch (5.1.12b_esmumps), and instead use the one built by dorsal (6.0.0_esmumps). For details see this Q&A. With this change I was able to build a complete fenics, including slepc, via dorsal on ScientificLinux 6.4.

answered Jul 24, 2013 by dnarnold FEniCS User (2,360 points)
...