Skip to content

Commit

Permalink
do not require HDF5 1.8.11
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Aug 15, 2023
1 parent 22d6187 commit 900d9c9
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 56 deletions.
80 changes: 32 additions & 48 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ env:
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# build-and-push-image:
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
#
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
#
# - name: Log in to the Container registry
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
#
# - name: Extract metadata (tags, labels) for Docker
# id: meta
# uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
# with:
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
#
# - name: Build and push Docker image
# uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
# with:
# context: .
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}

native-build:
name:
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
echo "------ running ziptool ------"
./bin/ziptool || true
- name: install msys2
- name: Install Windows Dependencies
if: matrix.platform == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
Expand All @@ -141,22 +141,6 @@ jobs:
mingw-w64-clang-x86_64-libzip
mingw-w64-clang-x86_64-netcdf
# - name: Install Windows Dependencies
# if: matrix.platform == 'windows-latest'
# shell: msys2 {0}
# run: |
# pacman --noconfirm -S mingw-w64-x86_64-boost mingw-w64-x86_64-hdf5 mingw-w64-x86_64-libzip mingw-w64-x86_64-netcdf
#
# PATH="/c/Program Files/LLVM/bin:$PATH"
#
# gcc --version
# gfortran --version
# cmake --version
# pacman -Q mingw-w64-x86_64-boost
# pacman -Q mingw-w64-x86_64-hdf5
# pacman -Q mingw-w64-x86_64-libzip
# pacman -Q mingw-w64-x86_64-netcdf

- name: Build Windows
if: matrix.platform == 'windows-latest'
shell: msys2 {0}
Expand Down Expand Up @@ -186,7 +170,7 @@ jobs:
-DOPTION_TARGET_HY3S_SOLVERS=OFF \
-B . -S ..
ninja
ninja -j 1
- name: Test Windows
if: matrix.platform == 'windows-latest'
Expand Down
34 changes: 28 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ endif()
#if (APPLE)
#endif()

#set(HDF5_BUILD_CPP_LIB ON)
set(HDF5_BUILD_CPP_LIB OFF CACHE BOOL "" )
message("hdf5 cpp ${HDF5_BUILD_CPP_LIB}")

set(LINUX FALSE)
Expand All @@ -152,7 +152,7 @@ endif()
set(WINDOWS FALSE)
if (${CMAKE_SYSTEM_NAME} MATCHES Windows)
set(WINDOWS TRUE)
set(WIN32 TRUE)
# set(WIN32 TRUE)
if (${CMAKE_GENERATOR} MATCHES "Unix Makefiles")
set(MINGW TRUE)
endif (${CMAKE_GENERATOR} MATCHES "Unix Makefiles")
Expand Down Expand Up @@ -197,8 +197,12 @@ set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}")

add_definitions(-DUNIX)

set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
#if (MINGW)
# add_definitions(-DWIN32)
#endif(MINGW)

#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
#set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")


if (OPTION_TARGET_MESSAGING)
Expand Down Expand Up @@ -235,9 +239,9 @@ if (${OPTION_TARGET_MOVINGBOUNDARY_SOLVER} OR
if (${HDF5_BUILD_CPP_LIB})
add_subdirectory(hdf5-1.8.11)
else()
# set(HDF5_USE_STATIC_LIBRARIES ON)
set(HDF5_USE_STATIC_LIBRARIES ON)
#CMakeList.txt that comes with hdf5 switches library name if compiled with debug
find_package(HDF5 1.8.11 REQUIRED COMPONENTS HL CXX C)
find_package(HDF5 COMPONENTS HL CXX C)
set(HDF_VERSION ${HDF5_VERSION})
###### ${HDF5_HL_LIBRARIES} ${HDF5_CXX_LIBRARIES}
if (${OPTION_TARGET_CHOMBO2D_SOLVER} OR
Expand Down Expand Up @@ -382,3 +386,21 @@ endif()

FetchContent_MakeAvailable(googletest)
enable_testing()

get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()

include(CMakePrintHelpers)
cmake_print_variables(OPTION_TARGET_MESSAGING OPTION_TARGET_PARALLEL OPTION_TARGET_PETSC
OPTION_TARGET_DOCS OPTION_TARGET_CHOMBO2D_SOLVER OPTION_TARGET_CHOMBO3D_SOLVER
OPTION_TARGET_SMOLDYN_SOLVER OPTION_TARGET_FV_SOLVER OPTION_TARGET_STOCHASTIC_SOLVER
OPTION_TARGET_NFSIM_SOLVER OPTION_TARGET_MOVINGBOUNDARY_SOLVER OPTION_TARGET_SUNDIALS_SOLVER
OPTION_TARGET_HY3S_SOLVERS OPTION_TARGET_LIBSMOLDYN OPTION_TARGET_VCELL OPTION_TARGET_NSV )
cmake_print_variables(CMAKE_CXX_FLAGS CMAKE_C_FLAGS CMAKE_Fortran_FLAGS)
cmake_print_variables(CMAKE_SYSTEM_NAME WINDOWS WIN32 MINGW APPLE ARCH_64bit ARCH_32bit)
cmake_print_variables(CMAKE_CPP_COMPILER CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_Fortran_COMPILER)
cmake_print_variables(HAVE_ZLIB)

2 changes: 0 additions & 2 deletions VCellZipUtils/src/ZipUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ using std::endl;
using namespace std;
struct zip;

#if ( !defined(WIN32) && !defined(WIN64) ) // UNIX
#include <unistd.h>
#endif

bool exists(const char* name){
if (FILE *file = fopen(name, "r")) {
Expand Down

0 comments on commit 900d9c9

Please sign in to comment.