Skip to content

Commit 5dceef2

Browse files
committed
only use cmake on linux
1 parent 194f8ae commit 5dceef2

File tree

1 file changed

+38
-24
lines changed

1 file changed

+38
-24
lines changed

config.sh

Lines changed: 38 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export NO_CDL=1
88
# Compile libs for macOS 10.9 or later
99
export MACOSX_DEPLOYMENT_TARGET="10.9"
1010
export NETCDF_VERSION="4.9.0"
11-
export HDF5_VERSION="1.12.2"
11+
export HDF5_VERSION="1.12.1"
1212
# old openssl, since building new version requires perl 5.10.0
1313
export OPENSSL_ROOT=openssl-1.0.2u
1414
export OPENSSL_HASH=ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16
@@ -104,30 +104,44 @@ function build_netcdf {
104104
if [ -e netcdf-stamp ]; then return; fi
105105
fetch_unpack https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION}/netcdf-c-${NETCDF_VERSION}.tar.gz
106106
# cmake build
107-
(cd netcdf-c-${NETCDF_VERSION} \
108-
&& curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
109-
&& patch -p0 < CMakeLists.txt.patch \
110-
&& mkdir build \
111-
&& cd build \
112-
&& export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
113-
&& mkdir -p $HDF5_PLUGIN_PATH \
114-
&& cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
115-
&& make -j4 \
116-
&& make install \
117-
&& ls -l $HDF5_PLUGIN_PATH )
107+
#(cd netcdf-c-${NETCDF_VERSION} \
108+
# && curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
109+
# && patch -p0 < CMakeLists.txt.patch \
110+
# && mkdir build \
111+
# && cd build \
112+
# && export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
113+
# && mkdir -p $HDF5_PLUGIN_PATH \
114+
# && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
115+
# && make -j4 \
116+
# && make install \
117+
# && ls -l $HDF5_PLUGIN_PATH )
118118
# autotools build
119-
#if [[ ! -z "IS_OSX" && "$PLAT" = "arm64" ]] && [[ "$CROSS_COMPILING" = "1" ]]; then
120-
# (cd netcdf-c-${NETCDF_VERSION} \
121-
# && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap \
122-
# && make -j4 \
123-
# && make install )
124-
#else
125-
# (cd netcdf-c-${NETCDF_VERSION} \
126-
# && export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
127-
# && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --with-plugin-dir=$HDF5_PLUGIN_PATH \
128-
# && make -j4 \
129-
# && make install )
130-
#fi
119+
if [[ ! -z "IS_OSX" ]]; then
120+
if [[ ! -z "IS_OSX" && "$PLAT" = "arm64" ]] && [[ "$CROSS_COMPILING" = "1" ]]; then
121+
(cd netcdf-c-${NETCDF_VERSION} \
122+
&& ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap \
123+
&& make -j4 \
124+
&& make install )
125+
else
126+
(cd netcdf-c-${NETCDF_VERSION} \
127+
&& export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
128+
&& ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --with-plugin-dir=$HDF5_PLUGIN_PATH \
129+
&& make -j4 \
130+
&& make install )
131+
fi
132+
else
133+
(cd netcdf-c-${NETCDF_VERSION} \
134+
&& curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
135+
&& patch -p0 < CMakeLists.txt.patch \
136+
&& mkdir build \
137+
&& cd build \
138+
&& export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
139+
&& mkdir -p $HDF5_PLUGIN_PATH \
140+
&& cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
141+
&& make -j4 \
142+
&& make install \
143+
&& ls -l $HDF5_PLUGIN_PATH )
144+
fi
131145
touch netcdf-stamp
132146
}
133147

0 commit comments

Comments
 (0)