Fresh FENICS Install: Tutorials Issues (HDF5 version, hypre_amg, general confusion)

647 views
Skip to first unread message

Zack Vitoh

unread,
Jun 19, 2017, 1:26:32 PM6/19/17
to fenics-support
Hi there,

First, thanks for your efforts to create a simple framework for quickly solving PDEs.  This will be invaluable to me, if I can install this properly.

I recently installed FENICS within a new environment (I was having other issues with an old environment):

conda create -n fenicsproject -c conda-forge fenics

I then tried to run a tutorial script, which did not work, so I simply tried to import dolfin within that environment in python3, receiving:

ImportError: libhdf5.so.10: cannot open shared object file: No such file or directory
ModuleNotFoundError: No module named '_common'

So next I installed h5py
conda install -c anaconda h5py=2.7.0 
The following NEW packages will be INSTALLED:

    h5py: 2.7.0-np113py36_0 anaconda   

The following packages will be SUPERSEDED by a higher-priority channel:

    hdf5: 1.10.1-0          conda-forge --> 1.8.17-1 anaconda

I tried the (first) poisson equation example
python3 fenics_poisson.py 
This worked as hoped for

So I then tried (and received):
$ python3 navier_stokes_cylinder.py 
Traceback (most recent call last):
  File "navier_stokes_cylinder.py", line 12, in <module>
    from mshr import *
ModuleNotFoundError: No module named 'mshr'
Aborted (core dumped)
So I installed mshr

Following this, I tried again:
$ python3 navier_stokes_cylinder.py 
but it seems that for whatever reason, I don't have the hypre_amg preconditioner in the tutorial
*** Reason:  Unknown preconditioner "hypre_amg". Use list_krylov_solver_preconditioners() to list available preconditioners().

So as you can guess, I installed hypre:
conda install -c conda-forge hypre=2.11.2

This did not add hypre_amg to the list of available preconditioners:

>>> dolfin.list_krylov_solver_preconditioners()
Preconditioner  |  Description                      
----------------------------------------------------
default         |  default preconditioner           
icc             |  Incomplete Cholesky factorization
ilu             |  Incomplete LU factorization      
jacobi          |  Jacobi iteration                 
none            |  No preconditioner                
petsc_amg       |  PETSc algebraic multigrid        
sor             |  Successive over-relaxation  

So I just changed the preconditioner to "petsc_amg" in the hope of getting something working.  I now receive:

$ python3 navier_stokes_cylinder.py > 'fenics_ns_cylinder_log'
Warning! ***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.18, library is 1.8.17
        SUMMARY OF THE HDF5 CONFIGURATION
        =================================

General Information:
-------------------
           HDF5 Version: 1.8.17
          Configured on: Mon Aug  1 18:39:27 BST 2016
          Configured by: ray@centos5_x86_64.localdomain
         Configure mode: production
            Host system: x86_64-unknown-linux-gnu
          Uname information: Linux centos5_x86_64.localdomain 2.6.18-411.el5 #1 SMP Mon Jul 11 17:13:52 CDT 2016 x86_64 x86_64 x86_64 GNU/Linux
               Byte sex: little-endian
              Libraries: shared
         Installation point: /home/ray/mc-x64-2.7/envs/_build

Compiling Options:
------------------
               Compilation Mode: production
                     C Compiler: /usr/bin/gcc ( gcc (GCC) 4.1.2 20080704 )
                         CFLAGS: 
                      H5_CFLAGS: -std=c99 -pedantic -Wall -Wextra -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wfloat-equal -Wmissing-format-attribute -Wmissing-noreturn -Wpacked -Wdisabled-optimization -Wformat=2 -Wunreachable-code -Wendif-labels -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch -Wvariadic-macros -Wnonnull -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros -Wunsafe-loop-optimizations -Wc++-compat -Wvolatile-register-var -O3
                      AM_CFLAGS: 
                       CPPFLAGS: 
                    H5_CPPFLAGS: -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L   -DNDEBUG -UH5_DEBUG_API
                    AM_CPPFLAGS: 
               Shared C Library: yes
               Static C Library: no
  Statically Linked Executables: no
                        LDFLAGS: 
                     H5_LDFLAGS: 
                     AM_LDFLAGS: 
          Extra libraries: -lrt -lpthread -lz -ldl -lm 
                Archiver: ar
               Ranlib: ranlib
           Debugged Packages: 
            API Tracing: no

Languages:
----------
                        Fortran: no

                            C++: yes
                   C++ Compiler: /usr/bin/g++ ( g++ (GCC) 4.1.2 20080704 )
                      C++ Flags: 
                   H5 C++ Flags:  
                   AM C++ Flags: 
             Shared C++ Library: yes
             Static C++ Library: no

Features:
---------
                  Parallel HDF5: no
             High Level library: yes
                   Threadsafety: yes
            Default API Mapping: v18
 With Deprecated Public Symbols: yes
         I/O filters (external): deflate(zlib)
                            MPE: no
                     Direct VFD: no
                        dmalloc: no
Clear file buffers before write: yes
           Using memory checker: no
         Function Stack Tracing: no
      Strict File Format Checks: no
   Optimization Instrumentation: no
Bye...
Aborted (core dumped)


I am not sure where I went wrong, but my guesses are that:
1) I installed hypre after installing petsc, so of course hypre's preconditioners are not available to petsc.  How do I install fenics as above in order to fix this?
2) I believe the same goes for hdf5

Hopefully the level of my confusion is clear, any suggestions on how to install fenics and the required hdf5 and hypre correctly?

Johannes Ring

unread,
Jun 21, 2017, 3:50:16 AM6/21/17
to Zack Vitoh, fenics-support
On Mon, Jun 19, 2017 at 7:26 PM, Zack Vitoh <jand...@gmail.com> wrote:
> I recently installed FENICS within a new environment (I was having other
> issues with an old environment):
>
> conda create -n fenicsproject -c conda-forge fenics
>
> I then tried to run a tutorial script, which did not work, so I simply tried
> to import dolfin within that environment in python3, receiving:
>
> ImportError: libhdf5.so.10: cannot open shared object file: No such file or
> directory
> ModuleNotFoundError: No module named '_common'

This should be fixed now (see
https://github.com/conda-forge/fenics-feedstock/issues/47). Please
update the fenics package.

> So next I installed h5py
> conda install -c anaconda h5py=2.7.0

If you need h5py, it would have been better to install it from the
conda-forge channel.

> The following NEW packages will be INSTALLED:
>
> h5py: 2.7.0-np113py36_0 anaconda
>
> The following packages will be SUPERSEDED by a higher-priority channel:
>
> hdf5: 1.10.1-0 conda-forge --> 1.8.17-1 anaconda
>
> I tried the (first) poisson equation example
> python3 fenics_poisson.py
> This worked as hoped for
>
> So I then tried (and received):
> $ python3 navier_stokes_cylinder.py
> Traceback (most recent call last):
> File "navier_stokes_cylinder.py", line 12, in <module>
> from mshr import *
> ModuleNotFoundError: No module named 'mshr'
> Aborted (core dumped)
> So I installed mshr

Yes, mshr needs to be installed separately. I think it would be good
to change the instructions on the web page to include mshr:

conda create -n fenicsproject -c conda-forge fenics mshr

> Following this, I tried again:
> $ python3 navier_stokes_cylinder.py
> but it seems that for whatever reason, I don't have the hypre_amg
> preconditioner in the tutorial
> *** Reason: Unknown preconditioner "hypre_amg". Use
> list_krylov_solver_preconditioners() to list available preconditioners().
>
> So as you can guess, I installed hypre:
> conda install -c conda-forge hypre=2.11.2
>
> This did not add hypre_amg to the list of available preconditioners:

No, because the petsc package in conda-forge is not built with hypre yet:

https://github.com/conda-forge/petsc-feedstock/issues/15

Johannes
Reply all
Reply to author
Forward
0 new messages