Skip to content

Commit

Permalink
updated libROM CMakeLists.txt (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamer2368 authored Jul 10, 2024
1 parent 97b5355 commit 28d1552
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ scaleupROM is mainly built upon [MFEM](https://mfem.org/) and [libROM](https://w

See the [wiki page](https://github.com/LLNL/scaleupROM/wiki/Installation) for the detailed instruction.

For LC quartz, the installation script is provided. You can simply run:
For LC dane, the installation script is provided. You can simply run:

```
./script/install_quartz.bash
./script/install_dane.bash
```

# Using Docker container
Expand Down
25 changes: 24 additions & 1 deletion install-helper/libROM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ set(module_list
algo/DMDc
algo/AdaptiveDMD
algo/NonuniformDMD
algo/SnapshotDMD
algo/DifferentialEvolution
algo/greedy/GreedyCustomSampler
algo/greedy/GreedyRandomSampler
algo/greedy/GreedySampler
algo/manifold_interp/Interpolator
algo/manifold_interp/MatrixInterpolator
algo/manifold_interp/VectorInterpolator
algo/manifold_interp/PCHIPInterpolator
hyperreduction/DEIM
hyperreduction/GNAT
hyperreduction/QDEIM
Expand All @@ -61,7 +63,7 @@ set(module_list
utils/mpi_utils)
set(source_files)
foreach(module IN LISTS module_list)
list(APPEND source_files ${module}.cpp)
list(APPEND source_files ${module}.cpp ${module}.h)
endforeach(module) # IN LISTS module_list

list(APPEND source_files
Expand Down Expand Up @@ -141,3 +143,24 @@ target_include_directories(ROM PUBLIC
${MPI_C_INCLUDE_DIRS}
${MFEM_C_INCLUDE_DIRS}
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})

# Find headers from the source file list that need to be installed
set(HEADERS "")
foreach(file IN LISTS source_files)
if(file MATCHES ".(hpp|h)$")
list(APPEND HEADERS ${file})
endif()
endforeach(file)

# Only install libROM.so if installing to a different directory. Otherwise, libROM.so is already in lib/
if (NOT ${CMAKE_INSTALL_PREFIX} STREQUAL ${CMAKE_BINARY_DIR})
install(TARGETS ROM EXPORT ROM LIBRARY DESTINATION lib INCLUDES DESTINATION include)
endif()

# Install libROM headers
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CAROM_config.h ${CMAKE_CURRENT_SOURCE_DIR}/FCMangle.h DESTINATION include)
foreach(file IN LISTS HEADERS)
# get the directory component so the include directory structure is preserved
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${file} DESTINATION include/${dir})
endforeach(file)
4 changes: 4 additions & 0 deletions script/install_quartz.bash → script/install_dane.bash
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ fi
cd $LIB_DIR
if [ ! -d "mumps" ]; then
git clone https://github.com/scivision/mumps.git
check_result $? mumps-clone
cd ./mumps
git checkout v5.6.2.1
export tempMKLROOT=$MKLROOT
Expand All @@ -106,6 +107,7 @@ fi
cd $LIB_DIR
if [ ! -d "mfem" ]; then
git clone https://github.com/mfem/mfem.git
check_result $? mfem-clone
cd mfem
git checkout v4.6
mkdir -p ./build && cd ./build
Expand All @@ -121,6 +123,7 @@ fi
cd $LIB_DIR
if [ ! -d "yaml-cpp" ]; then
git clone https://github.com/jbeder/yaml-cpp.git
check_result $? yaml-cpp-clone
mkdir -p ./yaml-cpp/lib && cd ./yaml-cpp/lib
cmake .. -DYAML_BUILD_SHARED_LIBS=on -DCMAKE_INSTALL_PREFIX=$LIB_DIR
check_result $? yaml-config
Expand All @@ -133,6 +136,7 @@ fi
cd $LIB_DIR
if [ ! -d "googletest" ]; then
git clone https://github.com/google/googletest
check_result $? googletest-clone
cd ./googletest
git checkout tags/release-1.12.1 -b v1.12.1
mkdir ./build && cd ./build
Expand Down

0 comments on commit 28d1552

Please sign in to comment.