Another PyROMS problem; might as well use the same thread...
I have more-or-less successfully (?) built and installed PyROMS with the following commands
Code: Select all
# The system is CentOS 7 with Miniconda (single-user install).
# Python 3.6, numpy, netcdf, etc are installed in a custom environment called "python36"
# The pyroms code at https://github.com/hadfieldnz/pyroms-mgh has been
# cloned into ~/Python/python-mgh
# Activate the Conda python36 environment and set up some handy shell environment variables
conda activate python36
export PREFIX=/home/hadfield/.local
export SITE_PACKAGES=${PREFIX}/lib/python3.6/site-packages
export PYTHON36=/home/hadfield/miniconda3/envs/python36
# Build and install bathy_smoother
cd ~/Python/pyroms-mgh/bathy_smoother
python setup.py build
python setup.py install --prefix=${PREFIX}
# Build and install pyroms_toolbox
cd ~/Python/pyroms-mgh/pyroms_toolbox
python setup.py build
python setup.py install --prefix=${PREFIX}
# Build and install pyroms
cd ~/Python/pyroms-mgh/pyroms
python setup.py build
python setup.py install --prefix=${PREFIX}
# Build and install nn
cd ~/Python/pyroms-mgh/pyroms/external/nn
./configure --prefix=${PREFIX}
make install
# Build and install pyroms_csa
cd ~/Python/pyroms-mgh/pyroms/external/csa
./configure --prefix=${PREFIX}
make install
# Build and install gridutils
cd ~/Python/pyroms-mgh/pyroms/external/gridutils
./configure CPPFLAGS=-I${PREFIX}/include LDFLAGS=-L${PREFIX}/lib CFLAGS=-I${PREFIX}/include --prefix=${PREFIX}
make install
# Build and install gridgen
cd ~/Python/pyroms-mgh/pyroms/external/gridgen
export SHLIBS=-L${PREFIX}/lib
./configure CPPFLAGS=-I${PREFIX}/include LDFLAGS=-L${PREFIX}/lib CFLAGS=-I${PREFIX}/include --prefix=${PREFIX}
make
make lib
make shlib
make install
# Build and install scrip. The netCDF configuration is passed explicity via command-line
# variables because nf-config is broken on CentOS 7. The "-j 1" may or may not be needed
# to work around broken dependencies in the make file.
cd ~/Python/pyroms-mgh/pyroms/external/scrip/source
make -j 1 PREFIX=${PREFIX} LIBDIR=${PYTHON36}/lib INCDIR=${PYTHON36}/include LIB="-lnetcdff -lnetcdf" all f2py
make -j 1 PREFIX=${PREFIX} LIBDIR=${PYTHON36}/lib INCDIR=${PYTHON36}/include LIB="-lnetcdff -lnetcdf" install
# Copy dynamic libraries to the site-packages directory. They are copied one at a time
# so I can keep track of which ones have been copied.
cd ~/Python/pyroms-mgh/
cp -v ./pyroms/external/scrip/source/scrip.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms/build/lib.linux-x86_64-3.6/pyroms/_iso.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms/build/lib.linux-x86_64-3.6/pyroms/_obs_interp.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms/build/lib.linux-x86_64-3.6/pyroms/_interp.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms/build/lib.linux-x86_64-3.6/pyroms/_remapping.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms_toolbox/build/lib.linux-x86_64-3.6/pyroms_toolbox/_average.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms/build/lib.linux-x86_64-3.6/pyroms/_remapping_fast.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms_toolbox/build/lib.linux-x86_64-3.6/pyroms_toolbox/creep.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./pyroms/build/lib.linux-x86_64-3.6/pyroms/_remapping_fast_weighted.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
cp -v ./bathy_smoother/build/lib.linux-x86_64-3.6/bathy_smoother/lpsolve55.cpython-36m-x86_64-linux-gnu.so ${SITE_PACKAGES}
When I start Python and import the dynamic-library modules, all goes well until I get to lpsolve55.
Code: Select all
$ conda activate python36
$ python
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scrip
>>> import _iso
>>> import _obs_interp
>>> import _interp
>>> import _remapping
>>> import _average
>>> import _remapping_fast
>>> import creep
>>> import _remapping_fast_weighted
>>> import lpsolve55
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dynamic module does not define module export function (PyInit_lpsolve55)
>>>
I will start looking into the problem shortly, but figured I might as well report it to the forum first.
PS: I think bathy_smoother works OK, but with reduced functionality, without the LP solver.