Skip to content

Commit

Permalink
Merge branch 'task/2024_07_caliper_build_support' of https://github.c…
Browse files Browse the repository at this point in the history
…om/Alpine-DAV/ascent into task/2024_07_caliper_build_support
  • Loading branch information
cyrush committed Aug 2, 2024
2 parents ff58c43 + 780c8cc commit a7082fa
Show file tree
Hide file tree
Showing 10 changed files with 460 additions and 39 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/build_ascent_gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,79 @@ jobs:
export VTKM_INSTALL_DIR=`ls -d /home/runner/work/ascent/ascent/install/vtk-m-*`
export LD_LIBRARY_PATH=${VTKM_INSTALL_DIR}/lib/:${LD_LIBRARY_PATH}
mpiexec -n 2 ./build/ascent_mpi_render_example
build_basic_pyvenv:
name: Ubuntu Build Ascent GCC with Python VENV
runs-on: ubuntu-latest
env:
CC: gcc
CXX: g++
FC: gfortran
steps:
- name: Install System Deps
run: |
sudo apt-get update
sudo apt-get install binutils \
gcc \
g++ \
gfortran \
python3 \
perl \
git \
git-lfs \
curl \
wget \
tar \
unzip \
build-essential \
libncurses-dev \
libssl-dev \
libblas-dev \
liblapack-dev \
zlib1g-dev \
libgdbm-dev \
libreadline-dev \
libsqlite3-dev \
libbz2-dev \
openmpi-bin \
openmpi-common \
libopenmpi-dev \
cmake
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build TPLs
run: |
env enable_mpi=ON \
enable_fortran=ON \
enable_tests=OFF \
enable_verbose=OFF \
build_ascent=false \
enable_python=ON \
build_pyvenv=true \
build_jobs=2 \
./scripts/build_ascent/build_ascent.sh
- name: Configure Ascent
run: |
cmake --version
echo "**** Configuring Ascent"
cmake -S src -B build -C ascent-config.cmake -DCMAKE_INSTALL_PREFIX=install
- name: Build Ascent
run: |
echo "**** Building Ascent"
cmake --build build -j2
- name: Install Ascent
run: |
echo "**** Installing Ascent"
cmake --install build
- name: Check Install
run: |
echo "**** Checking Ascent using-with-cmake-mpi example"
export CC=/usr/bin/mpicc
export CXX=/usr/bin/mpicxx
cd install/examples/ascent/using-with-cmake-mpi
cmake -S . -B build
cmake --build build --verbose -j2
export VTKM_INSTALL_DIR=`ls -d /home/runner/work/ascent/ascent/install/vtk-m-*`
export LD_LIBRARY_PATH=${VTKM_INSTALL_DIR}/lib/:${LD_LIBRARY_PATH}
mpiexec -n 2 ./build/ascent_mpi_render_example
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ and this project aspires to adhere to [Semantic Versioning](https://semver.org/s

## Unreleased
### Preferred dependency versions for ascent@develop
- [email protected]
- [email protected] (requires [patch](https://github.com/Alpine-DAV/ascent/blob/0aef6cffd522be7419651e6adf586f9a553297d0/scripts/build_ascent/2024_05_03_vtkm-mr3215-ext-geom-fix.patch) )
- [email protected]
- [email protected] (requires [patch 1](https://github.com/Alpine-DAV/ascent/blob/0aef6cffd522be7419651e6adf586f9a553297d0/scripts/build_ascent/2024_05_03_vtkm-mr3215-ext-geom-fix.patch)
[patch 2](https://github.com/Alpine-DAV/ascent/blob/develop/scripts/build_ascent/2024_07_02_vtkm-mr3246-raysubset_bugfix.patch) )
- [email protected]
- [email protected]
- [email protected]
Expand Down
23 changes: 23 additions & 0 deletions scripts/build_ascent/2024_07_25_silo_4_11_cmake_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0dc4a5b..fd6baaf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -57,7 +57,9 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
###
# grab the version string
###
-file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/VERSION SILO_VERSION)
+file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/SILO_VERSION SILO_VERSION)
+# Strip suffix
+string(REGEX REPLACE "-.*" "" SILO_VERSION "${SILO_VERSION}")

###-----------------------------------------------------------------------------
# project command will automatically create cmake vars for major, minor,
@@ -139,7 +141,9 @@ CMAKE_DEPENDENT_OPTION(SILO_ENABLE_HZIP "Enable Lindstrom hex/quad mesh compress
##
# Set up a default INSTALL prefix that is peer to the build directory
##
-set(CMAKE_INSTALL_PREFIX ${Silo_BINARY_DIR}/../SiloInstall CACHE PATH "install prefix" FORCE)
+if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX ${Silo_BINARY_DIR}/../SiloInstall CACHE PATH "install prefix" FORCE)
+endif()
10 changes: 10 additions & 0 deletions scripts/build_ascent/2024_07_29_silo-pr389-win32-bugfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/src/silo/silo_win32_compatibility.h b/src/silo/silo_win32_compatibility.h
index bc4d38f..00b970c 100644
--- a/src/silo/silo_win32_compatibility.h
+++ b/src/silo/silo_win32_compatibility.h
@@ -1,4 +1,4 @@
-#ifdef WIN32
+#ifdef _WIN32
#ifndef SILO_WIN32_COMPATIBILITY
#define SILO_WIN32_COMPATIBILITY
#include <io.h> /* Include Windows IO *
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
From 7b25b95c30e083e7d8c541f131df10e401f658d6 Mon Sep 17 00:00:00 2001
From: Cyrus Harrison <[email protected]>
Date: Thu, 1 Aug 2024 13:26:40 -0700
Subject: [PATCH] detect if caliper needs adiak

---
src/cmake/thirdparty/SetupCaliper.cmake | 47 +++++++++++++++++-----
src/config/conduit_setup_deps.cmake | 52 +++++++++++++++++++------
2 files changed, 77 insertions(+), 22 deletions(-)

diff --git a/src/cmake/thirdparty/SetupCaliper.cmake b/src/cmake/thirdparty/SetupCaliper.cmake
index 44ad2cc2e..7469097f3 100644
--- a/src/cmake/thirdparty/SetupCaliper.cmake
+++ b/src/cmake/thirdparty/SetupCaliper.cmake
@@ -12,24 +12,51 @@ if(NOT CALIPER_DIR)
MESSAGE(FATAL_ERROR "Caliper support needs explicit CALIPER_DIR")
endif()

-# most common case: caliper is built with adiak support
-# and caliper needs us to find adiak, or else find_pacakge caliper
-# will fail

-# Check for ADIAK_DIR
+# first: look for caliper config header + see what additional deps we need
+#. to resolve.
+
+message(STATUS "Attempting to find cali-config.h with CALIPER_DIR=${CALIPER_DIR} ...")
+find_file(CALI_CONFIG_HEADER
+ NAMES caliper-config.h
+ PATHS ${CALIPER_DIR}
+ PATH_SUFFIXES include/caliper
+ NO_DEFAULT_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_CMAKE_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH)
+
+if(EXISTS ${CALI_CONFIG_HEADER})
+ message(STATUS "Found Caliper Config Header: ${CALI_CONFIG_HEADER}")
+else()
+ message(FATAL_ERROR "Could not find caliper-config.h in caliper ${CALIPER_DIR}/include/caliper")
+endif()

-if(NOT ADIAK_DIR)
- MESSAGE(FATAL_ERROR "Caliper support needs explicit ADIAK_DIR")
+file(READ ${CALI_CONFIG_HEADER} _CALI_CONFIG_HEADER_CONTENTS)
+
+# check if we need ADIAK
+string(FIND ${_CALI_CONFIG_HEADER_CONTENTS} "#define CALIPER_HAVE_ADIAK" _caliper_have_adiak)
+
+if(${_caliper_have_adiak} GREATER_EQUAL 0 )
+ # caliper is built with adiak support and caliper needs us to find adiak,
+ # else find_pacakge caliper will fail
+ # Check for ADIAK_DIR
+ if(NOT ADIAK_DIR)
+ MESSAGE(FATAL_ERROR "Caliper support needs explicit ADIAK_DIR")
+ endif()
+ # find adiak
+ find_package(adiak REQUIRED
+ NO_DEFAULT_PATH
+ PATHS ${ADIAK_DIR}/lib/cmake/adiak)
+ set(ADIAK_FOUND TRUE)
endif()

-find_package(adiak REQUIRED
- NO_DEFAULT_PATH
- PATHS ${ADIAK_DIR}/lib/cmake/adiak)

find_package(caliper REQUIRED
NO_DEFAULT_PATH
PATHS ${CALIPER_DIR}/share/cmake/caliper)

-set(ADIAK_FOUND TRUE)
+
set(CALIPER_FOUND TRUE)
set(CONDUIT_USE_CALIPER TRUE)
diff --git a/src/config/conduit_setup_deps.cmake b/src/config/conduit_setup_deps.cmake
index 0334a2b54..f9022da66 100644
--- a/src/config/conduit_setup_deps.cmake
+++ b/src/config/conduit_setup_deps.cmake
@@ -58,26 +58,54 @@ if(CALIPER_DIR)
message(STATUS "Conduit was built with Caliper Support")
endif()

- if(NOT ADIAK_DIR)
- set(ADIAK_DIR ${CONDUIT_ADIAK_DIR})
+ # use caliper config header to detect necessary deps
+ find_file(CALI_CONFIG_HEADER
+ NAMES caliper-config.h
+ PATHS ${CALIPER_DIR}
+ PATH_SUFFIXES include/caliper
+ NO_DEFAULT_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_CMAKE_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH)
+
+ if(EXISTS ${CALI_CONFIG_HEADER})
+ if(NOT Conduit_FIND_QUIETLY)
+ message(STATUS "Found Caliper Config Header: ${CALI_CONFIG_HEADER}")
+ endif()
+ else()
+ message(FATAL_ERROR "Could not find caliper-config.h in caliper ${CALIPER_DIR}/include/caliper")
endif()

- if(ADIAK_DIR)
- if(NOT Conduit_FIND_QUIETLY)
- message(STATUS "Looking for Adiak at: ${ADIAK_DIR}/lib/cmake/adiak")
+ file(READ ${CALI_CONFIG_HEADER} _CALI_CONFIG_HEADER_CONTENTS)
+
+ # check if we need ADIAK
+ string(FIND ${_CALI_CONFIG_HEADER_CONTENTS} "#define CALIPER_HAVE_ADIAK" _caliper_have_adiak)
+
+ if(${_caliper_have_adiak} GREATER_EQUAL 0 )
+ # caliper is built with adiak support and caliper needs us to find adiak.
+ if(NOT ADIAK_DIR)
+ set(ADIAK_DIR ${CONDUIT_ADIAK_DIR})
+ endif()
+
+ if(ADIAK_DIR)
+ if(NOT Conduit_FIND_QUIETLY)
+ message(STATUS "Looking for Adiak at: ${ADIAK_DIR}/lib/cmake/adiak")
+ endif()
+ # find adiak first
+ find_dependency(adiak REQUIRED
+ NO_DEFAULT_PATH
+ PATHS ${ADIAK_DIR}/lib/cmake/adiak)
endif()
- # find adiak first
- find_package(adiak REQUIRED
- NO_DEFAULT_PATH
- PATHS ${ADIAK_DIR}/lib/cmake/adiak)
endif()
+
if(NOT Conduit_FIND_QUIETLY)
message(STATUS "Looking for Caliper at: ${CALIPER_DIR}/share/cmake/caliper")
endif()
# find caliper
- find_package(caliper REQUIRED
- NO_DEFAULT_PATH
- PATHS ${CALIPER_DIR}/share/cmake/caliper)
+ find_dependency(caliper REQUIRED
+ NO_DEFAULT_PATH
+ PATHS ${CALIPER_DIR}/share/cmake/caliper)
endif()

###############################################################################
Loading

0 comments on commit a7082fa

Please sign in to comment.