Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fenics needs OpenBLAS and doesn't work with MKL #82

Closed
basnijholt opened this issue May 10, 2019 · 8 comments · Fixed by #83
Closed

Fenics needs OpenBLAS and doesn't work with MKL #82

basnijholt opened this issue May 10, 2019 · 8 comments · Fixed by #83

Comments

@basnijholt
Copy link
Contributor

Somehow Fenics doesn't work with MKL and forces to use OpenBLAS.

See microsoft/qmt#132

@isuruf
Copy link
Member

isuruf commented May 28, 2019

What's the issue with MKL?

@basnijholt
Copy link
Contributor Author

@likewei92 came across this issue, can you post the details here?

@basnijholt
Copy link
Contributor Author

basnijholt commented May 28, 2019

I think the problem is that if one tries to install fenics with MKL, it still installs openblas:

conda install
conda create -n test_fenics2 fenics "libblas=*=*mkl"
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.11
  latest version: 4.6.14

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /home/tinkerer/.conda/envs/test_fenics2

  added / updated specs:
    - fenics
    - libblas[build=*mkl]


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    libblas-3.8.0              |           10_mkl           7 KB  conda-forge
    libcblas-3.8.0             |           10_mkl           6 KB  conda-forge
    liblapack-3.8.0            |           10_mkl           6 KB  conda-forge
    ------------------------------------------------------------
                                           Total:          19 KB

The following NEW packages will be INSTALLED:

    binutils_impl_linux-64: 2.31.1-h6176602_1              defaults
    binutils_linux-64:      2.31.1-h6176602_7              defaults
    boost-cpp:              1.68.0-h11c811c_1000           conda-forge
    bzip2:                  1.0.6-h14c3975_1002            conda-forge
    ca-certificates:        2019.3.9-hecc5488_0            conda-forge
    certifi:                2019.3.9-py37_0                conda-forge
    cmake:                  3.14.4-hf94ab9c_0              conda-forge
    curl:                   7.64.1-hf8cf82a_0              conda-forge
    eigen:                  3.3.7-h6bb024c_1000            conda-forge
    expat:                  2.2.5-hf484d3e_1002            conda-forge
    fastcache:              1.1.0-py37h516909a_0           conda-forge
    fenics:                 2019.1.0-py37_1                conda-forge
    fenics-dijitso:         2019.1.0-py_1                  conda-forge
    fenics-dolfin:          2019.1.0-py37h1c4d066_1        conda-forge
    fenics-ffc:             2019.1.0-py_1                  conda-forge
    fenics-fiat:            2019.1.0-py_1                  conda-forge
    fenics-libdolfin:       2019.1.0-h370d018_1            conda-forge
    fenics-ufl:             2019.1.0-py_1                  conda-forge
    gcc_impl_linux-64:      7.3.0-habb00fd_1               conda-forge
    gcc_linux-64:           7.3.0-h553295d_7               conda-forge
    gmp:                    6.1.2-hf484d3e_1000            conda-forge
    gmpy2:                  2.0.8-py37hb20f59a_1002        conda-forge
    gxx_impl_linux-64:      7.3.0-hdf63c60_1               conda-forge
    gxx_linux-64:           7.3.0-h553295d_7               conda-forge
    hdf5:                   1.10.4-mpi_mpich_ha7d0aea_1006 conda-forge
    hypre:                  2.15.1-hc98498a_1001           conda-forge
    icu:                    58.2-hf484d3e_1000             conda-forge
    intel-openmp:           2019.3-199                     defaults
    krb5:                   1.16.3-h05b26f9_1001           conda-forge
    libblas:                3.8.0-10_mkl                   conda-forge
    libcblas:               3.8.0-10_mkl                   conda-forge
    libcurl:                7.64.1-hda55be3_0              conda-forge
    libedit:                3.1.20170329-hf8c457e_1001     conda-forge
    libffi:                 3.2.1-he1b5a44_1006            conda-forge
    libgcc-ng:              8.2.0-hdf63c60_1               defaults
    libgfortran-ng:         7.3.0-hdf63c60_0               defaults
    liblapack:              3.8.0-10_mkl                   conda-forge
    libssh2:                1.8.2-h22169c7_2               conda-forge
    libstdcxx-ng:           8.2.0-hdf63c60_1               defaults
    libuv:                  1.29.1-h516909a_0              conda-forge
    metis:                  5.1.0-hf484d3e_1003            conda-forge
    mkl:                    2019.3-199                     defaults
    mpc:                    1.1.0-hb20f59a_1006            conda-forge
    mpfr:                   4.0.2-ha14ba45_0               conda-forge
    mpi:                    1.0-mpich                      conda-forge
    mpi4py:                 3.0.1-py37hf046da1_0           conda-forge
    mpich:                  3.2.1-hc99cbb1_1009            conda-forge
    mpmath:                 1.1.0-py_0                     conda-forge
    mumps-include:          5.1.2-1007                     conda-forge
    mumps-mpi:              5.1.2-h5bebb2f_1007            conda-forge
    ncurses:                6.1-hf484d3e_1002              conda-forge
    numpy:                  1.15.4-py37h8b7e671_1002       conda-forge
    openssl:                1.1.1b-h14c3975_1              conda-forge
    parmetis:               4.0.3-hb1a587f_1002            conda-forge
    petsc:                  3.11.1-h624fa55_1              conda-forge
    petsc4py:               3.11.0-py37h906564f_0          conda-forge
    pip:                    19.1-py37_0                    conda-forge
    pkg-config:             0.29.2-h14c3975_1005           conda-forge
    pkgconfig:              1.3.1-py37_1001                conda-forge
    ptscotch:               6.0.6-h5a4526e_1002            conda-forge
    pybind11:               2.2.4-py37h6bb024c_1000        conda-forge
    python:                 3.7.3-h5b0a415_0               conda-forge
    readline:               7.0-hf8c457e_1001              conda-forge
    rhash:                  1.3.6-h14c3975_1001            conda-forge
    scalapack:              2.0.2-h2831592_1005            conda-forge
    scotch:                 6.0.6-h491eb26_1002            conda-forge
    setuptools:             41.0.1-py37_0                  conda-forge
    six:                    1.12.0-py37_1000               conda-forge
    slepc:                  3.11.1-h00d104f_0              conda-forge
    slepc4py:               3.11.0-py37hce3d510_0          conda-forge
    sqlite:                 3.28.0-h8b20d00_0              conda-forge
    suitesparse:            4.5.6-heab0a99_1202            conda-forge
    sympy:                  1.4-py37_0                     conda-forge
    tbb:                    2019.7-hc9558a2_0              conda-forge
    tk:                     8.6.9-h84994c4_1001            conda-forge
    wheel:                  0.33.4-py37_0                  conda-forge
    xz:                     5.2.4-h14c3975_1001            conda-forge
    zlib:                   1.2.11-h14c3975_1004           conda-forge

Not sure if this is a bug though?

@isuruf
Copy link
Member

isuruf commented May 28, 2019

I don't see any openblas there

@basnijholt
Copy link
Contributor Author

basnijholt commented May 28, 2019

Oops, I saw it in the output with

conda create -n test_fenics fenics mkl-service mkl"

and must have found the wrong entry when Control+F openblas in my terminal after using the correct syntax.

My bad, sorry for the confusion.

The problem appears to be that this line should just be libblas=*=*mkl.

Thanks for the replies! 👍 😇

@basnijholt
Copy link
Contributor Author

basnijholt commented May 28, 2019

OK @isuruf, I found the actual problem (and there is an actual problem this time 😛)

Doing

conda create -n test_fenics3 fenics "libblas=*=*mkl"
conda activate test_fenics3

then:

Python 3.7.3 | packaged by conda-forge | (default, Mar 27 2019, 23:01:00)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import fenics
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tinkerer/.conda/envs/test_fenics3/lib/python3.7/site-packages/fenics/__init__.py", line 7, in <module>
    from dolfin import *
  File "/home/tinkerer/.conda/envs/test_fenics3/lib/python3.7/site-packages/dolfin/__init__.py", line 34, in <module>
    from .cpp import __version__
ImportError: libopenblas.so.0: cannot open shared object file: No such file or directory

That must have been the problem that @likewei92 observed when he told me about this problem.

Could it be that the BLAS of the compiler is used, because of this line?

@isuruf
Copy link
Member

isuruf commented May 28, 2019

libblas is a requirement for dolfin, but is not required in meta.yaml. Because of that dolfin is linking to the openblas package instead of the netlib package.

basnijholt added a commit to basnijholt/fenics-feedstock that referenced this issue May 28, 2019
@likewei92
Copy link

Yeah the issue was as @basnijholt described, you need to manually install openblas in the same environment as fenics in order to use it

@isuruf isuruf closed this as completed in #83 Jun 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants