#!/bin/sh

LIBS="-L/home/sameer/apps/pastix/mpc_gcc/src/pastix_release_4694/src/../install -lpastix  -L/storage/users/sameer/apps/pastix/mpc_gcc/install/scotch/lib -Wl,-rpath,/storage/users/sameer/apps/pastix/mpc_gcc/install/scotch/lib -lptscotch -lscotch -lptscotcherrexit -L/storage/users/sameer/apps/pastix/mpc_gcc/install/hwloc-1.9/lib -Wl,-rpath,/storage/users/sameer/apps/pastix/mpc_gcc/install/hwloc-1.9/lib -lhwloc   -lgfortran -lpthread";
INC="-I/home/sameer/apps/pastix/mpc_gcc/src/pastix_release_4694/src/../install";
CC="mpc_cc -Wall";
CXX="mpc_cxx -Wall"
CCOPT="-O3 -DFORCE_LONG -DLONG -DFORCE_INT64  -DCUDA_SM_VERSION=20 -I/storage/users/sameer/apps/pastix/mpc_gcc/install/scotch/include -DDISTRIBUTED -DWITH_SCOTCH -I/storage/users/sameer/apps/pastix/mpc_gcc/install/hwloc-1.9/include -DWITH_HWLOC  -DVERSION='' -DX_ARCHi686_pc_linux -DDOF_CONSTANT";
CXXOPT="-O3";
CL="mpc_cc -Wall";
FC="mpc_f77 -cpp";
FCOPT="";
FL="mpc_f77 ";
OPTS="-DFORCE_LONG -DLONG -DFORCE_INT64  -DPREC_DOUBLE  -DCUDA_SM_VERSION=20 -I/storage/users/sameer/apps/pastix/mpc_gcc/install/scotch/include -DDISTRIBUTED -DWITH_SCOTCH -I/storage/users/sameer/apps/pastix/mpc_gcc/install/hwloc-1.9/include -DWITH_HWLOC -DMURGE_THREADSAFE";
BLAS="-L/storage/users/sameer/apps/pastix/mpc_gcc/install/blas/lib -lblas";
VERSION="exported";
LIBS_MURGE=`echo $LIBS | sed -e 's/-lpastix/-lpastix_murge -lpastix/g'`

usage="usage : $0 [options] - Shows PaStiX libs, includes and compiler\n";
usage="$usage    options : \n";
usage="$usage        --libs               - prints librairies\n";
usage="$usage        --libs_murge         - prints librairies\n";
usage="$usage        --incs               - prints includes\n";
usage="$usage        --cc                 - prints C compiler\n";
usage="$usage        --ccopts             - prints C compiler options\n";
usage="$usage        --cxx                - prints C++ compiler\n";
usage="$usage        --cxxcopts           - prints C++ compiler options\n";
usage="$usage        --cl                 - prints C linker\n";
usage="$usage        --fc                 - prints fortran compiler\n";
usage="$usage        --fcopts             - prints fortran compiler options\n";
usage="$usage        --fl                 - prints fortran linker\n";
usage="$usage        --opts               - prints PaStiX compiling options\n";
usage="$usage        --vers               - prints PaStiX version\n";
usage="$usage        --blas               - prints blas choosen in config.in\n";

if [ $# = 0 ]
then
    echo "Librairies               : $LIBS" ;
    echo "Librairies with murge    : $LIBS_MURGE";
    echo "Incs                     : $INC" ;
    echo "C Compiler               : $CC" ;
    echo "C Compiler options       : $CCOPT" ;
    echo "C++ Compiler             : $CXX" ;
    echo "C++ Compiler options     : $CXXOPT" ;
    echo "Fortran Compiler         : $FC" ;
    echo "Fortran Compiler options : $FCOPT" ;
    echo "C Linker                 : $CL" ;
    echo "Fortran Linker           : $FL" ;
    echo "Options                  : $OPTS" ;
    echo "Version                  : $VERSION" ;
    echo "Blas                     : $BLAS" ;
elif [ $# = 1 ]
then
    case $1 in
        --libs)
            echo $LIBS;;
        --libs_murge)
            echo $LIBS_MURGE;;
        --incs)
            echo $INC;;
        --cc)
            echo $CC;;
        --ccopts)
            echo $CCOPT;;
        --cxx)
            echo $CXX;;
        --cxxopts)
            echo $CXXOPT;;
        --fc)
            echo $FC;;
        --fcopts)
            echo $FCOPT;;
        --cl)
            echo $CL;;
        --fl)
            echo $FL;;
        --opts)
            echo $OPTS;;
        --blas)
            echo $BLAS;;
        --vers)
            echo $VERSION;;

        *)
            echo -e $usage
    esac;
else
    echo -e $usage
fi;
