diff --git a/build/configure.sh b/build/configure.sh index 4bb5932c8d9522407f3c7619c48ccbe43b7d4f9f..191dd7c2f91d75422b578361f9923c162fec5e67 100755 --- a/build/configure.sh +++ b/build/configure.sh @@ -68,51 +68,59 @@ function guess_fc { } function print_help { - echo "NPTMcode configuration script. " - echo " " - echo "Use this script to detect the proper build configuration for your system. " - echo "Valid options are: " - echo " " - echo "--disable-fortran Disable FORTRAN compilation. " - echo "--disable-gdb Disable GNU debugger. " - echo "--disable-ilp64 Disable 64-bit integers. " - echo "--disable-offload Disable GPU offloading. " - echo "--disable-openmp Disable OpenMP multi-threading. " - echo "--enable-debug=FEATURE Enable debug output of specified feature. " - echo "--enable-fortran Enable FORTRAN compilation (DEFAULT). " - echo "--enable-nvtx Enable NVTX profiling tools. " - echo "--enable-openmp Enable OpenMP multi-threading (DEFAULT). " - echo "--enable-optimize=OPT Use OPT-level compiler optimization. " - echo "--enable-refinement Use iterative refinement of matrix inversion. " - echo "--enable-shared Use shared libraries (default is static). " - echo "--help Print this help and exit. " - echo "--with-cublas Use cuBLAS (DEFAULT). " - echo "--without-cublas Disable cuBLAS. " - echo "--with-fflags=FFLAGS Use specified FORTRAN compiler flags instead of " - echo " detected ones. " - echo "--with-hdf5=HDF5_PATH Use specified HDF5 distribution. " - echo "--with-include=[PATH] Use additional include paths (can be given more " - echo " than once). " - echo "--with-lapack Use LAPACK (DEFAULT). " - echo "--without-lapack Disable LAPACK. " - echo "--with-ldflags=[PATH] Use additional linker LDFLAGS (can be given more" - echo " than once). " - echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). " - echo "--without-magma Disable MAGMA. " - echo "--enable-magma-invert=OPTION Use specified MAGMA matrix inversion function (options = auto|getri|gesv|rbt, default getri). " - echo " " - echo "Some influential environment variables are: " - echo " " - echo "AR Static library archive packager. " - echo "CUDAFLAGS CUDA compilation flags. " - echo "CUDALDFLAGS CUDA libraries linking flags. " - echo "CXX C++ compiler. " - echo "CXXFLAGS C++ compilation flags. " - echo "CXXLDFLAGS C++ linker flags. " - echo "FC FORTRAN compiler. " - echo "HDF5_INCLUDE Path to the HDF5 header files. " - echo "HDF5_LIB Path to the HDF5 library files. " - echo "MAGMA_HOME Root folder of MAGMA distribution. " + echo "NPTMcode configuration script. " + echo " " + echo "Use this script to detect the proper build configuration for your system. " + echo "Valid options are: " + echo " " + echo "--enable-fortran Enable FORTRAN compilation (DEFAULT). " + echo "--disable-fortran Disable FORTRAN compilation. " + echo "--enable-gdb Enable GNU debugger (DEFAULT). " + echo "--disable-gdb Disable GNU debugger. " + echo "--enable-ilp64 Enable 64-bit integers (DEFAULT). " + echo "--disable-ilp64 Disable 64-bit integers. " + echo "--enable-offload Enable GPU offloading (DEFAULT). " + echo "--disable-offload Disable GPU offloading. " + echo "--enable-openmp Enable OpenMP multi-threading (DEFAULT). " + echo "--disable-openmp Disable OpenMP multi-threading. " + echo "--enable-debug=FEATURE Enable debug output of specified feature. " + echo "--enable-nvtx Enable NVTX profiling tools. " + echo "--disable-nvtx Disable NVTX profiling tools (DEFAULT). " + echo "--enable-optimize=OPT Use OPT-level compiler optimization. " + echo "--enable-refinement Use iterative refinement of matrix inversion. " + echo "--disable-refinement Do not iterate refinement of matrix inversion " + echo " (DEFAULT). " + echo "--enable-shared Use shared libraries (default is static). " + echo "--disable-shared Use static libraries (DEFAULT). " + echo "--help Print this help and exit. " + echo "--with-cublas Use cuBLAS (DEFAULT). " + echo "--without-cublas Disable cuBLAS. " + echo "--with-fflags=FFLAGS Use specified FORTRAN compiler flags instead of" + echo " detected ones. " + echo "--with-hdf5=HDF5_PATH Use specified HDF5 distribution. " + echo "--with-include=[PATH] Use additional include paths (can be given more" + echo " than once). " + echo "--with-lapack Use LAPACK (DEFAULT). " + echo "--without-lapack Disable LAPACK. " + echo "--with-ldflags=[PATH] Use additional linker LDFLAGS (can be given " + echo " more than once). " + echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). " + echo "--without-magma Disable MAGMA. " + echo "--enable-magma-invert=OPTION Use specified MAGMA matrix inversion function " + echo " (options = auto|getri|gesv|rbt, default getri)." + echo " " + echo "Some influential environment variables are: " + echo " " + echo "AR Static library archive packager. " + echo "CUDAFLAGS CUDA compilation flags. " + echo "CUDALDFLAGS CUDA libraries linking flags. " + echo "CXX C++ compiler. " + echo "CXXFLAGS C++ compilation flags. " + echo "CXXLDFLAGS C++ linker flags. " + echo "FC FORTRAN compiler. " + echo "HDF5_INCLUDE Path to the HDF5 header files. " + echo "HDF5_LIB Path to the HDF5 library files. " + echo "MAGMA_HOME Root folder of MAGMA distribution. " } function test_legacy_fortran { @@ -143,16 +151,27 @@ do if [ "x$cut_arg" = "x--help" ]; then print_help | less exit 0 + elif [ "x$cut_arg" = "x--enable-gdb" ]; then + FC_DBG=" -ggdb" + CXX_DBG=" -ggdb" elif [ "x$cut_arg" = "x--disable-gdb" ]; then FC_DBG="" CXX_DBG="" + elif [ "x$cut_arg" = "x--enable-ilp64" ]; then + ENABLE_ILP64="yes" elif [ "x$cut_arg" = "x--disable-ilp64" ]; then ENABLE_ILP64="no" + elif [ "x$cut_arg" = "x--enable-fortran" ]; then + BUILDFORTRAN="yes" elif [ "x$cut_arg" = "x--disable-fortran" ]; then FC="none" BUILDFORTRAN="no" + elif [ "x$cut_arg" = "x--enable-offload" ]; then + OFFLOAD="auto" elif [ "x$cut_arg" = "x--disable-offload" ]; then OFFLOAD="no" + elif [ "x$cut_arg" = "x--enable-openmp" ]; then + OMPMODE="yes" elif [ "x$cut_arg" = "x--disable-openmp" ]; then OMPMODE="no" elif [ "x$cut_arg" = "x--enable-debug" ]; then @@ -167,12 +186,10 @@ do DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_${dbg_feature}" fi fi - elif [ "x$cut_arg" = "x--enable-fortran" ]; then - BUILDFORTRAN="yes" elif [ "x$cut_arg" = "x--enable-nvtx" ]; then NVTXFLAGS=" -DUSE_NVTX" - elif [ "x$cut_arg" = "x--enable-openmp" ]; then - OMPMODE="yes" + elif [ "x$cut_arg" = "x--disable-nvtx" ]; then + NVTXFLAGS="" elif [ "x$cut_arg" = "x--enable-optimize" ]; then opt_level=$(echo $arg | cut -d '=' -f2) if [ $opt_level -lt 0 -o $opt_level -gt 3 ]; then @@ -183,8 +200,12 @@ do CXX_OPT=$opt_level elif [ "x$cut_arg" = "x--enable-refinement" ]; then REFINEFLAGS=" -DUSE_REFINEMENT" + elif [ "x$cut_arg" = "x--disable-refinement" ]; then + REFINEFLAGS="" elif [ "x$cut_arg" = "x--enable-shared" ]; then LIBMODE="shared" + elif [ "x$cut_arg" = "x--disable-shared" ]; then + LIBMODE="static" elif [ "x$cut_arg" = "x--with-cublas" ]; then CUBLAS="yes" elif [ "x$cut_arg" = "x--without-cublas" ]; then diff --git a/src/scripts/pycompare.py b/src/scripts/pycompare.py index 01ea0144260265d0e3f6ac79d430b2dd00520229..b4b0a0c39702116396203f7d401778ce134e28d1 100755 --- a/src/scripts/pycompare.py +++ b/src/scripts/pycompare.py @@ -51,7 +51,13 @@ number_reg = re.compile(r'-?[0-9]\.[0-9]+E?[-+][0-9]{2,5}') # # \returns errors: `int` Number of detected error-level inconsistencies. def main(): - config = parse_arguments() + config = {} + try: + config = parse_arguments() + except ValueError as ex: + print(ex) + print("\nType \"pycompare.py --help\" to get more detailed help.") + exit(1) errors, warnings, noisy = (0, 0, 0) if config['help_mode'] or len(argv) == 1: config['help_mode'] = True @@ -527,7 +533,7 @@ def parse_arguments(): elif (arg.startswith("--warn")): config['warning_threshold'] = float(split_arg[1]) else: - raise Exception("Unrecognized argument \'{0:s}\'".format(arg)) + raise ValueError("Unrecognized argument \'{0:s}\'".format(arg)) arg_index += 1 return config