When installing the fenics meta-package into a separate environment, the library paths are not set correctly: Installing fenics using conda create -n fenicsproject -c conda-forge fenics creates the following $CONDA_DIR/envs/fenicsproject/share/dolfin/dolfin.conf:
# Helper file for setting non-default DOLFIN environment variables
# Common Unix variables
export LD_LIBRARY_PATH=/opt/miniconda/envs/fenicsproject//opt/miniconda/envs/fenicsproject/lib:$LD_LIBRARY_PATH
export PATH=/opt/miniconda/envs/fenicsproject/bin:$PATH
export PKG_CONFIG_PATH=/opt/miniconda/envs/fenicsproject//opt/miniconda/envs/fenicsproject/lib/pkgconfig:$PKG_CONFIG_PATH
export MANPATH=/opt/miniconda/envs/fenicsproject/share/man:$MANPATH
# Special Mac variables
export DYLD_FRAMEWORK_PATH=/opt/local/Library/Frameworks:$DYLD_FRAMEWORK_PATH
(Note the double env prefix on the LD_LIBARY_PATH and PKG_CONFIG_PATH.)
With this dolfin.conf, typing
from dolfin import *
Expression("1",degree=0)
results in the error
dijitso failed to load existing file:
/opt/miniconda/envs/fenicsproject/.cache/dijitso/lib/libdijitso-dolfin_expression_67128269551ba784c4d7d69f5f3ba722.so
error is:
libmpicxx.so.12: cannot open shared object file: No such file or directory
Traceback (most recent call last):
File "/opt/miniconda/envs/fenicsproject/lib/python3.7/site-packages/dolfin/jit/jit.py", line 168, in compile_class
submodule = dijitso.extract_factory_function(module, "create_" + module_name)()
File "/opt/miniconda/envs/fenicsproject/lib/python3.7/site-packages/dijitso/jit.py", line 47, in extract_factory_function
function = getattr(lib, name)
AttributeError: 'NoneType' object has no attribute 'create_dolfin_expression_67128269551ba784c4d7d69f5f3ba722'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/miniconda/envs/fenicsproject/lib/python3.7/site-packages/dolfin/function/expression.py", line 400, in __init__
self._cpp_object = jit.compile_expression(cpp_code, params)
File "/opt/miniconda/envs/fenicsproject/lib/python3.7/site-packages/dolfin/function/jit.py", line 158, in compile_expression
expression = compile_class(cpp_data, mpi_comm=mpi_comm)
File "/opt/miniconda/envs/fenicsproject/lib/python3.7/site-packages/dolfin/jit/jit.py", line 170, in compile_class
raise RuntimeError("Unable to compile C++ code with dijitso")
RuntimeError: Unable to compile C++ code with dijitso
Issue:
When installing the fenics meta-package into a separate environment, the library paths are not set correctly: Installing fenics using
conda create -n fenicsproject -c conda-forge fenics
creates the following$CONDA_DIR/envs/fenicsproject/share/dolfin/dolfin.conf
:(Note the double env prefix on the
LD_LIBARY_PATH
andPKG_CONFIG_PATH
.)With this dolfin.conf, typing
results in the error
Removing the double prefix fixes the problem.