@@ -8,7 +8,7 @@ export NO_CDL=1
88# uncomment build_wheel and enable plugin install in build_netcdf.
99# if plugins not include, plugins will not work with these wheels unless user sets
1010# HDF5_PLUGIN_PATH to point to locally installed plugins.
11- export NO_PLUGINS=1
11+ # export NO_PLUGINS=1
1212
1313# Compile libs for macOS 10.9 or later
1414export MACOSX_DEPLOYMENT_TARGET=" 10.9"
@@ -25,11 +25,11 @@ export BZIP2_VERSION="1.0.8"
2525export BLOSC_VERSION=" 1.21.1"
2626
2727# custom version that sets NETCDF_PLUGIN_DIR env var
28- # function build_wheel {
29- # # Set default building method to pip
30- # export NETCDF_PLUGIN_DIR=${BUILD_PREFIX}/lib/netcdf-plugins
31- # wrap_wheel_builder build_pip_wheel $@
32- # }
28+ function build_wheel {
29+ # Set default building method to pip
30+ export NETCDF_PLUGIN_DIR=${BUILD_PREFIX} /lib/netcdf-plugins
31+ wrap_wheel_builder build_pip_wheel $@
32+ }
3333
3434# add --verbose to pip
3535function pip_opts {
@@ -108,48 +108,43 @@ function build_zstd {
108108function build_netcdf {
109109 if [ -e netcdf-stamp ]; then return ; fi
110110 fetch_unpack https://downloads.unidata.ucar.edu/netcdf-c/${NETCDF_VERSION} /netcdf-c-${NETCDF_VERSION} .tar.gz
111- # use autotools
112- # no plugins installed
113- # (cd netcdf-c-${NETCDF_VERSION} \
114- # && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap \
115- # && make -j4 \
116- # && make install )
117- # plugins installed
118- # (cd netcdf-c-${NETCDF_VERSION} \
119- # && export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
120- # && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --with-plugin-dir=$HDF5_PLUGIN_PATH \
121- # && make -j4 \
122- # && make install )
123- # use cmake
124- # CMakeLists.txt patch needed for NETCDF_VERSION 4.9.0
125- # no plugins installed
126- if [[ ! -z " IS_OSX" && " $PLAT " = " arm64" ]] && [[ " $CROSS_COMPILING " = " 1" ]]; then
127- (cd netcdf-c-${NETCDF_VERSION} \
128- && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap \
129- && make -j4 \
130- && make install )
111+ if [[ -n " IS_OSX" ]]; then
112+ if [[ " $PLAT " = " arm64" ]] && [[ " $CROSS_COMPILING " = " 1" ]]; then
113+ (cd netcdf-c-${NETCDF_VERSION} \
114+ && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap \
115+ && make -j4 \
116+ && make install )
117+ else
118+ # plugins installed
119+ (cd netcdf-c-${NETCDF_VERSION} \
120+ && export HDF5_PLUGIN_PATH=$BUILD_PREFIX /lib/netcdf-plugins \
121+ && ./configure --prefix=$BUILD_PREFIX --enable-netcdf-4 --enable-shared --enable-dap --with-plugin-dir=$HDF5_PLUGIN_PATH \
122+ && make -j4 \
123+ && make install )
124+ fi
131125 else
132- (cd netcdf-c-${NETCDF_VERSION} \
133- && curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
134- && patch -p0 < CMakeLists.txt.patch \
135- && mkdir build \
136- && cd build \
137- && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DENABLE_PLUGIN_INSTALL=NO \
138- && make -j4 \
139- && make install )
126+ # CMakeLists.txt patch needed for NETCDF_VERSION 4.9.0
127+ # (cd netcdf-c-${NETCDF_VERSION} \
128+ # && curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
129+ # && patch -p0 < CMakeLists.txt.patch \
130+ # && mkdir build \
131+ # && cd build \
132+ # && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DENABLE_PLUGIN_INSTALL=NO \
133+ # && make -j4 \
134+ # && make install )
135+ # plugins installed
136+ (cd netcdf-c-${NETCDF_VERSION} \
137+ && curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
138+ && patch -p0 < CMakeLists.txt.patch \
139+ && mkdir build \
140+ && cd build \
141+ && export HDF5_PLUGIN_PATH=$BUILD_PREFIX /lib/netcdf-plugins \
142+ && mkdir -p $HDF5_PLUGIN_PATH \
143+ && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
144+ && make -j4 \
145+ && make install \
146+ && ls -l $HDF5_PLUGIN_PATH )
140147 fi
141- # plugins installed
142- # (cd netcdf-c-${NETCDF_VERSION} \
143- # && curl https://raw.githubusercontent.com/MacPython/netcdf4-python-wheels/master/CMakeLists.txt.patch -o CMakeLists.txt.patch \
144- # && patch -p0 < CMakeLists.txt.patch \
145- # && mkdir build \
146- # && cd build \
147- # && export HDF5_PLUGIN_PATH=$BUILD_PREFIX/lib/netcdf-plugins \
148- # && mkdir -p $HDF5_PLUGIN_PATH \
149- # && cmake ../ -DCMAKE_INSTALL_PREFIX=${BUILD_PREFIX} -DENABLE_NETCDF_4=ON -DENABLE_DAP=ON -DBUILD_SHARED_LIBS=ON -DPLUGIN_INSTALL_DIR=YES \
150- # && make -j4 \
151- # && make install \
152- # && ls -l $HDF5_PLUGIN_PATH )
153148 touch netcdf-stamp
154149}
155150
0 commit comments