dorsal-built Dolfin not importing

Asked by Bento

Hi,
I just compiled the whole latest FEniCS package on Maverick using the development version of Dorsal. However now Dolfin does not import into Python. I sourced dolfin.conf, but when I try to load Dolfin, I get the error below. Can someone help me with that?
Thank you!

In [1]: from dolfin import *
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)

/home/bento/dorsal/dorsal/<ipython console> in <module>()

/home/bento/FEniCS/lib/python2.6/site-packages/dolfin/__init__.pyc in <module>()
     11
     12 # Import names from the compiled cpp module

---> 13 from dolfin.cppimports import *
     14 from dolfin.cppimports import __version__, __swigversion__
     15

/home/bento/FEniCS/lib/python2.6/site-packages/dolfin/cppimports.py in <module>()
      2
      3 #--- Imports the SWIG-generated Python code (C++ interface) ---

----> 4 import dolfin.cpp as cpp
      5 __swigversion__ = cpp.__swigversion__
      6 __version__ = cpp.__dolfinversion__

/home/bento/FEniCS/lib/python2.6/site-packages/dolfin/cpp.py in <module>()
     26 fp.close()
     27 return _mod
---> 28 _cpp = swig_import_helper()
     29 del swig_import_helper
     30 else:

/home/bento/FEniCS/lib/python2.6/site-packages/dolfin/cpp.py in swig_import_helper()
     22 if fp is not None:
     23 try:
---> 24 _mod = imp.load_module('_cpp', fp, pathname, description)
     25 finally:
     26 fp.close()

ImportError: /home/bento/FEniCS/lib/libdolfin.so.1.0: undefined symbol: _ZN5boost11filesystem36detail6statusERKNS0_4pathEPNS_6system10error_codeE

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Bento
Solved:
Last query:
Last reply:
Revision history for this message
Johannes Ring (johannr) said :
#1

Did you set Dorsal to build Boost in your .platform file? Do you have any Boost libraries in /home/bento/FEniCS/lib?

What is the output of the following command after you source dolfin.conf?

  ldd /home/bento/FEniCS/lib/libdolfin.so.1.0

Revision history for this message
Bento (tbarmeier-deactivatedaccount) said :
#2

Yes, I set it to build Boost and the Boost libraries are there.

The output is

 linux-vdso.so.1 => (0x00007fff9d3ff000)
 libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00007fdac7ebd000)
 libarmadillo.so.0 => /usr/lib/libarmadillo.so.0 (0x00007fdac7cbb000)
 libboost_filesystem.so.1.42.0 => /usr/lib/libboost_filesystem.so.1.42.0 (0x00007fdac7aa5000)
 libboost_program_options.so.1.42.0 => /usr/lib/libboost_program_options.so.1.42.0 (0x00007fdac784a000)
 libboost_system.so.1.42.0 => /usr/lib/libboost_system.so.1.42.0 (0x00007fdac7646000)
 libboost_thread.so.1.42.0 => /usr/lib/libboost_thread.so.1.42.0 (0x00007fdac7430000)
 libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0 (0x00007fdac7214000)
 liblocathyra.so => /home/bento/FEniCS/lib/liblocathyra.so (0x00007fdac6fb3000)
 liblocaepetra.so => /home/bento/FEniCS/lib/liblocaepetra.so (0x00007fdac6c91000)
 libloca.so => /home/bento/FEniCS/lib/libloca.so (0x00007fdac6722000)
 libnoxthyra.so => /home/bento/FEniCS/lib/libnoxthyra.so (0x00007fdac648d000)
 libnoxepetra.so => /home/bento/FEniCS/lib/libnoxepetra.so (0x00007fdac61cd000)
 libnox.so => /home/bento/FEniCS/lib/libnox.so (0x00007fdac5eeb000)
 libanasazitpetra.so => /home/bento/FEniCS/lib/libanasazitpetra.so (0x00007fdac5cd8000)
 libModeLaplace.so => /home/bento/FEniCS/lib/libModeLaplace.so (0x00007fdac5a9b000)
 libanasaziepetra.so => /home/bento/FEniCS/lib/libanasaziepetra.so (0x00007fdac587e000)
 libanasazi.so => /home/bento/FEniCS/lib/libanasazi.so (0x00007fdac567b000)
 libstratimikos.so => /home/bento/FEniCS/lib/libstratimikos.so (0x00007fdac5275000)
 libstratimikosbelos.so => /home/bento/FEniCS/lib/libstratimikosbelos.so (0x00007fdac5062000)
 libstratimikosaztecoo.so => /home/bento/FEniCS/lib/libstratimikosaztecoo.so (0x00007fdac4de6000)
 libstratimikosamesos.so => /home/bento/FEniCS/lib/libstratimikosamesos.so (0x00007fdac4b98000)
 libstratimikosml.so => /home/bento/FEniCS/lib/libstratimikosml.so (0x00007fdac494c000)
 libstratimikosifpack.so => /home/bento/FEniCS/lib/libstratimikosifpack.so (0x00007fdac46ff000)
 libbelostpetra.so => /home/bento/FEniCS/lib/libbelostpetra.so (0x00007fdac44eb000)
 libbelosepetra.so => /home/bento/FEniCS/lib/libbelosepetra.so (0x00007fdac41ee000)
 libbelos.so => /home/bento/FEniCS/lib/libbelos.so (0x00007fdac3feb000)
 libml.so => /home/bento/FEniCS/lib/libml.so (0x00007fdac3b05000)
 libkomplex.so => /home/bento/FEniCS/lib/libkomplex.so (0x00007fdac38ea000)
 libifpack.so => /home/bento/FEniCS/lib/libifpack.so (0x00007fdac354c000)
 libamesos.so => /home/bento/FEniCS/lib/libamesos.so (0x00007fdac32d1000)
 libgaleri.so => /home/bento/FEniCS/lib/libgaleri.so (0x00007fdac308e000)
 libaztecoo.so => /home/bento/FEniCS/lib/libaztecoo.so (0x00007fdac2dff000)
 libdpliris.so => /home/bento/FEniCS/lib/libdpliris.so (0x00007fdac2bf4000)
 libisorropia.so => /home/bento/FEniCS/lib/libisorropia.so (0x00007fdac295a000)
 libthyraepetraext.so => /home/bento/FEniCS/lib/libthyraepetraext.so (0x00007fdac26be000)
 libthyraepetra.so => /home/bento/FEniCS/lib/libthyraepetra.so (0x00007fdac235c000)
 libthyracore.so => /home/bento/FEniCS/lib/libthyracore.so (0x00007fdac213a000)
 libepetraext.so => /home/bento/FEniCS/lib/libepetraext.so (0x00007fdac1e38000)
 libtpetraext.so => /home/bento/FEniCS/lib/libtpetraext.so (0x00007fdac1c24000)
 libtpetrainout.so => /home/bento/FEniCS/lib/libtpetrainout.so (0x00007fdac19fe000)
 libtpetra.so => /home/bento/FEniCS/lib/libtpetra.so (0x00007fdac17c0000)
 libtriutils.so => /home/bento/FEniCS/lib/libtriutils.so (0x00007fdac1578000)
 libzoltan.so => /home/bento/FEniCS/lib/libzoltan.so (0x00007fdac127b000)
 libepetra.so => /home/bento/FEniCS/lib/libepetra.so (0x00007fdac0f6f000)
 libkokkoslinalg.so => /home/bento/FEniCS/lib/libkokkoslinalg.so (0x00007fdac0d6c000)
 libkokkosnodeapi.so => /home/bento/FEniCS/lib/libkokkosnodeapi.so (0x00007fdac0b50000)
 libkokkos.so => /home/bento/FEniCS/lib/libkokkos.so (0x00007fdac094e000)
 librtop.so => /home/bento/FEniCS/lib/librtop.so (0x00007fdac073a000)
 libtpi.so => /home/bento/FEniCS/lib/libtpi.so (0x00007fdac0533000)
 libteuchos.so => /home/bento/FEniCS/lib/libteuchos.so (0x00007fdabff17000)
 libslepc.so => /home/bento/FEniCS/lib/libslepc.so (0x00007fdabfc49000)
 libpetsc.so => /home/bento/FEniCS/lib/libpetsc.so (0x00007fdabef85000)
 libatlas.so.3gf => /usr/lib/libatlas.so.3gf (0x00007fdabea79000)
 libumfpack.so.5.4.0 => /usr/lib/libumfpack.so.5.4.0 (0x00007fdabe7b7000)
 libamd.so.2.2.0 => /usr/lib/libamd.so.2.2.0 (0x00007fdabe5ad000)
 libcholmod.so.1.7.1 => /usr/lib/libcholmod.so.1.7.1 (0x00007fdabe2ae000)
 libcamd.so.2.2.0 => /usr/lib/libcamd.so.2.2.0 (0x00007fdabe0a2000)
 libcolamd.so.2.7.1 => /usr/lib/libcolamd.so.2.7.1 (0x00007fdabde9a000)
 libccolamd.so.2.7.1 => /usr/lib/libccolamd.so.2.7.1 (0x00007fdabdc8e000)
 libparmetis.so.3.1 => /usr/lib/libparmetis.so.3.1 (0x00007fdabda4d000)
 libmetis.so.3.1 => /usr/lib/libmetis.so.3.1 (0x00007fdabd802000)
 liblapack.so.3gf => /usr/lib/liblapack.so.3gf (0x00007fdabcbec000)
 libCGAL.so.5 => /usr/lib/libCGAL.so.5 (0x00007fdabc9bd000)
 libgmpxx.so.4 => /usr/lib/libgmpxx.so.4 (0x00007fdabc7b8000)
 libmpfr.so.4 => /usr/lib/libmpfr.so.4 (0x00007fdabc562000)
 libgmp.so.3 => /usr/lib/libgmp.so.3 (0x00007fdabc301000)
 libz.so.1 => /lib/libz.so.1 (0x00007fdabc0e9000)
 libcppunit-1.12.so.1 => /usr/lib/libcppunit-1.12.so.1 (0x00007fdabbea4000)
 libmpi_cxx.so.0 => /usr/local/lib/libmpi_cxx.so.0 (0x00007fdabbc89000)
 libmpi.so.0 => /usr/local/lib/libmpi.so.0 (0x00007fdabb9e0000)
 libopen-rte.so.0 => /usr/local/lib/libopen-rte.so.0 (0x00007fdabb793000)
 libopen-pal.so.0 => /usr/local/lib/libopen-pal.so.0 (0x00007fdabb53d000)
 libdl.so.2 => /lib/libdl.so.2 (0x00007fdabb339000)
 libnsl.so.1 => /lib/libnsl.so.1 (0x00007fdabb11f000)
 libutil.so.1 => /lib/libutil.so.1 (0x00007fdabaf1b000)
 libm.so.6 => /lib/libm.so.6 (0x00007fdabac98000)
 libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fdaba992000)
 libgomp.so.1 => /usr/lib/libgomp.so.1 (0x00007fdaba783000)
 libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007fdaba56d000)
 libpthread.so.0 => /lib/libpthread.so.0 (0x00007fdaba350000)
 libc.so.6 => /lib/libc.so.6 (0x00007fdab9fcc000)
 libblas.so.3gf => /usr/lib/libblas.so.3gf (0x00007fdab9a88000)
 librt.so.1 => /lib/librt.so.1 (0x00007fdab9880000)
 libbz2.so.1.0 => /lib/libbz2.so.1.0 (0x00007fdab966e000)
 libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fdab9333000)
 libmpi_f90.so.0 => /usr/lib/libmpi_f90.so.0 (0x00007fdab912e000)
 libmpi_f77.so.0 => /usr/lib/libmpi_f77.so.0 (0x00007fdab8efb000)
 libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007fdab8c17000)
 /lib64/ld-linux-x86-64.so.2 (0x00007fdac88e0000)
 libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fdab89f8000)
 libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fdab87f5000)
 libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fdab85ef000)

Revision history for this message
Johannes Ring (johannr) said :
#3

The problem is that DOLFIN is linked against the wrong Boost libraries:

 libboost_filesystem.so.1.42.0 => /usr/lib/libboost_filesystem.so.1.42.0 (0x00007fdac7aa5000)
 libboost_program_options.so.1.42.0 => /usr/lib/libboost_program_options.so.1.42.0 (0x00007fdac784a000)
 libboost_system.so.1.42.0 => /usr/lib/libboost_system.so.1.42.0 (0x00007fdac7646000)
 libboost_thread.so.1.42.0 => /usr/lib/libboost_thread.so.1.42.0 (0x00007fdac7430000)
 libboost_iostreams.so.1.42.0 => /usr/lib/libboost_iostreams.so.1.42.0 (0x00007fdac7214000)

Can you check in <dolfin_src>/dorsal_build_dir/CMakeCache.txt and see if the correct Boost libraries has been set there?

Revision history for this message
Bento (tbarmeier-deactivatedaccount) said :
#4

How do I identify the correct libraries?
in <dolfin_src>/dorsal_build_dir/CMakeCache.txt everything is set to /usr/lib/..., where apparently the previous boost installation 1.42 landed. The Boost 1.47 libraries were installed in /home/bento/FEniCS/lib.
Where can I change that to rebuild Dolfin? Deleting <dolfin_src>/dorsal_build_dir/ and rebuilding did not help.

Revision history for this message
Johannes Ring (johannr) said :
#5

Have you added a "#" or "skip:" in front of "boost" in your .platform file? It is important to use "skip:" if you don't want to rebuild a package because it will set some important environment variables for that package.

Revision history for this message
Bento (tbarmeier-deactivatedaccount) said :
#6

Yes, I was always adding a hash key. I now rebuilt everything in two runs the following way:
first run: build everything, except dolfin
second run: skip everything except Trilinos and Dolfin, # Trilinos and build dolfin

turns out that skipping Trilinos sets variables wrong for building Dolfin, so I had to comment it instead of skipping. Hence I commented everything, which then did not set the Boost variables correctly.
Is this a bug maybe?

Revision history for this message
Johannes Ring (johannr) said :
#7

Skipping Trilinos will only set TRILINOS_DIR to $INSTALL_PATH. What sort of error do you see if you do this?

Revision history for this message
Bento (tbarmeier-deactivatedaccount) said :
#8

Hi Johannes,

I did a full new build and ran dorsal three times.
First run: everything enabled in the .platform file. Everything builds, except Dolfin. Output is below.
deleted dorsal_build_dir in the dolfin-src dir
Second run: skip everything except Dolfin. Dolfin fails to build, the output is the same like in the first run.
deleted dorsal_build_dir in the dolfin-src dir
Third run: # everything except Dolfin. Now it builds correctly.

Now here is the output from the failed Dolfin builds:

Fetching dolfin-1.0-beta
Unpacking dolfin-1.0-beta
Building dolfin-1.0-beta
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- 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
-- Performing Test HAVE_PIPE
-- Performing Test HAVE_PIPE - Success
-- Performing Test HAVE_PEDANTIC
-- Performing Test HAVE_PEDANTIC - Success
-- Performing Test HAVE_DISABLE_PEDANTIC_CHECKS
-- Performing Test HAVE_DISABLE_PEDANTIC_CHECKS - Success
-- Performing Test HAVE_STD
-- Performing Test HAVE_STD - Success
-- Performing Test HAVE_DEBUG
-- Performing Test HAVE_DEBUG - Success
-- Performing Test HAVE_O2_OPTIMISATION
-- Performing Test HAVE_O2_OPTIMISATION - Success
-- Found MPI: /usr/local/lib/libmpi_cxx.so
-- 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
-- Performing Test OPENMP_UINT_TEST_RUNS
-- Performing Test OPENMP_UINT_TEST_RUNS - Success
-- Boost version: 1.47.0
-- Found the following Boost libraries:
-- filesystem
-- program_options
-- system
-- thread
-- iostreams
-- Checking for package 'Armadillo'
-- Performing Test ARMADILLO_TEST_RUNS
-- Performing Test ARMADILLO_TEST_RUNS - Success
-- Found Armadillo: /usr/lib/libarmadillo.so
-- Found LibXml2: /usr/lib/libxml2.so
-- Found PythonInterp: /usr/bin/python2.6
-- Found PythonLibs: /usr/lib/libpython2.6.so
-- NumPy headers found
-- Performing Test PARMETIS_TEST_RUNS
-- Performing Test PARMETIS_TEST_RUNS - Success
-- Found ParMETIS: /usr/lib/libparmetis.so;/usr/lib/libmetis.so
-- Checking for package 'SCOTCH-PT'
-- Performing test SCOTCH_TEST_RUNS
-- Performing test SCOTCH_TEST_RUNS - Success
-- Found SCOTCH: /home/bento/temp/FEniCS/lib/libptscotch.a;/home/bento/temp/FEniCS/lib/libptscotcherr.a
-- Checking for package 'AMD'
-- Found AMD: /usr/lib/libamd.so
-- Checking for package 'BLAS'
-- Found BLAS: /usr/lib/libatlas.so
-- Checking for package 'UMFPACK'
-- Checking for package 'AMD'
-- Checking for package 'BLAS'
-- Checking for package 'CHOLMOD'
-- Checking for package 'AMD'
-- Checking for package 'BLAS'
-- Checking for package 'LAPACK'
-- Found LAPACK: /usr/lib/liblapack.so
-- Performing Test CHOLMOD_TEST_RUNS
-- Performing Test CHOLMOD_TEST_RUNS - Success
-- Found CHOLMOD: /usr/lib/libcholmod.so;/usr/lib/libamd.so;/usr/lib/libcamd.so;/usr/lib/libcolamd.so;/usr/lib/libccolamd.so;/usr/lib/libatlas.so;/usr/lib/libparmetis.so;/usr/lib/libmetis.so;/usr/lib/liblapack.so
-- Performing Test UMFPACK_TEST_RUNS
-- Performing Test UMFPACK_TEST_RUNS - Success
-- Found UMFPACK: /usr/include/suitesparse
-- Checking for package 'CHOLMOD'
-- Checking for package 'AMD'
-- Checking for package 'BLAS'
-- Checking for package 'LAPACK'
-- Checking for package 'Trilinos'
CMake Warning at /home/bento/temp/FEniCS/include/trilinos/TrilinosConfig.cmake:59 (MESSAGE):
  TrilinosConfig.cmake has moved. It now exists at a location under the
  installation prefix where the find_package command looks by default
  (<prefix>/lib/cmake/Trilinos). This compatibility file exists at the old
  location (<prefix>/include) to present this message and load the file from
  its new location.

  The find_package() call that loaded this file did so because its cached
  result variable, Trilinos_DIR, is set to

    /home/bento/temp/FEniCS/include/trilinos

  I'm locally setting Trilinos_DIR to

    /home/bento/temp/FEniCS/include/lib/cmake/Trilinos

  and loading TrilinosConfig.cmake from its new location. One may suppress
  this warning by setting the above value in the cache. However, the
  application needs modification permanently fix the issue. The
  find_package() call that loaded this file may have the form

    find_package(Trilinos REQUIRED PATHS ${TRILINOS_PATH}/include)

  Change it to the form

    set(CMAKE_PREFIX_PATH ${TRILINOS_PATH} ${CMAKE_PREFIX_PATH})
    find_package(Trilinos REQUIRED)

  to find TrilinosConfig.cmake in its new location in future builds while
  still honoring the TRILINOS_PATH option for this application.
Call Stack (most recent call first):
  cmake/modules/FindTrilinos.cmake:12 (find_package)
  CMakeLists.txt:251 (find_package)

CMake Error at /home/bento/temp/FEniCS/include/trilinos/TrilinosConfig.cmake:81 (INCLUDE):
  include could not find load file:

    /home/bento/temp/FEniCS/include/lib/cmake/Trilinos/TrilinosConfig.cmake
Call Stack (most recent call first):
  cmake/modules/FindTrilinos.cmake:12 (find_package)
  CMakeLists.txt:251 (find_package)

-- Checking for package 'MTL4'
-- Checking for package 'BLAS'
-- Performing Test MTL4_TEST_RUNS
-- Performing Test MTL4_TEST_RUNS - Success
-- Found MTL4: /home/bento/temp/FEniCS/include
-- Checking for package 'PETSc'
-- PETSC_DIR is /home/bento/temp/FEniCS
-- PETSC_ARCH is empty
-- Found petscconf.h
-- Performing Test PETSC_TEST_RUNS
-- Performing Test PETSC_TEST_RUNS - Success
-- PETSc test runs
-- Found PETSc: /home/bento/temp/FEniCS/lib/libpetsc.so
-- Checking for package 'SLEPc'
-- SLEPC_DIR is /home/bento/temp/FEniCS
-- Performing Test SLEPC_TEST_RUNS
-- Performing Test SLEPC_TEST_RUNS - Success
-- SLEPc test runs
-- Found SLEPc: /home/bento/temp/FEniCS/lib/libslepc.so
-- Checking for package 'CGAL'
-- Performing Test CGAL_TEST_RUNS
-- Performing Test CGAL_TEST_RUNS - Success
-- Found CGAL: /usr/lib/libCGAL.so;/usr/lib/libgmpxx.so;/usr/lib/libmpfr.so;/usr/lib/libgmp.so;/usr/lib/libboost_thread-mt.so
-- Found ZLIB: /usr/include
-- Could NOT find HDF5 (missing: HDF5_INCLUDE_DIRS)
CMake Warning at CMakeLists.txt:287 (message):
  HDF5 found, but is not configured to run in parallel.

-- Checking for package 'CPPUNIT'
-- Found CPPUNIT: /usr/lib/libcppunit.so
-- Checking for package 'Sphinx'
-- Found Sphinx: /usr/bin/sphinx-build
--
-- The following optional packages were found:
-- -------------------------------------------
-- (OK) OPENMP
-- (OK) MPI
-- (OK) PETSC
-- (OK) SLEPC
-- (OK) TRILINOS
-- (OK) MTL4
-- (OK) UMFPACK
-- (OK) CHOLMOD
-- (OK) SCOTCH
-- (OK) PARMETIS
-- (OK) CGAL
-- (OK) ZLIB
-- (OK) PYTHON
-- (OK) SPHINX
--
-- The following optional packages were not enabled:
-- -------------------------------------------------
-- (--) GMP
--
-- The following optional packages could not be found:
-- ---------------------------------------------------
-- (**) HDF5
--
-- Enabling generation of documentation.
-- Initializing sphinx projects
-- Enabling generation of html-documentation
-- Configuring incomplete, errors occurred!
Failure with exit status: 1
Exit message: There was a problem configuring dolfin-1.0-beta.