PyMOAB not being added to path
Hello, I am Nathan Bartholomew. I am working on the python module called PyNE. We have an install script that builds MOAB before installing PyNE. I have modified the script so that it would install a later version of MOAB which also has PyMOAB. Upon completion of the installation PyMOAB cannot be imported unless it is added to the path in the script or manually. I believe this should be handled in the building of MOAB and not the install script.
install_dir=$HOME/opt
hdf5_libdir=/usr/lib/x86_64-linux-gnu/hdf5/serial
cd $install_dir
mkdir -p moab
cd moab
git clone --branch master --single-branch https://bitbucket.org/fathomteam/moab moab-repo
cd moab-repo
autoreconf -fi
mkdir -p build
cd build
../configure --enable-shared --enable-pymoab --enable-dagmc --with-hdf5=$hdf5_libdir --prefix=$install_dir/moab
make
make install
export LD_LIBRARY_PATH=$install_dir/moab/lib:$LD_LIBRARY_PATH
export LIBRARY_PATH=$install_dir/moab/lib:$LIBRARY_PATH
echo "export LD_LIBRARY_PATH=$install_dir/moab/lib:\$LD_LIBRARY_PATH" >> ~/.bashrc
echo "export LIBRARY_PATH=$install_dir/moab/lib:\$LIBRARY_PATH" >> ~/.bashrc
echo "export CPLUS_INCLUDE_PATH=$install_dir/moab/include:\$CPLUS_INCLUDE_PATH" >> ~/.bashrc
echo "export C_INCLUDE_PATH=$install_dir/moab/include:\$C_INCLUDE_PATH >> ~/.bashrc
I’m unsure if the environment variables in lines 17 through 23 are relevant so I included them just in case.
Comments (8)
-
-
reporter Yes, and I cloned it from the master branch. I intend to change the script when a new there is a new stable release.
-
Hi! Thanks for reaching out to us.
I've been playing around with this today. While PyMOAB is installed in a default location relative to the MOAB install. It is also possible to run the
setup.py
like you would for a pure Python package from thepymoab
directory in your build location. This will only work after the MOAB library has been built.So I think the answer for you would be to add these couple lines after
make install
:cd pymoab python setup.py install # or if you want to avoid the system install (recommended) python setup.py install --user
-
reporter Thanks for the answer. Are you also saying that this isn’t something that should be done by the make install?
-
No problem!
I'm not sure TBH. I've seen C++/Python packages handle the install of their libraries/binaries and their Python module in several different ways. Some rely on CMake/autotools to put the Python module in the correct place (which is sort of what we're attempting to do here) and others rely on the
setup.py
/pip
to build the C++ binaries and install those separately from the Python module. It isn’t clear to me which is better, but I’ll definitely acknowledge that PyMOAB’s install process could be improved. -
reporter Should I resolve this issue?
-
We can leave it open as a reminder that this should be updated at some point.
-
@Patrick Shriwise Can we address this issue somehow ? @Paul Wilson has been adding changes to converge the behavior of autotools and CMake. We should streamline the installation process for PyMOAB as well if possible.
- Log in to comment
I assume you are using MOAB 5.1?
@Patrick Shriwise Can you take a look at this? I won't have time this week to resolve the issue.