Used primarily for TACS Aerostructural modules, you can download METIS in one of 2 ways.
Option 1: (suitable for NiaEnv/2019b)
>> module load metis/5.1.0-shared
Option 2: (suitable for NiaEnv/2022a and NiaEnv/2018a)
Since METIS is not available as a package (at least for 32-bit integers), we will install it manually. Run the following commands.
>> cd ~/tacs/extern
>> module load cmake
>> git clone https://github.com/KarypisLab/METIS.git
>> git clone https://github.com/KarypisLab/GKlib.git
>> cd GKlib
>> git checkout 33b8c8b
The last line checks out to an older version that avoids some compilation issues that have yet to be fixed as of September 2024. You will need to modify the Makefile so that the static library compiled by GKlib is position-independent, meaning it can be used in shared libraries (i.e. libmetis.so) that can be loaded at any memory address. This is because we want GKlib to be included in the metis shared library, as it is called by several functions in jetstream. We do this by adding the following line in the file Makefile
# Add the -fPIC flag for building shared libraries
CONFIG_FLAGS += -DCMAKE_C_FLAGS="-fPIC"
You should add this after the configuration options, i.e. the last few lines of this section should look like
ifneq ($(cc), not-set)
CONFIG_FLAGS += -DCMAKE_C_COMPILER=$(cc)
endif
and before the definition of run-config, i.e. before
define run-config
mkdir -p $(BUILDDIR)
cd $(BUILDDIR) && cmake $(CURDIR) $(CONFIG_FLAGS)
endef
Once the Makefile is modified, run the following commands.
>> make config cc=icc prefix=$PWD/gklib
>> make
>> make install
>> cd ../METIS
We now should be in the METIS directory. We will simillarly need to modify the Makefiles in this directory to ensure that the static GKlib library is included in the shared metis library. To do this, add the following line to the file libmetis/CMakeLists.txt (Note: this is the CMakeLists.txt file in the libmetis subdirectory, not in the METIS root directory!)
# Link GKlib statically into libmetis
target_link_libraries(metis ${GKLIB_PATH}/lib/libGKlib.a)
You should add this after the library is built, i.e. after the line
# Build libmetis.
add_library(metis ${METIS_LIBRARY_TYPE} ${metis_sources})
and before the installation, i.e. before
if(METIS_INSTALL)
install(TARGETS metis
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib
ARCHIVE DESTINATION lib)
endif()
You are now ready to complete the METIS installation (and copying the output to your main shared library folder) by running
>> make config i64=not-set r64=1 shared=1 cc=icc prefix=$PWD/metis gklib_path=$HOME/tacs/extern/GKlib/gklib
>> make install
>> cp metis/lib/libmetis.so $HOME/$ARCH/lib
This ensures that integers are configured with 32-bits, while floats are configured with 64-bits, compatible with the current installation of TACS. Once the make install command runs successfully, you can verify the correct configuration by running
>> head -2 metis/include/metis.h
for which you should see
#define IDXTYPEWIDTH 32
#define REALTYPEWIDTH 64
METIS is now properly installed. Remember, in order to be available to TACS, you will need to modify the TACS makefile to include METIS_INCLUDE and METIS_LIB to ensure proper linking. This is a critical step, but should be taken care of automatically by the TACS Makefile.in file. Look for the string "Detected NiaEnv/2022a, assuming metis was installed manually" upon running the make command to ensure this linking worked properly.
Used primarily for Brandon Lowe's Aeroelastic modules, you can download scalapack in one of 2 ways. HOWEVER, note that as of September 2024, you do not need to load / compile scalapack separately, since the module is already included in Intel's MKL (Math Kernel Library). The change to link to ScaLAPACK contained within MKL rather than a separate library was done in the makefile, making the below unnecessary.
Option 1: (suitable for NiaEnv/2019b)
>> module load scalapack/2.0.2
Option 2: (suitable for NiaEnv/2022a and NiaEnv/2018a)
>> cd $HOME
>> wget http://www.netlib.org/scalapack/scalapack-2.2.0.tgz
>> tar -xvf scalapack-2.2.0.tgz
>> cd scalapack-2.2.0
>> module load cmake
>> cmake . -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=mpiicc -DCMAKE_Fortran_COMPILER=mpif90 -DCMAKE_INSTALL_PREFIX=$PWD/build -DCBLAS_LIBRARIES="-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl" -DLAPACK_LIBRARIES="-L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -ldl"
>> make -j4 make -j4 # note could increase 4 to desired number of cores
>> make install
>> cp build/lib/libscalapack.so $HOME/$ARCH/lib
You can safely remove the tarball from your home directory if you wish.
Bison is a library that is needed in the installation of SWIG-Fortran. A default version of bison is available on Niagara, but newer versions of SWIG require a newer version of Bison, version 3.5. Therefore if this is needed, you can follow these steps to install it. Note however that we have since reverted to using an older version of SWIG, so this is currently unecessary. We save this here only for future reference, if one day it is again needed.
Run the following from whichever directory you want to install Bison in.
>> cd
>> wget https://ftp.gnu.org/gnu/bison/bison-3.5.tar.gz
>> tar -xvzf bison-3.5.tar.gz
>> cd bison-3.5
>> mkdir build
>> cd build
>> ../configure --prefix=$HOME/bison
>> make
>> make install
>> cd ../
You should now see bison-3.5 in your directory. Either run the following line to load bison temporarily, or add it to your .bashrc to load the module permanently.
>> export PATH=$HOME/bison/bin:$PATH
Alternatively, you can install bison directly in another directory which is already included in $PATH, for example by using
>> ../configure --prefix=${HOME}/path/to/directory