-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathbuild-macos.sh
executable file
·80 lines (60 loc) · 2.13 KB
/
build-macos.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash
# (C) Copyright 2024- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.
set -eaux
python_version=$1
uname -a
# HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
HOMEBREW_NO_INSTALL_CLEANUP=1
arch=$(arch)
[[ $arch == "i386" ]] && arch="x86_64" # GitHub Actions on macOS declare i386
ARCH="arch -$arch"
source scripts/common.sh
source scripts/select-python-macos.sh $python_version
#$ARCH brew install cmake ninja pkg-config automake
#$ARCH brew install cmake ninja netcdf libaec
for p in netcdf
do
v=$(brew info $p | grep Cellar | awk '{print $1;}' | awk -F/ '{print $NF;}')
echo "brew $p $v" >> versions
done
# Build eccodes
cd $TOPDIR/build-binaries/eccodes
# We disable JASPER because of a linking issue. JPEG support comes from
# other libraries (e.g. openjpeg)
$ARCH $TOPDIR/src/ecbuild/bin/ecbuild \
$TOPDIR/src/eccodes \
-GNinja \
-DCMAKE_OSX_ARCHITECTURES=$arch \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_FORTRAN=0 \
-DENABLE_BUILD_TOOLS=0 \
-DENABLE_ECCODES_THREADS=1 \
-DENABLE_JPG_LIBJASPER=0 \
-DENABLE_MEMFS=1 \
-DENABLE_INSTALL_ECCODES_DEFINITIONS=0 \
-DENABLE_INSTALL_ECCODES_SAMPLES=0 \
-DCMAKE_INSTALL_PREFIX=$TOPDIR/install \
-DCMAKE_INSTALL_RPATH=$TOPDIR/install/lib $ECCODES_COMMON_CMAKE_OPTIONS
cd $TOPDIR
$ARCH cmake --build build-binaries/eccodes --target install
# Run some basic tests to check the library is ok
cd build-binaries/eccodes
ctest -L sanity
cd $TOPDIR
# Create wheel
rm -fr dist wheelhouse
# echo "================================================================================"
# for n in install/lib/*.dylib
# do
# echo $n
# ./scripts/libs-macos.py $n
# done
# echo "================================================================================"
strip -S install/lib/*.dylib
./scripts/versions.sh > gribapi/binary-versions.txt