From 9fa02350c414bad0716517d4ffee04377cfa94d2 Mon Sep 17 00:00:00 2001 From: Jake Bolewski Date: Wed, 5 Jan 2022 13:46:05 -0700 Subject: [PATCH] add build recipe for tempestremap library --- T/TempestRemap/build_tarballs.jl | 91 ++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 T/TempestRemap/build_tarballs.jl diff --git a/T/TempestRemap/build_tarballs.jl b/T/TempestRemap/build_tarballs.jl new file mode 100644 index 00000000000..c1bb7c24370 --- /dev/null +++ b/T/TempestRemap/build_tarballs.jl @@ -0,0 +1,91 @@ +# Note that this script can accept some limited command-line arguments, run +# `julia build_tarballs.jl --help` to see a usage message. +using BinaryBuilder, Pkg + +name = "TempestRemap" +version = v"2.1.1" +sources = [ + ArchiveSource("https://github.com/ClimateGlobalChange/tempestremap/archive/refs/tags/v$(version).tar.gz", + "f5ea21f82b358ba127550fc1f49e701cba0379d22ce030c274135109f678b980"), +] + +script = raw""" +cd ${WORKSPACE}/srcdir/tempestremap* + +export CPPFLAGS="-I${includedir}" +export LDFLAGS="-L${libdir}" +export LDFLAGS_MAKE="${LDFLAGS}" +CONFIGURE_OPTIONS="" + +autoreconf -fiv +mkdir -p build && cd build + +../configure \ + --prefix=${prefix} \ + --host=${target} \ + --with-blas=blastrampoline \ + --with-lapack=blastrampoline \ + --with-netcdf=${prefix} \ + --with-hdf5=${prefix} \ + --enable-shared \ + --disable-static + +make LDFLAGS="${LDFLAGS_MAKE}" -j${nproc} all +make install + +install_license ../LICENSE +""" + +# Note: We are restricted to the platforms that NetCDF supports, the library is Unix only +platforms = [ + Platform("x86_64", "linux"), + Platform("aarch64", "linux"; libc="glibc"), + Platform("x86_64", "macos"), +] +platforms = expand_cxxstring_abis(platforms) + +products = [ + LibraryProduct("libTempestRemap", :libTempestRemap), + ExecutableProduct("AnalyzeMap", :AnalyzeMap_exe), + ExecutableProduct("ApplyOfflineMap", :ApplyOfflineMap_exe), + ExecutableProduct("CalculateDiffNorms", :CalculateDiffNorms_exe), + ExecutableProduct("CoarsenRectilinearData", :CoarsenRectilinearData_exe), + ExecutableProduct("ConvertExodusToSCRIP", :ConvertExodusToSCRIP_exe), + ExecutableProduct("ConvertSCRIPToExodus", :ConvertSCRIPToExodus_exe), + ExecutableProduct("GenerateCSMesh", :GenerateCSMesh_exe), + ExecutableProduct("GenerateGLLMetaData", :GenerateGLLMetaData_exe), + ExecutableProduct("GenerateICOMesh", :GenerateICOMesh_exe), + ExecutableProduct("GenerateLambertConfConicMesh", :GenerateLambertConfConicMesh_exe), + ExecutableProduct("GenerateOfflineMap", :GenerateOfflineMap_exe), + ExecutableProduct("GenerateOverlapMesh", :GenerateOverlapMesh_exe), + ExecutableProduct("GenerateOverlapMesh_v1", :GenerateOverlapMesh_v1_exe), + ExecutableProduct("GenerateRLLMesh", :GenerateRLLMesh_exe), + ExecutableProduct("GenerateRectilinearMeshFromFile", :GenerateRectilinearMeshFromFile_exe), + ExecutableProduct("GenerateStereographicMesh", :GenerateStereographicMesh_exe), + ExecutableProduct("GenerateTestData", :GenerateTestData_exe), + ExecutableProduct("GenerateTransectMesh", :GenerateTransectMesh_exe), + ExecutableProduct("GenerateTransposeMap", :GenerateTransposeMap_exe), + ExecutableProduct("GenerateUTMMesh", :GenerateUTMMesh_exe), + ExecutableProduct("GenerateVolumetricMesh", :GenerateVolumetricMesh_exe), + ExecutableProduct("MeshToTxt", :MeshToTxt_exe), + ExecutableProduct("RestructureData", :RestructureData_exe), + ExecutableProduct("ShpToMesh", :ShpToMesh_exe), + ExecutableProduct("VerticalInterpolate", :VerticalInterpolate_exe), +] + +dependencies = Dependency[ + Dependency("libblastrampoline_jll"), + Dependency("NetCDF_jll"), + Dependency("HDF5_jll"), + # The following is adapted from NetCDF_jll + Dependency("LibCURL_jll"), + # The following libraries are dependencies of LibCURL_jll which is now a + # stdlib, but the stdlib doesn't explicitly list its dependencies + Dependency("LibSSH2_jll"), + Dependency("MbedTLS_jll", v"2.24.0"), + Dependency("nghttp2_jll"), +] + +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; + julia_compat="1.7", +)