Skip to content
Snippets Groups Projects
Commit 6b32a864 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Add default options to argument parser

parent a0a06219
Branches
Tags
No related merge requests found
...@@ -73,18 +73,25 @@ function print_help { ...@@ -73,18 +73,25 @@ function print_help {
echo "Use this script to detect the proper build configuration for your system. " echo "Use this script to detect the proper build configuration for your system. "
echo "Valid options are: " echo "Valid options are: "
echo " " echo " "
echo "--enable-fortran Enable FORTRAN compilation (DEFAULT). "
echo "--disable-fortran Disable FORTRAN compilation. " echo "--disable-fortran Disable FORTRAN compilation. "
echo "--enable-gdb Enable GNU debugger (DEFAULT). "
echo "--disable-gdb Disable GNU debugger. " echo "--disable-gdb Disable GNU debugger. "
echo "--enable-ilp64 Enable 64-bit integers (DEFAULT). "
echo "--disable-ilp64 Disable 64-bit integers. " echo "--disable-ilp64 Disable 64-bit integers. "
echo "--enable-offload Enable GPU offloading (DEFAULT). "
echo "--disable-offload Disable GPU offloading. " echo "--disable-offload Disable GPU offloading. "
echo "--enable-openmp Enable OpenMP multi-threading (DEFAULT). "
echo "--disable-openmp Disable OpenMP multi-threading. " echo "--disable-openmp Disable OpenMP multi-threading. "
echo "--enable-debug=FEATURE Enable debug output of specified feature. " 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-nvtx Enable NVTX profiling tools. "
echo "--enable-openmp Enable OpenMP multi-threading (DEFAULT). " echo "--disable-nvtx Disable NVTX profiling tools (DEFAULT). "
echo "--enable-optimize=OPT Use OPT-level compiler optimization. " echo "--enable-optimize=OPT Use OPT-level compiler optimization. "
echo "--enable-refinement Use iterative refinement of matrix inversion. " 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 "--enable-shared Use shared libraries (default is static). "
echo "--disable-shared Use static libraries (DEFAULT). "
echo "--help Print this help and exit. " echo "--help Print this help and exit. "
echo "--with-cublas Use cuBLAS (DEFAULT). " echo "--with-cublas Use cuBLAS (DEFAULT). "
echo "--without-cublas Disable cuBLAS. " echo "--without-cublas Disable cuBLAS. "
...@@ -95,11 +102,12 @@ function print_help { ...@@ -95,11 +102,12 @@ function print_help {
echo " than once). " echo " than once). "
echo "--with-lapack Use LAPACK (DEFAULT). " echo "--with-lapack Use LAPACK (DEFAULT). "
echo "--without-lapack Disable LAPACK. " echo "--without-lapack Disable LAPACK. "
echo "--with-ldflags=[PATH] Use additional linker LDFLAGS (can be given more" echo "--with-ldflags=[PATH] Use additional linker LDFLAGS (can be given "
echo " than once). " echo " more than once). "
echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). " echo "--with-magma=[MAGMA] Use specified MAGMA distribution (DEFAULT). "
echo "--without-magma Disable MAGMA. " echo "--without-magma Disable MAGMA. "
echo "--enable-magma-invert=OPTION Use specified MAGMA matrix inversion function (options = auto|getri|gesv|rbt, default getri). " echo "--enable-magma-invert=OPTION Use specified MAGMA matrix inversion function "
echo " (options = auto|getri|gesv|rbt, default getri)."
echo " " echo " "
echo "Some influential environment variables are: " echo "Some influential environment variables are: "
echo " " echo " "
...@@ -143,16 +151,27 @@ do ...@@ -143,16 +151,27 @@ do
if [ "x$cut_arg" = "x--help" ]; then if [ "x$cut_arg" = "x--help" ]; then
print_help | less print_help | less
exit 0 exit 0
elif [ "x$cut_arg" = "x--enable-gdb" ]; then
FC_DBG=" -ggdb"
CXX_DBG=" -ggdb"
elif [ "x$cut_arg" = "x--disable-gdb" ]; then elif [ "x$cut_arg" = "x--disable-gdb" ]; then
FC_DBG="" FC_DBG=""
CXX_DBG="" CXX_DBG=""
elif [ "x$cut_arg" = "x--enable-ilp64" ]; then
ENABLE_ILP64="yes"
elif [ "x$cut_arg" = "x--disable-ilp64" ]; then elif [ "x$cut_arg" = "x--disable-ilp64" ]; then
ENABLE_ILP64="no" ENABLE_ILP64="no"
elif [ "x$cut_arg" = "x--enable-fortran" ]; then
BUILDFORTRAN="yes"
elif [ "x$cut_arg" = "x--disable-fortran" ]; then elif [ "x$cut_arg" = "x--disable-fortran" ]; then
FC="none" FC="none"
BUILDFORTRAN="no" BUILDFORTRAN="no"
elif [ "x$cut_arg" = "x--enable-offload" ]; then
OFFLOAD="auto"
elif [ "x$cut_arg" = "x--disable-offload" ]; then elif [ "x$cut_arg" = "x--disable-offload" ]; then
OFFLOAD="no" OFFLOAD="no"
elif [ "x$cut_arg" = "x--enable-openmp" ]; then
OMPMODE="yes"
elif [ "x$cut_arg" = "x--disable-openmp" ]; then elif [ "x$cut_arg" = "x--disable-openmp" ]; then
OMPMODE="no" OMPMODE="no"
elif [ "x$cut_arg" = "x--enable-debug" ]; then elif [ "x$cut_arg" = "x--enable-debug" ]; then
...@@ -167,12 +186,10 @@ do ...@@ -167,12 +186,10 @@ do
DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_${dbg_feature}" DEBUGFLAGS="${DEBUGFLAGS} -DDEBUG_${dbg_feature}"
fi fi
fi fi
elif [ "x$cut_arg" = "x--enable-fortran" ]; then
BUILDFORTRAN="yes"
elif [ "x$cut_arg" = "x--enable-nvtx" ]; then elif [ "x$cut_arg" = "x--enable-nvtx" ]; then
NVTXFLAGS=" -DUSE_NVTX" NVTXFLAGS=" -DUSE_NVTX"
elif [ "x$cut_arg" = "x--enable-openmp" ]; then elif [ "x$cut_arg" = "x--disable-nvtx" ]; then
OMPMODE="yes" NVTXFLAGS=""
elif [ "x$cut_arg" = "x--enable-optimize" ]; then elif [ "x$cut_arg" = "x--enable-optimize" ]; then
opt_level=$(echo $arg | cut -d '=' -f2) opt_level=$(echo $arg | cut -d '=' -f2)
if [ $opt_level -lt 0 -o $opt_level -gt 3 ]; then if [ $opt_level -lt 0 -o $opt_level -gt 3 ]; then
...@@ -183,8 +200,12 @@ do ...@@ -183,8 +200,12 @@ do
CXX_OPT=$opt_level CXX_OPT=$opt_level
elif [ "x$cut_arg" = "x--enable-refinement" ]; then elif [ "x$cut_arg" = "x--enable-refinement" ]; then
REFINEFLAGS=" -DUSE_REFINEMENT" REFINEFLAGS=" -DUSE_REFINEMENT"
elif [ "x$cut_arg" = "x--disable-refinement" ]; then
REFINEFLAGS=""
elif [ "x$cut_arg" = "x--enable-shared" ]; then elif [ "x$cut_arg" = "x--enable-shared" ]; then
LIBMODE="shared" LIBMODE="shared"
elif [ "x$cut_arg" = "x--disable-shared" ]; then
LIBMODE="static"
elif [ "x$cut_arg" = "x--with-cublas" ]; then elif [ "x$cut_arg" = "x--with-cublas" ]; then
CUBLAS="yes" CUBLAS="yes"
elif [ "x$cut_arg" = "x--without-cublas" ]; then elif [ "x$cut_arg" = "x--without-cublas" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment