-
Notifications
You must be signed in to change notification settings - Fork 3
Compiling on LC Machines
The steps below can be used to compile pylibROM on LC machines.
Note: These steps assume that libROM has already been compiled on LC following the steps for compiling libROM on LC machines.
First, load appropriate modules. The same compiler that was used to compile libROM should be used here. The module list below uses gcc as an example.
module load python/3.9.12
module load gcc/12.1.1-magic
module load mkl/2022.1.0
Install SWIG to your local Python environment and add it to your path. The system provided version of swig is too old and will cause a compile error if used.
pip install --user swig==4.1.1
export PATH=~/.local/bin:$PATH
Download and compile PyMFEM:
git clone https://github.com/mfem/PyMFEM.git
cd PyMFEM
python3 setup.py install --with-parallel --with-gslib --user --CC=gcc --CXX=g++ --MPICC=mpicc --MPICXX=mpic++ --with-lapack
Download and compile pylibROM:
git clone --recurse-submodules https://github.com/llnl/pylibROM.git
cd pylibROM/
If libROM has already been compiled, specify the path (recommended):
pip install ./ --global-option="--librom_dir=/path/to/pre-installed-libROM"
If libROM has not been compiled, pylibROM can compile it:
pip install ./
Note: Since Lassen is a different architecture, care must be taken to ensure that the Python environment, user packages, and all dependencies (libROM, MFEM, pyMFEM, etc) are compiled for the correct architecture. The section below demonstrates creating a virtualenv where local user packages are installed into a different prefix based on the LC provided environment variable $SYS_TYPE. This will allow local installations of PyMFEM/pylibROM to be used across different LC machines.
module load python/3.8.2
Install a newer virtualenv since the system version gives a site error. Need at least virtualenv >= 20.0.0.
pip install --user virtualenv==20.0.0
export PATH=$HOME/.local/bin:$PATH
Create a unique virtualenv for the current system type
virtualenv --system-site-packages $HOME/local/$SYS_TYPE
export PATH=$HOME/local/$SYS_TYPE/bin:$PATH
Activate system specific virtualenv
source $HOME/local/$SYS_TYPE/bin/activate
Use which python to verify that the correct python is being used.
Note: After the virtualenv is created once, it does not need to be repeated. Only activating the virtualenv (source $HOME/local/$SYS_TYPE/bin/activate) needs to be done in the future.
Activate virtualenv from above and load appropriate modules. The same compiler that was used to compile libROM should be used here. The module list below uses gcc as an example.
module load python/3.8.2
module load gcc/10.2.1
Install SWIG to your local Python environment and add it to your path. The system provided version of swig is too old and will cause a compile error if used.
pip install swig==4.1.1
Download and compile PyMFEM:
git clone https://github.com/mfem/PyMFEM.git
cd PyMFEM
python setup.py install --with-parallel --with-gslib --CC=gcc --CXX=g++ --MPICC=mpicc --MPICXX=mpic++
Download and compile pylibROM:
git clone --recurse-submodules https://github.com/llnl/pylibROM.git
cd pylibROM/
If libROM has already been compiled, specify the path (recommended):
pip install ./ --global-option="--librom_dir=/path/to/pre-installed-libROM"
If libROM has not been compiled, pylibROM can compile it:
pip install ./