Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,30 @@ if (${MGMOL_WITH_SCALAPACK} OR DEFINED SCALAPACK_ROOT)
endif(${SCALAPACK_FOUND})
endif(${MGMOL_WITH_SCALAPACK} OR DEFINED SCALAPACK_ROOT)

# libROM (optional)
set(USE_LIBROM False CACHE BOOL "Build with libROM")
set(LIBROM_PATH "" CACHE STRING "Path of libROM")
if(USE_LIBROM)
if(NOT LIBROM_PATH)
message(FATAL_ERROR "libROM PATH not specified.")
else(NOT LIBROM_PATH)
set(LIBROM_SCRIPTS_PATH ${LIBROM_PATH}/scripts)
message(STATUS "LIBROM_PATH: ${LIBROM_PATH}")
message(STATUS "LIBROM_SCRIPTS_PATH: ${LIBROM_SCRIPTS_PATH}")
include(ExternalProject)
ExternalProject_Add(
libROM
SOURCE_DIR ${LIBROM_SCRIPTS_PATH}
CONFIGURE_COMMAND ""
BINARY_DIR ${LIBROM_PATH}
BUILD_COMMAND ${LIBROM_SCRIPTS_PATH}/compile.sh -t ${LIBROM_PATH}/cmake/toolchains/simple.cmake
INSTALL_COMMAND ""
)
include_directories(${LIBROM_PATH}/lib)
link_directories(${LIBROM_PATH}/build/lib)
endif(NOT LIBROM_PATH)
endif(USE_LIBROM)

# ARPACK (optional)
set(MGMOL_WITH_ARPACK FALSE CACHE BOOL "Compile with ARPACK package")
if(${MGMOL_WITH_ARPACK} OR DEFINED ARPACK_ROOT)
Expand Down
52 changes: 52 additions & 0 deletions scripts/build_quartz_libROM.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
##! /bin/csh -f
## An example script to build on LLNL Peloton systems.
## For now, this script assumes intel/ mkl libraries are being used.

# load some modules
source scripts/modules.quartz

# set some environment variables. Set them explicitly or use loaded module path (preferred)
# Here we use an explicit path for scalapack to be consistent with the path for the blas libraries and avoid
# benign cmake warnings
#setenv SCALAPACK_ROOT /usr/tce/packages/mkl/mkl-2020.0/lib
setenv SCALAPACK_ROOT ${MKLROOT}
setenv HDF5_ROOT /usr/tce/packages/hdf5/hdf5-1.14.0-mvapich2-2.3.6-intel-2022.1.0

# We need to define the cmake blas vendor option here to find the right one.
set BLAS_VENDOR = Intel10_64lp

# manually set the location of BLACS libraries for scalapack
set BLACS_LIB = ${SCALAPACK_ROOT}/lib/intel64

set MGMOL_ROOT = `pwd`

set INSTALL_DIR = ${MGMOL_ROOT}/install_quartz
mkdir -p ${INSTALL_DIR}

set BUILD_DIR = ${MGMOL_ROOT}/build_quartz
mkdir -p ${BUILD_DIR}
cd ${BUILD_DIR}

# clone the libROM GitHub repo in BUILD_DIR
set USE_LIBROM="On"
set LIBROM_PATH = ${BUILD_DIR}/libROM
git clone https://github.com/LLNL/libROM

# call cmake
cmake -DCMAKE_INSTALL_PREFIX=${INSTALL_DIR} \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_Fortran_COMPILER=mpif77 \
-DMPIEXEC_NUMPROC_FLAG="-n" \
-DBLA_VENDOR=${BLAS_VENDOR} \
-DSCALAPACK_BLACS_LIBRARY=${BLACS_LIB}/libmkl_blacs_intelmpi_lp64.so \
-DUSE_LIBROM=${USE_LIBROM} \
-DLIBROM_PATH=${LIBROM_PATH} \
-DCMAKE_BUILD_TYPE=DEBUG \
..

# call make install
make -j
make install

# -DBLAS_LIBRARIES=/usr/tce/packages/mkl/mkl-2022.1.0/mkl/2022.1.0/lib/intel64/lib \
# -DLAPACK_LIBRARIES=/usr/tce/packages/mkl/mkl-2022.1.0/mkl/2022.1.0/lib/intel64/lib \
14 changes: 14 additions & 0 deletions scripts/modules.quartz
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module load intel/2022.1.0
module load hdf5-parallel/1.14.0
#module load hdf5-parallel
#module load boost
module load mkl
module load cmake/3.14.5
module load python
## manually add boost path
setenv LD_LIBRARY_PATH /usr/tce/packages/boost/boost-1.80.0-mvapich2-2.3.6-gcc-10.3.1/lib:$LD_LIBRARY_PATH

#setenv MKLROOT $LIBRARY_PATH
#setenv MKLROOT /usr/tce/packages/mkl/mkl-2022.1.0/mkl/2022.1.0
#setenv HDF5ROOT $LD_LIBRARY_PATH
#setenv HDF5ROOT