Skip to content

Commit

Permalink
[DOR-670] Add macOS hdf5 libs
Browse files Browse the repository at this point in the history
These are taken from conan:
  package_id,outdated,os,arch,compiler.compiler,compiler.libcxx,compiler.runtime,compiler.version,build_type,options.enable_unsupported,options.hl,options.with_zlib,options.enable_cxx,options.szip_support,options.parallel,options.fPIC,options.shared,requires
  34351c3cccf79cd3f1a2404a935159e1d371f42e,False,Macos,armv8,apple-clang,libc++,,13.0,Release,False,True,True,True,,False,True,False,zlib/1.3
  ab133a8e58aee82aa31d6decfbfe42ab699ad2e7,False,Macos,x86_64,apple-clang,libc++,,13.0,Release,False,True,True,True,,False,True,False,zlib/1.3
  • Loading branch information
blawrence-ont committed Apr 22, 2024
1 parent 29399c7 commit 3daead4
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions cmake/HDF5.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
set(HDF_VER hdf5-1.12.1-3)
set(ZLIB_VER 1.2.12)

option(DYNAMIC_HDF "Link HDF as dynamic libs" OFF)

if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"))
# download the pacakge for arm, we want to package this due to hdf5's dependencies

set(DYNAMIC_HDF ON)
set(HDF_VER hdf5-1.10.0-aarch64)
if(EXISTS ${DORADO_3RD_PARTY_DOWNLOAD}/${HDF_VER})
Expand All @@ -16,6 +12,9 @@ if((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (CMAKE_SYSTEM_PROCESSOR STREQUAL "aa
list(PREPEND CMAKE_PREFIX_PATH ${DORADO_3RD_PARTY_DOWNLOAD}/${HDF_VER}/${HDF_VER})

elseif(WIN32)
set(HDF_VER hdf5-1.12.1-3)
set(ZLIB_VER 1.2.12)

# On windows, we need to build HDF5
set(HDF5_ZLIB_INSTALL_DIR ${CMAKE_BINARY_DIR}/zlib-${ZLIB_VER}/install)
if(EXISTS ${DORADO_3RD_PARTY_DOWNLOAD}/${HDF_VER} AND EXISTS ${HDF5_ZLIB_INSTALL_DIR})
Expand All @@ -42,9 +41,21 @@ elseif(WIN32)
list(APPEND CMAKE_PREFIX_PATH ${DORADO_3RD_PARTY_DOWNLOAD}/${HDF_VER}/${HDF_VER})

install(FILES ${HDF5_ZLIB_INSTALL_DIR}/bin/zlib.dll DESTINATION bin)

elseif (IOS)
# iOS doesn't make use of HDF5.
return()

elseif (APPLE)
set(HDF_VER 1.14.3)
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(HDF_ARCH "x86_64")
else()
set(HDF_ARCH "armv8")
endif()
download_and_extract(https://cdn.oxfordnanoportal.com/software/analysis/hdf5-${HDF_VER}-${HDF_ARCH}.zip hdf5-${HDF_VER}-${HDF_ARCH})
list(PREPEND CMAKE_PREFIX_PATH ${DORADO_3RD_PARTY_DOWNLOAD}/hdf5-${HDF_VER}-${HDF_ARCH}/${HDF_VER}_${HDF_ARCH})

endif()

if(DYNAMIC_HDF)
Expand Down

0 comments on commit 3daead4

Please sign in to comment.