diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e85e8505..99d9ea0f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ INCLUDE(GenerateExportHeader) ################################ -# Default to shared libs on. +# Default building shared libraries. OPTION(BUILD_SHARED_LIBS "Configure netCDF as a shared library." ON) SET (LIB_TYPE STATIC) IF (BUILD_SHARED_LIBS) @@ -114,20 +114,50 @@ IF (BUILD_SHARED_LIBS) ENDIF() ENDIF() -# Supress unused variable and parameter warnings, for the time being, -# on GCC. -# -# Also, set some other default compiler flags. +# Set some default linux gcc & apple compiler options for +# debug builds. IF(CMAKE_COMPILER_IS_GNUCC OR APPLE) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -Wno-unused-variable -Wno-unused-parameter") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wno-unused-variable -Wno-unused-parameter") -ENDIF() -IF(NOT ENABLE_COVERAGE_TESTS) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") - SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2") -ENDIF() + OPTION (ENABLE_COVERAGE_TESTS "Enable compiler flags needed to perform coverage tests." OFF) + OPTION (ENABLE_CONVERSION_WARNINGS "Enable warnings for implicit conversion from 64 to 32-bit datatypes." ON) + OPTION (ENABLE_USED_VAR_PAR_WARNINGS "Enable warnings for unused parameters and variables. Creates very noisy output." OFF) + OPTION (ENABLE_LARGE_FILE_TESTS "Enable large file tests." OFF) + + # Debugging flags + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall") + # Coverage tests need to have optimization turned off. + IF(NOT ENABLE_COVERAGE_TESTS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2") + SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2") + ELSE() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -profile-arcs -ftest-coverage") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") + MESSAGE(STATUS "Coverage Tests: On.") + ENDIF() + + # Unused var and parameter warnings create a lot of noise. + IF(NOT ENABLE_UNUSED_VAR_PAR_WARNINGS) + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable -Wno-unused-parameter") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-variable -Wno-unused-parameter") + ENDIF() + + # Warnings for 64-to-32 bit conversions. + IF(ENABLE_CONVERSION_WARNINGS) + IF(APPLE) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32") + ELSE() + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion") + ENDIF(APPLE) + ENDIF(ENABLE_CONVERSION_WARNINGS) + +ENDIF(CMAKE_COMPILER_IS_GNUCC OR APPLE) + +# End default linux gcc & apple compiler options. ADD_DEFINITIONS() @@ -264,6 +294,9 @@ MACRO(print_conf_summary) ENDIF() MESSAGE(STATUS "\tUsing pnetcdf:\t\t\t" ${STATUS_PNETCDF}) MESSAGE(STATUS "\tUsing Parallel IO:\t\t" ${STATUS_PARALLEL}) + MESSAGE(STATUS "\tCMAKE_C_FLAGS:\t\t" ${CMAKE_C_FLAGS}) + MESSAGE(STATUS "\tCMAKE_CXX_FLAGS:\t\t" ${CMAKE_CXX_FLAGS}) + MESSAGE(STATUS "\tLinking against:\t\t" "${ALL_TLL_LIBS}") MESSAGE("") @@ -421,18 +454,6 @@ IF(ENABLE_DISKLESS) SET(USE_DISKLESS ON) ENDIF() -OPTION(ENABLE_CONVERSION_WARNINGS "Enable warnings for implicit conversion from 64 to 32-bit datatypes." ON) -IF(ENABLE_CONVERSION_WARNINGS) - IF(NOT MSVC) - IF(APPLE) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32") - ELSE() - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wconversion") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion") - ENDIF(APPLE) - ENDIF(NOT MSVC) -ENDIF(ENABLE_CONVERSION_WARNINGS) # Option Logging, only valid for netcdf4. OPTION (ENABLE_LOGGING "Enable Logging." OFF) IF(ENABLE_LOGGING) @@ -651,7 +672,6 @@ IF(ENABLE_TESTS) ENDIF() # Enable Large file tests -OPTION (ENABLE_LARGE_FILE_TESTS "Enable large file tests." OFF) IF(ENABLE_LARGE_FILE_TESTS) SET(LARGE_FILE_TESTS ON) ENDIF() @@ -680,18 +700,6 @@ IF(ENABLE_LARGE_FILE_SUPPORT) ENDIF() -# Provide the option to perform coverage tests. -IF(CMAKE_COMPILER_IS_GNUCC OR APPLE) - OPTION (ENABLE_COVERAGE_TESTS "Enable compiler flags needed to perform coverage tests." OFF) - IF(ENABLE_COVERAGE_TESTS) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -profile-arcs -ftest-coverage") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -ftest-coverage") - MESSAGE(STATUS "Coverage Tests: On.") - ENDIF() -ENDIF() - - OPTION (ENABLE_EXAMPLE_TESTS "Run extra example tests. Requires GNU Sed. Ignored if netCDF-4 is not Enabled" OFF) IF(NOT ENABLE_NETCDF_4 AND ENABLE_EXAMPLE_TESTS) SET (ENABLE_EXAMPLE_TESTS OFF) diff --git a/libsrc5/nc5dispatch.c b/libsrc5/nc5dispatch.c index 62f424b45..05a40a0eb 100644 --- a/libsrc5/nc5dispatch.c +++ b/libsrc5/nc5dispatch.c @@ -55,9 +55,9 @@ NC5_create(const char *path, int cmode, if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX)) return NC_EINVAL; + /* Appears that this comment is wrong; allow 64 bit offset*/ /* Cannot have 64 bit offset flag */ - if(cmode & (NC_64BIT_OFFSET)) - return NC_EINVAL; + /*if(cmode & (NC_64BIT_OFFSET)) return NC_EINVAL;*/ comm = ((NC_MPI_INFO *)mpidata)->comm; info = ((NC_MPI_INFO *)mpidata)->info; @@ -109,9 +109,9 @@ NC5_open(const char *path, int cmode, if((cmode & (NC_MPIIO|NC_MPIPOSIX)) == (NC_MPIIO|NC_MPIPOSIX)) return NC_EINVAL; + /* Appears that this comment is wrong; allow 64 bit offset*/ /* Cannot have 64 bit offset flag */ - if(cmode & (NC_64BIT_OFFSET)) - return NC_EINVAL; + /* if(cmode & (NC_64BIT_OFFSET)) return NC_EINVAL; */ if(mpidata != NULL) { comm = ((NC_MPI_INFO *)mpidata)->comm; diff --git a/ncdap_test/tst_remote.sh b/ncdap_test/tst_remote.sh index 956875724..257e3a883 100755 --- a/ncdap_test/tst_remote.sh +++ b/ncdap_test/tst_remote.sh @@ -16,6 +16,12 @@ DTS="$SVC/dts" PARAMS="[log]" #PARAMS="${PARAMS}[show=fetch]" + +# Determine If we're on OSX or Linux + +myplatform=`uname -a | cut -d" " -f 1` + + #OCLOGFILE=/dev/null OCLOGFILE="" ; export OCLOGFILE @@ -252,16 +258,34 @@ echo '#DODSRC' >./.dodsrc for t in ${TESTSET} ; do # see if we are using constraints - index=`expr index "${t}" ";"` - if test "x$index" = "x0" ; then - constrained=0 + #index=`expr index "${t}" ";"` + + #echo index: $index + + if [ "$myplatform" = "Darwin" ]; then + index=`echo "${t}" | sed -n "s/;.*//p" | wc -c` + if (( $index == 0 )) ; then + constrained=0 + else + constrained=1 + fi + else - constrained=1 + index=`expr index "${t}" ";"` + + if test "x$index" = "x0" ; then + constrained=0 + else + constrained=1 + fi + fi + if test "x$constrained" = "x0" ; then # No constraint testname=$t ce= else # Constrained + testname=`echo $t | cut -d ';' -f1` testno=`echo $t | cut -d ';' -f2` ce=`echo $t | cut -d ';' -f3-`