PySlurm / pyslurm

Python Interface to Slurm
https://pyslurm.github.io
GNU General Public License v2.0
467 stars 116 forks source link

question: install on cluster without slurm-devel package and without root access #322

Closed tgy closed 10 months ago

tgy commented 10 months ago

is it possible to install pyslurm on a cluster where i don't have the slurm-devel package and thus don't have the shared libraries? (of course i'm not root on the cluster and can't install additional libs)

tazend commented 10 months ago

Hi,

yeah that should be possible, you'll just need to do a little setup and point the pyslurm setup to the correct directories:

  1. Create a directory:
mkdir ~/slurm-devel
  1. Clone the Slurm Github Repo:
cd ~/slurm-devel

git clone https://github.com/SchedMD/slurm.git && cd slurm
# Check your slurm version (e.g. squeue --version) and checkout the specific tag:
git checkout tags/<version> -b <branch_name>

# I think you have to also run atleast a blank configure, so the slurm_version.h file gets created properly
./configure

The slurm subdirectory contains all the header files

  1. Find out the location of the versioned libslurm.so.X - slurm-devel provides the symlink libslurm.so (which PySlurm setup needs currently), but you can easily create this symlinks yourselves, since the versioned libslurm.so.X should definitely be installed. For example if you are on something like CentOS/RHEL, and assuming a default Slurm install, the library should be in /usr/lib64/libslurm.so.X And then you can do:
mkdir ~/slurm-devel/lib
ln -s $PATH_TO_VERSIONED_LIBSLURM.SO ~/slurm-devel/lib/libslurm.so

Essentially it should look like this then:

slurm-devel
   > lib/libslurm.so
   > slurm/slurm (headers)

And then you can do:

cd pyslurm-repo
export SLURM_LIB_DIR=~/slurm-devel/lib
export SLURM_INCLUDE_DIR=~/slurm-devel/slurm
pip install .

That should hopefully work (although a little hacky)

tgy commented 10 months ago

Thanks a lot!!