File: configure-from-image

package info (click to toggle)
cctools 9.9-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 44,624 kB
  • sloc: ansic: 192,539; python: 20,827; cpp: 20,199; sh: 11,719; perl: 4,106; xml: 3,688; makefile: 1,224
file content (85 lines) | stat: -rwxr-xr-x 2,153 bytes parent folder | download
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
#! /bin/bash

set -xe

# Save the dir from which the script was called
ORG_DIR=$(pwd)

# Find cctools src directory
CCTOOLS_SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd)"

# Ensure we end up in the directory we started regardless of how the script
# ends.
function finish {
    cd ${ORG_DIR}
}
trap finish EXIT


# dependencies to be included statically in parrot live in /opt/vc3 in the
# container images.
DEPS_DIR=/opt/vc3/cctools-deps
DEPS=$(/bin/ls "$DEPS_DIR" || true)
DEP_ARGS=""
for dep in $DEPS; do
    DEP_ARGS="$DEP_ARGS --with-$dep-path $DEPS_DIR/$dep"
done

cd ${CCTOOLS_SRC}

if [[ -d /opt/vc3/cctools-deps/musl ]]
then
    # compile work_queue binaries statically
    [[ -f config.mk ]] && make clean
    CFLAGS=-D__MUSL__ CC=/opt/vc3/cctools-deps/musl/bin/musl-gcc LD=/opt/vc3/cctools-deps/musl/bin/musl-gcc ./configure --without-system-{doc,apps,chirp} --with-readline-path=no --static  --with-zlib-path=/opt/vc3/cctools-deps/musl-zlib "$@"
    (cd dttools/src && make)
    (cd work_queue/src && make)
    (cp work_queue/src/work_queue_{worker,status,example} .)
    STATIC_WORKER=1
fi

# disable perl bindings (to compile as we do in conda)
perl_option='--with-perl-path no'


# using rpm/deb for cvmfs from cclnd docker containers
if [[ -n "${CCTOOLS_DOCKER_GITHUB}" ]]
then
    cvmfs_option='--with-cvmfs-path /usr'

    # ensure both python2 and python3 are built for centos7
    python_option='--with-python3-path /usr'
    if [[ "${CCTOOLS_DOCKER_GITHUB}" = centos7 ]]
    then
        python_option='--with-python2-path /usr --with-python3-path /usr'
    fi
fi


# compile everything
./configure --debug --strict $DEP_ARGS ${perl_option} ${python_option} ${cvmfs_option} "$@"
[[ -f config.mk ]] && make clean
echo === Contents of config.mk ===
cat config.mk

make

if [[ "${STATIC_WORKER}" = 1 ]]
then
    # set the static binaries for test and installation
    mv work_queue_{worker,status,example} work_queue/src
    touch work_queue/src/work_queue_{worker,status,example}
fi

make install

if ! make test
then
    echo === Contents of cctools.test.fail ===
    cat cctools.test.fail
    exit 1
else
    exit 0
fi