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

GMT #5199

Merged
merged 42 commits into from
Mar 15, 2023
Merged

GMT #5199

Changes from 30 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
85abb34
first attempt to compile GMT. Appears to work on mac & linux, bnut no…
boriskaus Jul 21, 2022
5d4eb33
don't think we need this
boriskaus Jul 21, 2022
c61e973
more general NetCDF version (still doesn't like windows, though)
boriskaus Jul 21, 2022
a51eb5d
undo
boriskaus Jul 21, 2022
5211057
Update G/GMT/build_tarballs.jl
boriskaus Jul 23, 2022
04e4d24
Update G/GMT/build_tarballs.jl
boriskaus Jul 23, 2022
641d94c
some progress with the windows install (still incomplete, though)
boriskaus Jul 23, 2022
198c720
Update G/GMT/build_tarballs.jl
boriskaus Jul 24, 2022
bf360b1
update version
boriskaus Jul 24, 2022
bdfde9d
updated to use latest version (attempt to see if this compiles)
boriskaus Mar 3, 2023
5ad90af
Merge branch 'master' into GMT
boriskaus Mar 3, 2023
93d3f76
uses more recent version of gmt
boriskaus Mar 3, 2023
592a36e
Merge branch 'master' into GMT
boriskaus Mar 3, 2023
660b221
progress (it seems)
boriskaus Mar 3, 2023
958bdd1
Merge remote-tracking branch 'origin/GMT' into GMT
boriskaus Mar 3, 2023
9cade5a
libraries
boriskaus Mar 3, 2023
d36193d
explicitly add libraries
boriskaus Mar 3, 2023
6d515de
windows wants a separate treatment
boriskaus Mar 3, 2023
79df42e
requested additions
boriskaus Mar 3, 2023
524302d
updates
boriskaus Mar 3, 2023
a3b9e2d
Update build_tarballs.jl
boriskaus Mar 4, 2023
45bf155
remove patch (no longer required); add support for openMP on mac & at…
boriskaus Mar 4, 2023
c852eef
belongs to previous
boriskaus Mar 4, 2023
20a522b
adds GSSH & DCW to the compilation
boriskaus Mar 4, 2023
72df1f8
typo
boriskaus Mar 4, 2023
17ea5ca
next attempt
boriskaus Mar 4, 2023
fa1dddc
next attempt
boriskaus Mar 5, 2023
fb2d8e3
fix for *ix
boriskaus Mar 5, 2023
7f3627c
bugfix
boriskaus Mar 5, 2023
b648a45
how difficult can this be
boriskaus Mar 5, 2023
6b526be
removing installation block & simpler way to take version numbers int…
boriskaus Mar 5, 2023
9a2d0d3
it doesn't work if we indicate supplements as FileProduct or as Libra…
boriskaus Mar 5, 2023
1d232bc
Update G/GMT/build_tarballs.jl
boriskaus Mar 5, 2023
e778f16
Update G/GMT/build_tarballs.jl
boriskaus Mar 5, 2023
201a32c
add license & additional name for postscript library
boriskaus Mar 6, 2023
30c58c7
Merge branch 'master' into GMT
boriskaus Mar 6, 2023
20fac0a
adding version # for GDAL & update the one of NetCDF
boriskaus Mar 7, 2023
9bd8147
Merge branch 'master' into GMT
boriskaus Mar 10, 2023
7642321
add PROJ_jll dependency
boriskaus Mar 11, 2023
7355ba2
Update build_tarballs.jl
boriskaus Mar 14, 2023
2b38c54
update git hash
boriskaus Mar 15, 2023
4c4171e
Apply suggestions from code review
giordano Mar 15, 2023
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
103 changes: 103 additions & 0 deletions G/GMT/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# 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 = "GMT"
version = v"6.4.0"

GSHHG_VERSION="2.3.7"
DCW_VERSION="2.1.1"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/GenericMappingTools/gmt",
"19413d486888ebdc3c01aeed3707bcc88eb727df"),

ArchiveSource("https://github.com/GenericMappingTools/gshhg-gmt/releases/download/$GSHHG_VERSION/gshhg-gmt-$GSHHG_VERSION.tar.gz",
"9bb1a956fca0718c083bef842e625797535a00ce81f175df08b042c2a92cfe7f"),

ArchiveSource("https://github.com/GenericMappingTools/dcw-gmt/releases/download/$DCW_VERSION/dcw-gmt-$DCW_VERSION.tar.gz",
"d4e208dca88fbf42cba1bb440fbd96ea2f932185c86001f327ed0c7b65d27af1")
]

# Bash recipe for building across all platforms
script = raw"""

GSHHG_VERSION_numeric=2.3.7
GSSHG="gshhg-gmt-2.3.7"
DCW="dcw-gmt-2.1.1"
boriskaus marked this conversation as resolved.
Show resolved Hide resolved
EXT="tar.gz"
boriskaus marked this conversation as resolved.
Show resolved Hide resolved

cd $WORKSPACE/srcdir
cd gmt
mkdir build
cd build/

cmake -DCMAKE_INSTALL_PREFIX=${prefix} \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
-DHAVE_QSORT_R_GLIBC=False \
-DHAVE___BUILTIN_BSWAP16=False \
-DHAVE___BUILTIN_BSWAP32=False \
-DHAVE___BUILTIN_BSWAP64=False \
-DGMT_ENABLE_OPENMP=True \
giordano marked this conversation as resolved.
Show resolved Hide resolved
-DGSHHG_PATH=/workspace/srcdir/${GSSHG} \
-DGSHHG_VERSION=${GSHHG_VERSION_numeric} \
-DDCW_PATH=/workspace/srcdir/${DCW} \
giordano marked this conversation as resolved.
Show resolved Hide resolved
..
make -j${nproc}
make install

if [[ "${target}" == *-mingw* ]]; then
install -Dvm 755 /workspace/destdir/bin/gmt.${dlext} "${libdir}/libgmt.${dlext}"
giordano marked this conversation as resolved.
Show resolved Hide resolved
install -Dvm 755 /workspace/destdir/bin/postscriptlight.${dlext} "${libdir}/libpostscriptlight.${dlext}"

# note that this removes the *.dll:
install -Dvm 755 /workspace/destdir/bin/gmt_plugins/supplements.* "${libdir}/supplements"

else
# supplements is an *.so file on *ix systems; which is installed with (note that this removes the extension):
install -Dvm 755 /workspace/destdir/lib/gmt/plugins/supplements.* "${bindir}/supplements"
giordano marked this conversation as resolved.
Show resolved Hide resolved

fi

boriskaus marked this conversation as resolved.
Show resolved Hide resolved
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = [
Platform("x86_64", "linux"; libc = "glibc"),
Platform("aarch64", "linux"; libc = "glibc"),
Platform("x86_64", "macos"; ),
Platform("aarch64", "macos"; ),
Platform("x86_64", "windows"; ),
Platform("i686", "windows"; ),
]


# The products that we will ensure are always built
products = [
LibraryProduct("libpostscriptlight", :libpostscriptlight),
boriskaus marked this conversation as resolved.
Show resolved Hide resolved
LibraryProduct("libgmt", :libgmt),
boriskaus marked this conversation as resolved.
Show resolved Hide resolved
ExecutableProduct("gmt", :gmt),
FileProduct("bin/supplements", :supplements)
]

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency(PackageSpec(name="LibCURL_jll", uuid="deac9b47-8bc7-5906-a0fe-35ac56dc84c0"); compat="7.73.0")
Dependency("NetCDF_jll", compat="400.702.402")
Dependency(PackageSpec(name="GDAL_jll", uuid="a7073274-a066-55f0-b90d-d619367d196c"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per #5199 (comment), it's probably a good idea to add compat bounds for this package.

Dependency(PackageSpec(name="FFTW_jll", uuid="f5851436-0d7a-5f13-b9de-f02708fd171a"))
Dependency(PackageSpec(name="PCRE_jll", uuid="2f80f16e-611a-54ab-bc61-aa92de5b98fc"))
Dependency(PackageSpec(name="LAPACK32_jll", uuid="17f450c3-bd24-55df-bb84-8c51b4b939e3"))
Dependency(PackageSpec(name="OpenBLAS32_jll", uuid="656ef2d0-ae68-5445-9ca0-591084a874a2"))
Dependency(PackageSpec(name="FFMPEG_jll", uuid="b22a6f82-2f65-5046-a5b2-351ab43fb4e5"))
Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"))
Dependency(PackageSpec(name="Ghostscript_jll", uuid="61579ee1-b43e-5ca0-a5da-69d92c66a64b"))
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae"); platforms=filter(!Sys.isbsd, platforms))
Dependency(PackageSpec(name="LLVMOpenMP_jll", uuid="1d63c593-3942-5779-bab2-d838dc0a180e"); platforms=filter(Sys.isbsd, platforms))
]

# 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"7.1.0")