Skip to content
sajidmc edited this page Feb 12, 2019 · 12 revisions

How to compile the S4 Python Extension without root access

This guide is for Purdue HPCs to compile Stanford Stratified Structure Solver (S4) without root access. I have used nodes of Brown and Snyder and in both of them I could compile the code and run it with Anaconda Python. Please follow the steps below to compile:

  1. Clone the git repository

git clone github.com/sajidmc/S4

  1. Load correct version of python (3 or above). Check your version with the command: python --version (For Purdue's clusters, the default python version is 2 and you have to use the following code to load 3.0. Consult with your IT department to get specific commands.

module spider anaconda

module load anaconda/5.1.0-py36)

  1. Edit the MakefileHPC and make sure all the library paths are correct. MKL_HOME and MPI_HOME must point to the actual path of the libraries. mpiexec --test gives you an error message with the path of the library.

  2. Compile the library

make clean

make -f MakefileHPC S4_pyext

  1. If compiled correctly, the linker will create a so file in build/lib.library_version folder. Find out the name of the created file and check if libraries are linked correctly. ldd command gives you the list of the paths:

ls build

ldd build/lib.linux-x86_64-3.6/S4.cpython-36m-x86_64-linux-gnu.so

  1. Create symbolic link to library. (Check the name of the file with ls first)

ln -s build/lib.linux-x86_64-3.6/S4.cpython-36m-x86_64-linux-gnu.so S4.so

  1. Run the example script:

python PythonTest.py

It should give you the following output (you need to have X11 forwarding enabled for your console):

Clone this wiki locally