configure 3.6 KB
Newer Older
1 2
#!/usr/bin/env bash

3
CPP_STD=c++14
4 5 6 7 8 9 10 11 12

usage ()
{
    echo ""
    echo "Usage : "
    echo "  configure [--boost=BOOST]                    # root of boost install"
    echo "            [--swig=SWIG]                      # location of swig executable"
    echo "            [--swig-lib=SWIG_LIB]              # location of swig library"
    echo "            [--debug]                          # build debug library (1)"
13
    echo "            [--c++98]                          # build using old C++98 standard"
14 15 16 17 18 19 20 21
    echo
    echo "    (Python only:)"
    echo "            [--python-include=PYTHON_INCLUDE]  # location of Python.h"
    echo "            [--numpy-include=NUMPY_INCLUDE]    # location of numpy/core/include"
    echo ""
    echo
    echo "  configure --pbi                              # use PacBio perforce locations"
    echo ""
22 23
    echo "  configure --modules                          # use PacBio GNU modules"
    echo ""
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    echo
    echo "  configure --clear                            # delete configuration"
    echo ""


}

configure_pbi ()
{
    echo "Configuring based on PacBio P4 depot paths."

    SOFTWARE=$(readlink -f ../../../../..) # Path to //depot/software
    BOOST=$SOFTWARE/smrtanalysis/prebuilt.out/boost/boost_1_47_0/
    SWIG=$SOFTWARE/smrtanalysis/prebuilt.out/swig/swig-2.0.10/ubuntu-1004/bin/swig
    SWIG_LIB=$SOFTWARE/smrtanalysis/prebuilt.out/swig/swig-2.0.10/common/share/swig/2.0.10
    PYTHON_INCLUDE=
    NUMPY_INCLUDE=
    DEBUG=
}


45 46 47 48 49 50 51 52 53
configure_modules ()
{
    echo "Configuring based on PacBio GNU modules"
    echo "(assumes you have already done module load boost, module load swig (selecting your desired versions))"
    BOOST=$BOOST_ROOT
    SWIG=`which swig`
}


54 55 56 57 58
while test x$1 != x; do
    case $1 in
        --pbi)
            configure_pbi
            ;;
59 60 61
        --modules)
            configure_modules
            ;;
62 63 64 65 66 67 68 69 70 71 72 73
        --boost=*)
            BOOST=`echo $1 | sed 's/--boost=//'`
            ;;
        --swig=*)
            SWIG=`echo $1 | sed 's/--swig=//'`
            ;;
        --swig-lib=*)
            SWIG_LIB=`echo $1 | sed 's/--swig-lib=//'`
            ;;
        --debug)
            DEBUG=1
            ;;
74 75
        --c++98)
            CPP_STD=c++98
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
            ;;
        --python-include=*)
            PYTHON_INCLUDE=`echo $1 | sed 's/--python-include=//'`
            ;;
        --numpy-include=*)
            NUMPY_INCLUDE=`echo $1 | sed 's/--numpy-include=//'`
            ;;
        --help)
            usage
            exit
            ;;
        --clear)
            rm -f make/Config.mk
            exit
            ;;
        *)
            echo Warning: unknown argument $1 >&2
            usage
            ;;
    esac
    shift
done

# Find/validate boost and swig
#set -e
BOOST=`tools/find_boost $BOOST` || exit
SWIG=`tools/find_swig $SWIG`  || exit

if [ -z $SWIG_LIB ]; then
105
    SWIG_LIB=`$SWIG -swiglib`
106 107 108 109 110 111 112 113 114 115 116 117
fi


echo
echo ConsensusCore configuration summary
echo -----------------------------------
echo "    BOOST          = $BOOST"
echo "    SWIG           = $SWIG"
echo "    SWIG_LIB       = $SWIG_LIB"
echo "    PYTHON_INCLUDE = $PYTHON_INCLUDE"
echo "    NUMPY_INCLUDE  = $NUMPY_INCLUDE"
echo "    DEBUG          = $DEBUG"
118
echo "    CPP_STD        = $CPP_STD"
119 120 121 122 123 124 125 126 127
echo

echo > make/Config.mk
echo "BOOST:=$BOOST"                   >> make/Config.mk
echo "SWIG:=$SWIG"                     >> make/Config.mk
echo "SWIG_LIB:=$SWIG_LIB"             >> make/Config.mk
echo "PYTHON_INCLUDE:=$PYTHON_INCLUDE" >> make/Config.mk
echo "NUMPY_INCLUDE:=$NUMPY_INCLUDE"   >> make/Config.mk
echo "DEBUG?=$DEBUG"                   >> make/Config.mk
128
echo "CPP_STD:=$CPP_STD"               >> make/Config.mk