From 2d4f2e5d052117ae564c3d75ad53a36d0e362f4a Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 8 Jun 2023 14:36:37 -0600 Subject: [PATCH 1/3] Removing unmaintained fortran boostrap code. It was a nice thought, but never broadly adopted and didn't work super well. --- CMakeLists.txt | 24 -------- configure.ac | 15 ----- postinstall.sh.in | 136 ---------------------------------------------- 3 files changed, 175 deletions(-) delete mode 100644 postinstall.sh.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 6630a16356..b4a95d9525 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -442,30 +442,6 @@ OPTION(ENABLE_MMAP "Use MMAP." ON) # Option to use examples. OPTION(ENABLE_EXAMPLES "Build Examples" ON) -# Option to automatically build netcdf-fortran. -IF(NOT MSVC) - OPTION(ENABLE_REMOTE_FORTRAN_BOOTSTRAP "Download and build netcdf-fortran automatically (EXPERIMENTAL)." OFF) - IF(ENABLE_REMOTE_FORTRAN_BOOTSTRAP) - SET(BUILD_FORTRAN ON) - ENDIF() - IF(BUILD_FORTRAN) - CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/postinstall.sh.in" - "${CMAKE_BINARY_DIR}/postinstall.sh" - @ONLY) - - ADD_CUSTOM_TARGET(build-netcdf-fortran - COMMAND sh -c "${CMAKE_BINARY_DIR}/postinstall.sh -t cmake -a build" - DEPENDS netcdf - ) - - ADD_CUSTOM_TARGET(install-netcdf-fortran - COMMAND sh -c "${CMAKE_BINARY_DIR}/postinstall.sh -t cmake -a install" - DEPENDS build-netcdf-fortran - ) - - ENDIF(BUILD_FORTRAN) -ENDIF() - ### # Allow the user to specify libraries # to link against, similar to automakes 'LIBS' variable. diff --git a/configure.ac b/configure.ac index 1c49a0cb2f..f68feaaaa4 100644 --- a/configure.ac +++ b/configure.ac @@ -352,14 +352,6 @@ if test "x$enable_hdf4_file_tests" = xyes; then fi AC_MSG_RESULT($enable_hdf4_file_tests) -# Does the user want to try to install netcdf-fortran -# automatically? -AC_MSG_CHECKING([whether we should attempt to install netcdf-fortran (EXPERIMENTAL)]) -AC_ARG_ENABLE([remote-fortran-bootstrap], [AS_HELP_STRING([--enable-remote-fortran-bootstrap], - [Download and install netcdf-fortran (EXPERIMENTAL)])]) -test "x$enable_remote_fortran_bootstrap" = xyes || enable_remote_fortran_bootstrap=no -AC_MSG_RESULT([$enable_remote_fortran_bootstrap]) - # Does the user want to run extra parallel tests when parallel netCDF-4 is built? AC_MSG_CHECKING([whether parallel IO tests should be run]) AC_ARG_ENABLE([parallel-tests], @@ -1757,11 +1749,6 @@ if test "x$enable_erange_fill" = xyes ; then fi AC_SUBST(M4FLAGS) -# Check for downloading/building fortran via postinstall script. -if test "x$enable_remote_fortran_bootstrap" = xyes; then - AC_DEFINE([BUILD_FORTRAN], 1, [If true, will attempt to download and build netcdf-fortran.]) -fi - # No logging for netcdf-3. if test "x$enable_netcdf_4" = xno; then enable_logging=no @@ -1842,7 +1829,6 @@ AM_CONDITIONAL(USE_HDF5, [test x$enable_hdf5 = xyes]) AM_CONDITIONAL(USE_HDF4, [test x$enable_hdf4 = xyes]) AM_CONDITIONAL(USE_HDF4_FILE_TESTS, [test x$enable_hdf4_file_tests = xyes]) AM_CONDITIONAL(USE_RENAMEV3, [test x$enable_netcdf_4 = xyes -o x$enable_dap = xyes]) -AM_CONDITIONAL(BUILD_FORTRAN, [test x$enable_remote_fortran_bootstrap = xyes]) AM_CONDITIONAL(USE_PNETCDF, [test x$enable_pnetcdf = xyes]) AM_CONDITIONAL(USE_DISPATCH, [test x$enable_dispatch = xyes]) AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes]) @@ -2167,7 +2153,6 @@ AC_CONFIG_FILES([nc-config], [chmod 755 nc-config]) AC_CONFIG_FILES([Makefile netcdf.pc libnetcdf.settings - postinstall.sh include/netcdf_meta.h include/netcdf_dispatch.h include/Makefile diff --git a/postinstall.sh.in b/postinstall.sh.in deleted file mode 100644 index 11bfa5d9aa..0000000000 --- a/postinstall.sh.in +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/bash -# Script to automatically build, install netcdf-fortran. -# Very rought draft. - -DOCMAKE="" -DOAUTOTOOL="" -DOACTION="" -TARGVERSION="v4.4.4" - -MARG="" -if [ $# -lt 1 ]; then - echo "" - echo "WARNING! THIS SCRIPT IS NOT MEANT TO BE RUN MANUALLY." - echo "WARNING! THIS SCRIPT IS NOT MEANT TO BE RUN MANUALLY." - echo "" - exit 1 -fi - - -## -# Check for 'git', exit if it's not found. -## -hash git 2>/dev/null -if [ $? -eq 1 ]; then - echo "ERROR: 'git' is required to install netcdf-fortran automatically" - echo "through this method. Please reinstall git and try again." - exit 1 -fi - -while getopts "a:t:" o; do - case "${o}" in - t) - MARG=${OPTARG} - ;; - a) - DOACTION=${OPTARG} - ;; - *) - echo "Specify type with -t. Types are autotools or cmake." - exit 1 - ;; - esac -done - - -### -# Make sure we're specifying an allowed -# build system. -### -case ${MARG} in - cmake) - DOCMAKE="TRUE" - ;; - autotools) - DOAUTOTOOL="TRUE" - ;; - *) - echo "Illegal type. Types are autotools or cmake." - exit 1 - ;; -esac - -### -# Make sure we're performing a valid action. -### -case ${DOACTION} in - build) - ;; - install) - ;; - *) - echo "Illegal action." - exit 1 - ;; -esac - - -### -# Fetch netcdf-fortran from git if need be. -### - -if [ ! -d "netcdf-fortran" ]; then - git clone http://github.com/unidata/netcdf-fortran - -fi - -cd netcdf-fortran -git checkout $TARGVERSION - -### -# Invoke cmake to build netcdf-fortran -### - -if [ "x$DOCMAKE" = "xTRUE" ]; then - - mkdir -p build - cd build - - if [ "x$DOACTION" = "xbuild" ]; then - cmake .. -DCMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@ -DCMAKE_INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ -DBUILD_SHARED_LIBS=@BUILD_SHARED_LIBS@ -DTEST_PARALLEL=@ENABLE_PARALLEL@ && - make && make test - fi - - if [ "x$DOACTION" = "xinstall" ]; then - make install - fi - -fi - -if [ "x$DOAUTOTOOL" = "xTRUE" ]; then - - if [ "x$DOACTION" = "xbuild" ]; then - if [ ! -f "configure" ]; then - autoreconf -if - fi - - STATIC_BUILD="--disable-static" - if [ "x@enable_static@" = "xyes" ]; then - STATIC_BUILD="--enable-static" - fi - - SHARED_BUILD="--disable-shared" - if [ "x@enable_shared@" = "xyes" ]; then - SHARED_BUILD="--enable-shared" - fi - - LIBS="@LIBS@" CFLAGS="-I@prefix@/include" LDFLAGS="-L@prefix@/lib" ./configure --prefix=@prefix@ $STATIC_BUILD $SHARED_BUILD - LIBS="@LIBS@" make - LIBS="@LIBS@" make check - fi - - if [ "x$DOACTION" = "xinstall" ]; then - make install - fi - -fi From aa0bf2ec2902d4400a3c56794ac82cccc26eab51 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 8 Jun 2023 14:38:58 -0600 Subject: [PATCH 2/3] Additional changes to strip out fortran bootstrap. --- Makefile.am | 26 -------------------------- config.h.cmake.in | 3 --- 2 files changed, 29 deletions(-) diff --git a/Makefile.am b/Makefile.am index c24f2c19d0..b72b9eee1b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,32 +168,6 @@ mm4:: b=`basename $$m` ; d=`dirname $$m`;\ pushd $$d; m4 -s $${b}.m4 > $${b}.c ; popd; done -##### -# If ENABLE_FORTRAN was turned on, -# we have new make targets, build-netcdf-fortran and -# install-netcdf-fortran. -##### - -### -# build-netcdf-fortran -### -if BUILD_FORTRAN - -build-netcdf-fortran: - echo "Downloading and Building NetCDF-Fortran" - chmod u+x $(abs_top_builddir)/postinstall.sh - sh -c "$(abs_top_builddir)/postinstall.sh -t autotools -a build" - -### -# install-netcdf-fortran -### -install-netcdf-fortran: - echo "Installing NetCDF-Fortran" - chmod u+x $(abs_top_builddir)/postinstall.sh - sh -c "$(abs_top_builddir)/postinstall.sh -t autotools -a install" - -endif - check_nc_config: $(CC) `./nc-config --cflags` test_prog.c -o test_prog `./nc-config --libs` ./test_prog diff --git a/config.h.cmake.in b/config.h.cmake.in index ef1384ae82..ab5c03715c 100644 --- a/config.h.cmake.in +++ b/config.h.cmake.in @@ -74,9 +74,6 @@ are set when opening a binary file on Windows. */ /* Define if building universal (internal helper macro) */ #cmakedefine AC_APPLE_UNIVERSAL_BUILD 1 -/* If true, will attempt to download and build netcdf-fortran. */ -#cmakedefine BUILD_FORTRAN 1 - /* default file chunk cache nelems. */ #cmakedefine CHUNK_CACHE_NELEMS ${CHUNK_CACHE_NELEMS} From 48d58821fda6f062e6354cf8a296843c469d68f5 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Thu, 8 Jun 2023 14:47:47 -0600 Subject: [PATCH 3/3] Corret filename --- unit_test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_test/Makefile.am b/unit_test/Makefile.am index 9948bab576..c159af91c9 100644 --- a/unit_test/Makefile.am +++ b/unit_test/Makefile.am @@ -45,7 +45,7 @@ TESTS += run_s3sdk.sh endif endif -EXTRA_DIST = CMakeLists.txt run_s3sdk.sh run_reclaim.sh +EXTRA_DIST = CMakeLists.txt run_s3sdk.sh run_reclaim_tests.sh EXTRA_DIST += nctest_netcdf4_classic.nc reclaim_tests.cdl CLEANFILES = reclaim_tests*.txt reclaim_tests.nc