configuring neuron on a cluster with a local install of python - and getting it to use that python with nrniv -python
Posted: Thu Jun 01, 2023 3:06 pm
I have been running into an issue where nrniv -python is using a different version of python than what it was (allegedly) configured with
The configuration script I have been using is
./configure --without-x --prefix=$HOME/nrnmpi3.8 --with-paranrn --with-nrnpython=$HOME/.localpython/bin/python3.8 --with-mpi=$HOME/opt/openmpi/bin/mpicc --with-iv
where python was installed from a repository to .localpython with no additional options.
with corresponding changes to PATH, PYTHONPATH, and PYTHONHOME variables and an alias python=$HOME/.localpython/bin/python3.8
launching neuron python scripts via python does not result in any errors, however using nrniv -python always reverts back to using the default python in /usr/bin despite the configure option - which is a version with extremely limited utility for headnode operations - which in turn means it is unable to use the associated neuron, mpi, etc libraries. Normally this would not be a problem, but instances of nrniv are launched algorithmically via the netpyne batch commands in code we are trying to replicate and I haven't found a workaround for that.
I initially went through a previous thread with a similar problem from 2008 (viewtopic.php?t=1216) and tried to roughly crib the changes to that configure script to match my directory structure
./configure --without-x --prefix=$HOME/nrnmpi3.8 --with-paranrn --with-nrnpython=$HOME/.localpython/bin/python3.8 --with-mpi=$HOME/opt/openmpi/bin/mpicc --with-iv 'PYLIBDIR=$HOME/.localpython/lib' 'PYINCDIR=$HOME/.localpython/include/python3.8' 'PYVER=python3.8.3' 'PYLIB=-L$HOME/.localpython/lib -lpython3.8'
However this creates an error with the python libraries:
checking for python3... python3
Python binary found (/mnt/beegfs/home/cknow1/.localpython/bin/python3.8)
checking nrnpython configuration... get_config_var('LIBS') '-lcrypt -lpthread -ldl -lutil -lm'
checking if python include files and libraries work... configure: error: could not run a test that used the python library.
Examine config.log to see error details. Something wrong with
PYLIB=-L$HOME/.localpython/lib -lpython3.8
or
PYLIBDIR=$HOME/.localpython/lib
or
PYLIBLINK=
or
PYINCDIR=$HOME/.localpython/include/python3.8
The configuration script I have been using is
./configure --without-x --prefix=$HOME/nrnmpi3.8 --with-paranrn --with-nrnpython=$HOME/.localpython/bin/python3.8 --with-mpi=$HOME/opt/openmpi/bin/mpicc --with-iv
where python was installed from a repository to .localpython with no additional options.
with corresponding changes to PATH, PYTHONPATH, and PYTHONHOME variables and an alias python=$HOME/.localpython/bin/python3.8
launching neuron python scripts via python does not result in any errors, however using nrniv -python always reverts back to using the default python in /usr/bin despite the configure option - which is a version with extremely limited utility for headnode operations - which in turn means it is unable to use the associated neuron, mpi, etc libraries. Normally this would not be a problem, but instances of nrniv are launched algorithmically via the netpyne batch commands in code we are trying to replicate and I haven't found a workaround for that.
I initially went through a previous thread with a similar problem from 2008 (viewtopic.php?t=1216) and tried to roughly crib the changes to that configure script to match my directory structure
./configure --without-x --prefix=$HOME/nrnmpi3.8 --with-paranrn --with-nrnpython=$HOME/.localpython/bin/python3.8 --with-mpi=$HOME/opt/openmpi/bin/mpicc --with-iv 'PYLIBDIR=$HOME/.localpython/lib' 'PYINCDIR=$HOME/.localpython/include/python3.8' 'PYVER=python3.8.3' 'PYLIB=-L$HOME/.localpython/lib -lpython3.8'
However this creates an error with the python libraries:
checking for python3... python3
Python binary found (/mnt/beegfs/home/cknow1/.localpython/bin/python3.8)
checking nrnpython configuration... get_config_var('LIBS') '-lcrypt -lpthread -ldl -lutil -lm'
checking if python include files and libraries work... configure: error: could not run a test that used the python library.
Examine config.log to see error details. Something wrong with
PYLIB=-L$HOME/.localpython/lib -lpython3.8
or
PYLIBDIR=$HOME/.localpython/lib
or
PYLIBLINK=
or
PYINCDIR=$HOME/.localpython/include/python3.8