Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hypre #249

Merged
merged 9 commits into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ option( ENABLE_NINJA "" OFF )

include(ProcessorCount)
ProcessorCount(NUM_CORES)

set(NUM_PROC ${NUM_CORES} CACHE STRING "")
message( "Running with NUM_PROC = ${NUM_PROC}")

Expand Down Expand Up @@ -771,7 +771,7 @@ endif()

if( ENABLE_HYPRE )
set( HYPRE_DIR "${CMAKE_INSTALL_PREFIX}/hypre" )
set( HYPRE_URL "${TPL_MIRROR_DIR}/hypre-2.29.0.tar.gz")
set( HYPRE_URL "${TPL_MIRROR_DIR}/hypre-v2.30.0-8-g61fa167d7.tar.gz" )
set( HYPRE_DEPENDS "" )


Expand Down Expand Up @@ -1141,7 +1141,7 @@ endif( ENABLE_MPI )
CMAKE_ARGS -D CMAKE_C_COMPILER=${VTK_C_COMPILER}
-D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
-D CMAKE_CXX_COMPILER=${VTK_CXX_COMPILER}
-D CMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-D CMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-D VTK_USE_MPI=${VTK_USE_MPI}
-D VTK_MODULE_ENABLE_VTK_IOParallelXML=${VTK_MODULE_ENABLE_VTK_IOParallelXML}
-D VTK_MODULE_ENABLE_VTK_FiltersParallelDIY2=${VTK_MODULE_ENABLE_VTK_FiltersParallelDIY2}
Expand Down
57 changes: 57 additions & 0 deletions scripts/updateHypre.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

# Input argument: hypre branch
VERSION=${1:-"master"}

# Local variables
GEOSTPL_DIR=$(dirname $(dirname $(realpath $0)))
TPL_MIRROR_DIR=${GEOSTPL_DIR}/tplMirror
HYPRE_DIR=${GEOSTPL_DIR}/hypre-${VERSION}
HYPRE_SRC_DIR=${HYPRE_DIR}/src

# Fetch hypre repository
cd ${GEOSTPL_DIR}
rm -rf ${HYPRE_DIR}
git clone https://github.com/hypre-space/hypre.git ${HYPRE_DIR}

# Assign git variables
cd ${HYPRE_DIR}
git checkout ${VERSION}
HYPRE_DEVELOP_STRING=$(git -C ${HYPRE_SRC_DIR} describe --match 'v*' --long --abbrev=9)
HYPRE_DEVELOP_LASTAG=$(git -C ${HYPRE_SRC_DIR} describe --match 'v*' --abbrev=0)
HYPRE_DEVELOP_NUMBER=$(git -C ${HYPRE_SRC_DIR} rev-list --count $HYPRE_DEVELOP_LASTAG..HEAD)
HYPRE_DEVELOP_BRANCH=$(git -C ${HYPRE_SRC_DIR} rev-parse --abbrev-ref HEAD)

# Replace placeholders in the "configure" file
sed -i "s/\$develop_string/$HYPRE_DEVELOP_STRING/g" ${HYPRE_SRC_DIR}/configure
sed -i "s/\$develop_lasttag/$HYPRE_DEVELOP_LASTAG/g" ${HYPRE_SRC_DIR}/configure
sed -i "s/\$develop_number/$HYPRE_DEVELOP_NUMBER/g" ${HYPRE_SRC_DIR}/configure
sed -i "s/\$develop_branch/$HYPRE_DEVELOP_BRANCH/g" ${HYPRE_SRC_DIR}/configure
sed -i "s/\$HYPRE_SRCDIR\/..\/.git/\$HYPRE_SRCDIR/g" ${HYPRE_SRC_DIR}/configure

# Remove git machinery from configure
sed -i '/^[[:space:]]*develop_lastag=\$/d' ${HYPRE_SRC_DIR}/configure
sed -i '/^[[:space:]]*develop_number=\$/d' ${HYPRE_SRC_DIR}/configure
sed -i '/^[[:space:]]*develop_branch=\$/d' ${HYPRE_SRC_DIR}/configure
sed -i '/^[[:space:]]*develop_string=\$/d' ${HYPRE_SRC_DIR}/configure

# Remove hypre test data
rm -rf ${HYPRE_DIR}/AUTOTEST
rm -rf ${HYPRE_DIR}/src/test/TEST_*

# Remove git folder
rm -rf ${HYPRE_DIR}/.git

# Create tarball and move it to tplMirror
HYPRE_DIR=${GEOSTPL_DIR}/hypre-${HYPRE_DEVELOP_STRING}
cd ${GEOSTPL_DIR}
mv hypre-${VERSION} ${HYPRE_DIR}
tar czvf hypre-${HYPRE_DEVELOP_STRING}.tar.gz hypre-${HYPRE_DEVELOP_STRING}
mv hypre-${HYPRE_DEVELOP_STRING}.tar.gz ${TPL_MIRROR_DIR}

# Remove temporary directory
rm -rf ${HYPRE_DIR}

# Update CMakeLists
echo -e "Updating CMakeLists..."
sed -i "s|set( HYPRE_URL \"\${TPL_MIRROR_DIR}/hypre-.*\.tar\.gz\" )|set( HYPRE_URL \"\${TPL_MIRROR_DIR}/hypre-${HYPRE_DEVELOP_STRING}.tar.gz\" )|" CMakeLists.txt
3 changes: 0 additions & 3 deletions tplMirror/hypre-2.29.0.tar.gz

This file was deleted.

3 changes: 3 additions & 0 deletions tplMirror/hypre-v2.30.0-8-g61fa167d7.tar.gz
Git LFS file not shown