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

[GDAL] Use NetCDF and HDF5 when available. #5466

Merged
merged 4 commits into from
Sep 11, 2022
Merged
Changes from 1 commit
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
60 changes: 39 additions & 21 deletions G/GDAL/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name = "GDAL"
upstream_version = v"3.5.1"
version_offset = v"0.0.1"
version = VersionNumber(upstream_version.major * 100 + version_offset.major,
upstream_version.minor * 100 + version_offset.minor,
upstream_version.patch * 100 + version_offset.patch)
upstream_version.minor * 100 + version_offset.minor,
upstream_version.patch * 100 + version_offset.patch)
evetion marked this conversation as resolved.
Show resolved Hide resolved

# Collection of sources required to build GDAL
sources = [
Expand All @@ -28,25 +28,41 @@ if [[ "${target}" == *-freebsd* ]]; then
export LDFLAGS="-undefined"
fi

cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_PREFIX_PATH=${prefix} \
-DCMAKE_FIND_ROOT_PATH=${prefix} \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_JAVA_BINDINGS=OFF \
-DBUILD_CSHARP_BINDINGS=OFF \
-DGDAL_USE_CURL=ON \
-DGDAL_USE_EXPAT=ON \
-DGDAL_USE_GEOTIFF=ON \
-DGDAL_USE_GEOS=ON \
-DGDAL_USE_OPENJPEG=ON \
-DGDAL_USE_SQLITE3=ON \
-DGDAL_USE_TIFF=ON \
-DGDAL_USE_ZLIB=ON \
-DGDAL_USE_ZSTD=ON \
..
CMAKE_FLAGS=(-DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}
-DCMAKE_PREFIX_PATH=${prefix}
-DCMAKE_FIND_ROOT_PATH=${prefix}
-DCMAKE_BUILD_TYPE=Release
-DBUILD_PYTHON_BINDINGS=OFF
-DBUILD_JAVA_BINDINGS=OFF
-DBUILD_CSHARP_BINDINGS=OFF
-DGDAL_USE_CURL=ON
-DGDAL_USE_EXPAT=ON
-DGDAL_USE_GEOTIFF=ON
-DGDAL_USE_GEOS=ON
-DGDAL_USE_OPENJPEG=ON
-DGDAL_USE_SQLITE3=ON
-DGDAL_USE_TIFF=ON
-DGDAL_USE_ZLIB=ON
-DGDAL_USE_ZSTD=ON)

# NetCDF is the most restrictive dependency as far as platform availability, so we'll use it where applicable but disable it otherwise
if ! find ${libdir} -name "libnetcdf*.${dlext}" -exec false '{}' +; then
CMAKE_FLAGS+=(-DGDAL_USE_NETCDF=ON)
else
echo "Disabling NetCDF support"
CMAKE_FLAGS+=(-DGDAL_USE_NETCDF=OFF)
fi

# HDF5 is also a restrictive dependency as far as platform availability, so we'll use it where applicable but disable it otherwise
if ! find ${libdir} -name "libhdf5*.${dlext}" -exec false '{}' +; then
CMAKE_FLAGS+=(-DGDAL_USE_HDF5=ON)
else
echo "Disabling HDF5 support"
CMAKE_FLAGS+=(-DGDAL_USE_HDF5=OFF)
fi

cmake .. ${CMAKE_FLAGS[@]}
cmake --build . -j${nproc}
cmake --build . -j${nproc} --target install
"""
Expand Down Expand Up @@ -91,8 +107,10 @@ dependencies = [
Dependency("Libtiff_jll"; compat="4.3"),
Dependency("libgeotiff_jll"; compat="100.700.100"),
Dependency("LibCURL_jll"; compat="7.73"),
Dependency("NetCDF_jll"; compat="400.902.5"),
Dependency("HDF5_jll")
evetion marked this conversation as resolved.
Show resolved Hide resolved
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
julia_compat="1.6", preferred_gcc_version=v"8")
julia_compat="1.6", preferred_gcc_version=v"8")
evetion marked this conversation as resolved.
Show resolved Hide resolved