File: ornl_configure_self_contained

package info (click to toggle)
openmpi 5.0.8-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 201,684 kB
  • sloc: ansic: 613,078; makefile: 42,353; sh: 11,194; javascript: 9,244; f90: 7,052; java: 6,404; perl: 5,179; python: 1,859; lex: 740; fortran: 61; cpp: 20; tcl: 12
file content (125 lines) | stat: -rwxr-xr-x 5,004 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#!/bin/sh
#
# Self-contained configure script, that does not rely
# on cross-compilation, aka no need for a platforms-file.
#
# If the below env flags are not set, initialize to default (gcc, std dir on Jaguar)...
# This file works stand-alone, but is also integrated into the NCCS swtools environment
#

# Compilation should be done as VPATH
if [ -d .svn -o -f AUTHORS ] ; then
    echo WARNING: Should not compile in source directory
    echo Please create a directory and adapt SRCDIR in this script
    return
fi

FLAG=0
[[ -z ${XTOS_VERSION} ]] && echo "XTOS_VERSION is not set.  Please load the xt-os module" && FLAG=1
[[ -z ${PE_DIR} ]] && echo "PE_DIR is not set.  Please load the xt-pe module" && FLAG=1
[[ -z ${SE_DIR} ]] && echo "SE_DIR is not set.  Please load the xt-service module" && FLAG=1
[[ -z ${MPT_DIR} ]] && echo "MPT_DIR is not set.  Please load the xt-mpt module" && FLAG=1
[[ -z ${PE_ENV} ]] && echo "PE_ENV is not set.  Please load the PrgEnv module" && FLAG=1

if [ $FLAG -eq 1 ] ; then
    echo -n "One of the modules was not properly loaded (might want to CTRL-C)."
    sleep 1 ; echo -n "."
    sleep 1 ; echo -n "."
    sleep 1 ; echo -n "."
    sleep 1 ; echo "."
fi


###################################################################

# If the env flags are not set, initialize to default...
SRCDIR=${SRCDIR:-..}
COMPILER=${COMPILER:-gnu}
INSTALL_ROOT=${INSTALL_ROOT:-/sw/xt5/ompi}
VERSION=${VERSION:-"`${SRCDIR}/config/opal_get_version.sh ${SRCDIR}/VERSION`"}
SVER=${SVER:-"cnl`echo "${XTOS_VERSION}" | cut -c1-3`"}
CVER=${CVER:-"${COMPILER}`gcc --version  | awk '/gcc/{print $3}'`"}

# The following is all derived
PREFIX=${PREFIX:-${INSTALL_ROOT}/${VERSION}/${SVER}_${CVER}}
###################################################################

case "$COMPILER" in
    "cray" )
        COMPILER_FLAGS="CC=craycc CXX=crayc++ F77=crayftn FC=crayftn"
        CFLAGS="-O2 -h cpu=istanbul -h negmsgs ${CFLAGS}"
        CXXFLAGS="-O2 -h cpu=istanbul -h negmsgs ${CXXFLAGS}"
        LDFLAGS="${LDFLAGS}"
        # Static compilation is the default, there is not even a flag...
        WRAPPER_LDFLAGS=""
        ;;
    "gnu" )
        # No need to specify compiler
        CFLAGS="-O2 -fomit-frame-pointer ${CFLAGS}"
        CXXFLAGS="-O2 -fomit-frame-pointer ${CXXFLAGS}"
        LDFLAGS="${LDFLAGS}"
        # REQUIRED
        WRAPPER_LDFLAGS="-static"
        ;;
    "intel" )
        COMPILER_FLAGS="CC=icc CXX=icpc F77=ifort FC=ifort"
        CFLAGS="-O2 ${CFLAGS}"
        CXXFLAGS="-O2 ${CXXFLAGS}"
        FFLAGS="-O2 ${FFLAGS}"
        FCFLAGS="-O2 ${FCFLAGS}"
        LDFLAGS="${LDFLAGS}"
        # REQUIRED
        WRAPPER_LDFLAGS="-static"
        ;;
    "pathscale" )
        COMPILER_FLAGS="CC=pathcc CXX=pathCC F77=pathf90 FC=pathf90"
        CFLAGS="-O2 -TARG:processor=barcelona -TARG:sse2=on -TARG:sse3=on ${CFLAGS}"
        CXXFLAGS="-O2 -TARG:processor=barcelona -TARG:sse2=on -TARG:sse3=on ${CXXFLAGS}"
        # REQUIRED
        LDFLAGS="${LDFLAGS}"
        WRAPPER_LDFLAGS="-static"
        ;;
    "pgi" )
        COMPILER_FLAGS="CC=pgcc CXX=pgCC F77=pgf77 FC=pgf90"
        CFLAGS="-O2 -tp istanbul-64 ${CFLAGS}"
        CXXFLAGS="-O2 -tp istanbul-64 ${CXXFLAGS}"
        # REQUIRED
        FFLAGS="-Mnomain $PGI/linux86-64/default/lib/pgfmain.o ${FFLAGS}"
        FCFLAGS="-Mnomain $PGI/linux86-64/default/lib/pgfmain.o ${FCFLAGS}"
        LDFLAGS="-L$PGI/linux86-64/default/lib ${LDFLAGS}"
        WRAPPER_LDFLAGS="-Bstatic"
        ;;
    * )
        echo "Error: Unknown Compiler: $COMPILER"
        return
        ;;
esac


# If further packages should be disabled, insert
#   --disable-mpi-cxx --disable-io-romio \

$SRCDIR/configure \
   --prefix=$PREFIX \
   --enable-static --disable-shared --disable-dlopen --disable-pretty-print-stacktrace --disable-pty-support \
   --with-threads --with-memory-manager=none \
   --without-tm --with-alps --with-portals --with-portals-config=xt3-modex \
   --enable-mca-no-build=maffinity-first_use,maffinity-libnuma,ess-cnos,ess-slurm,ess-slurmd,filem-rsh,grpcomm-cnos,plm-rsh,plm-rshd,plm-slurm,pml-dr,btl-tcp,notifier-twitter,notifier-smtp,pml-csum,pml-v,vprotocol-pessimist,dpm-orte \
   --with-wrapper-ldflags="-L${PE_DIR}/lib/snos64 -L${SE_DIR}/lib/snos64 -L/opt/xt-mpt/default/lib/snos64/ ${WRAPPER_LDFLAGS}" \
   --with-wrapper-libs="-lpct -lalpslli -lalpsutil -lportals -lpthread -lm" \
   ${COMPILER_FLAGS} \
   CPPFLAGS="-DNDEBUG -I${PE_DIR}/include ${CPPFLAGS}" \
   CFLAGS="${CFLAGS}" \
   CXXFLAGS="${CXXFLAGS}" \
   FFLAGS="-I${PE_DIR}/include ${FFLAGS}" \
   FCFLAGS="-I${PE_DIR}/include ${FCFLAGS}" \
   LDFLAGS="-L${PE_DIR}/lib/snos64 -L${SE_DIR}/lib/snos64 -L/opt/xt-mpt/default/lib/snos64/ ${LDFLAGS}" \
   LIBS="${LIBS} -lpct -lalpslli -lalpsutil -lportals -lpthread -lrt -lm" $* | tee build.log

#
# To build orted static, use the libtool-flag -all-static
#
make -s -j4 orted_LDFLAGS=-all-static all | tee -a build.log

make -s orted_LDFLAGS=-all-static install | tee -a install.log