Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
Native cluster compile

Installing missing packages

Petsc

The following Petsc installation lacks many useful components of Petsc.

wget https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.23.4.tar.gz
tar xf petsc-3.23.4.tar.gz
export PETSC_DIR=/u/archive/numer/caldana/petsc-3.23.4
./configure --with-mpi=1 --with-cc=gcc --with-cxx=g++ --with-fc=0 --prefix=/u/archive/numer/caldana/ --download-f2cblaslapack=1
make -j PETSC_DIR=/u/archive/numer/caldana/petsc-3.23.4 PETSC_ARCH=arch-linux-c-debug all
make PETSC_DIR=/u/archive/numer/caldana/petsc-3.23.4 PETSC_ARCH=arch-linux-c-debug install
export PETSC_DIR=/u/archive/numer/caldana/petsc-3.23.4
export PETSC_ARCH=arch-linux-c-debug

Install a Debug version of Petsc

./configure \
--with-debugging=1 \
--with-mpi=1 --with-cc=gcc --with-cxx=g++ --with-fc=0 \
--COPTFLAGS="-O0 -g" --CXXOPTFLAGS="-O0 -g" --FOPTFLAGS="-O0 -g" \
--with-mpi-dir=/usr/lib/x86_64-linux-gnu/openmpi \
COPTFLAGS="-O0 -g" CXXOPTFLAGS="-O0 -g" FOPTFLAGS="-O0 -g"
make PETSC_DIR=/workspaces/petsc-3.23.4 PETSC_ARCH=arch-linux-c-debug all

NOTE: NOT NEED INSTALL IF NO PREFIX

See, also for other useful stuff: https://precise.discourse.group/t/cmake-isnt-picking-up-on-the-correct-petsc-version/1921/4

CMake uses pkg config to find PETSc, we must update it and check it sees it.

export PETSC_DIR=/workspaces/petsc-3.23.4
export PETSC_ARCH=arch-linux-c-debug
export PKG_CONFIG_PATH=$PETSC_DIR/$PETSC_ARCH/lib/pkgconfig:$PKG_CONFIG_PATH
pkg-config --modversion PETSc
PKG_CONFIG_SYSTEM_INCLUDE_PATH=1 pkg-config --cflags PETSc
PKG_CONFIG_SYSTEM_LIBRARY_PATH=1 pkg-config --libs PETSc

vtk

wget https://vtk.org/files/release/9.5/VTK-9.5.0.tar.gz
tar -xvzf VTK-9.5.0.tar.gz
cd VTK-9.5.0 && mkdir build && cd build
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DVTK_GROUP_ENABLE_Qt=NO \
-DVTK_WRAP_PYTHON=OFF \
-DVTK_USE_RENDERING=OFF \
-DVTK_BUILD_TESTING=OFF \
-DVTK_USE_X=OFF \
-DVTK_OPENGL_HAS_OSMESA=ON \
-DVTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=ON \
-DVTK_USE_OFFSCREEN=ON \
-DVTK_GROUP_ENABLE_MPI=YES \
-DVTK_MODULE_ENABLE_VTK_ParallelMPI=YES \
-DVTK_USE_MPI=ON \
-DMPIEXEC_EXECUTABLE=$(which mpiexec) \
-DMPI_C_COMPILER=$(which mpicc) \
-DMPI_CXX_COMPILER=$(which mpicxx)
make -j

boost

wget https://archives.boost.io/release/1.88.0/source/boost_1_88_0.tar.gz
tar -xvzf boost_1_88_0.tar.gz
cd boost_1_88_0
./bootstrap.sh --prefix=${HOME}/boost
./b2 --with-serialization --with-unordered --with-graph
./b2 headers
./b2 install

parmetis

git clone https://github.com/KarypisLab/GKlib.git git clone https://github.com/KarypisLab/METIS.git git clone https://github.com/KarypisLab/ParMETIS.git

cd GKlib make config make make install

Using Spack

To list available compilers in Spack, you can use the following command in your terminal:

spack compilers

To check what’s installed:

spack find

To list packages explicitly loaded via Spack (in the current session):

spack find --loaded

Our usecase

Load the modules we need

source /opt/mox/spack/share/spack/setup-env.sh
spack load gcc@12.1.0
spack load mpich@4.1.2
spack load petsc@3.20.1%gcc@12.1.0 /47qod2s

spack load metis@5.1.0gcc@12.1.0 /qu4efxi spack load parmetis@4.0.3gcc@12.1.0 /7shc2am

spack load parmetis@4.0.3gcc@12.1.0 /ke7auhk spack load petsc.nosp@m.@3.2.nosp@m.0.1gcc@12.1.0 /cpthtdp spack load metis@5.1.0gcc@12.1.0 /2wj6juc

/7shc2am -> ^metis@5.1.0gcc@12.1.0~gdb~int64~ipo+real64+shared /47qod2s -> ^metis@5.1.0gcc@12.1.0~gdb~int64~ipo+real64+shared /qu4efxi -> metis@5.1.0gcc@12.1.0~gdb~int64~ipo+real64+shared

Specifying the position of a library

Gigat cluster:

source /u/sw/etc/profile
module load gcc-glibc/11 metis
cmake .. -DCMAKE_PREFIX_PATH="/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/metis/5.1.0/include/;/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/metis/5.1.0/bin/;/u/sw/toolchains/gcc-glibc/11.2.0/pkgs/metis/5.1.0/lib/;/u/archive/numer/caldana/boost/;/u/archive/numer/caldana/VTK-9.5.0/build/"