11#! /bin/bash
22
3+ # Exit on error, unset variable, or pipe failure
34set -euo pipefail
45
56# This will be empty for nightly test, and we will clone master branch
67FLUX_RELEASE_VERSION=${FLUX_RELEASE_VERSION:- 0.68.0}
78FLUX_VERSION=${FLUX_VERSION:- 0.68.0}
89
9- export DEBIAN_FRONTEND=noninteractive
10- export TZ=UTC
11- sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
12- echo $TZ > /tmp/timezone
13- sudo mv /tmp/timezone /etc/timezone
10+ if [[ " $( uname) " == " Darwin" ]]; then
11+ brew install \
12+ autoconf \
13+ automake \
14+ libtool \
15+ make \
16+ pkg-config \
17+ epoll-shim \
18+ libev \
19+ zeromq \
20+ jansson \
21+ lz4 \
22+ libarchive \
23+ hwloc \
24+ sqlite \
25+ lua \
26+ luarocks \
27+ python3 \
28+ cffi \
29+ libyaml \
30+ jq
1431
15- # Prepare the version file
32+ # Possibility - install munge with MacPorts
33+ # sudo port install munge
34+ eval " $( /opt/homebrew/bin/brew shellenv) "
35+
36+ # Set the dynamic library path variable for macOS
37+ export DYLD_LIBRARY_PATH=/usr/local/lib
38+ PIP_INSTALL=" python -m pip install"
39+ ln -s $( which glibtoolize) /usr/local/bin/libtoolize
40+
41+ CPPFLAGS=" -I${HOMEBREW_PREFIX} /include/lua"
42+ CPPFLAGS=" -I$( brew --prefix libev) /include ${CPPFLAGS} "
43+ CPPFLAGS=" -I$( brew --prefix epoll-shim) /include/libepoll-shim ${CPPFLAGS} "
44+ LDFLAGS=-L${HOMEBREW_PREFIX} /lib
45+ PKG_CONFIG_PATH=$( pkg-config --variable pc_path pkg-config)
46+ PKG_CONFIG_PATH=$( brew --prefix libarchive) /lib/pkgconfig:${PKG_CONFIG_PATH}
47+ PATH=$( brew --prefix libtool) /libexec/gnubin:$PATH
48+
49+ # Linux block!
50+ else
51+ export DEBIAN_FRONTEND=noninteractive
52+ export TZ=UTC
53+ sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ | sudo tee /etc/timezone
54+
55+ sudo apt-get update
56+ sudo apt-get install -y \
57+ libjson-glib-dev \
58+ wget \
59+ curl \
60+ automake \
61+ libsodium-dev \
62+ libzmq3-dev \
63+ libczmq-dev \
64+ libjansson-dev \
65+ libmunge-dev \
66+ libncursesw5-dev \
67+ lua5.3 \
68+ liblua5.3-dev \
69+ liblz4-dev \
70+ libsqlite3-dev \
71+ uuid-dev \
72+ libhwloc-dev \
73+ libmpich-dev \
74+ libs3-dev \
75+ libevent-dev \
76+ libarchive-dev \
77+ python3-sphinx \
78+ python3-cffi \
79+ libtool \
80+ git \
81+ build-essential \
82+ libpam-dev
83+
84+ sudo rm -rf /var/lib/apt/lists/*
85+ sudo ldconfig
86+
87+ # Set the dynamic library path variable for Linux. The conda path is for the container.
88+ export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/conda/envs/build/lib
89+ PIP_INSTALL=" /opt/conda/envs/build/bin/python3 -m pip install"
90+ fi
91+
92+ # Here we can start common setup (we hope)
1693echo " Flux Version for pypi is ${FLUX_VERSION} "
17- sed -i " s/package_version = \" develop\" /package_version = \" $FLUX_VERSION \" /" setup.py
94+ if [[ " $( uname) " == " Darwin" ]]; then
95+ sed -i ' ' " s/package_version = \" develop\" /package_version = \" $FLUX_VERSION \" /" setup.py
96+ else
97+ sed -i " s/package_version = \" develop\" /package_version = \" $FLUX_VERSION \" /" setup.py
98+ fi
1899
100+ # Store current directory
19101here=$( pwd)
20- sudo apt-get update
21- sudo apt-get install -y \
22- libjson-glib-dev \
23- wget \
24- curl \
25- automake \
26- libsodium-dev \
27- libzmq3-dev \
28- libczmq-dev \
29- libjansson-dev \
30- libmunge-dev \
31- libncursesw5-dev \
32- lua5.3 \
33- liblua5.3-dev \
34- liblz4-dev \
35- libsqlite3-dev \
36- uuid-dev \
37- libhwloc-dev \
38- libmpich-dev \
39- libs3-dev \
40- libevent-dev \
41- libarchive-dev \
42- python3 \
43- python3-dev \
44- python3-pip \
45- python3-sphinx \
46- libtool \
47- git \
48- build-essential \
49- libpam-dev
50-
51- sudo ldconfig
52- sudo rm -rf /var/lib/apt/lists/*
53-
54- # noble and later requires --break-system-packages
55- PIP_INSTALL=" sudo /opt/conda/envs/build/bin/python3 -m pip install"
56- ${PIP_INSTALL} IPython || ${PIP_INSTALL} IPython --break-system-packages
57- ${PIP_INSTALL} -r .github/scripts/requirements-dev.txt || ${PIP_INSTALL} -r .github/scripts/requirements-dev.txt --break-system-packages
58- export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/opt/conda/envs/build/lib
59102
103+ # Install Python requirements using the OS-specific pip command - allow for ubuntu to be 24.04 or not.
104+ # I like how "--break-system-packages" is analogous with --i-acknowledge-i-am-a-terrible-person
105+ if [[ " $( uname) " == " Darwin" ]]; then
106+ ${PIP_INSTALL} IPython
107+ ${PIP_INSTALL} -r .github/scripts/requirements-dev.txt
108+
109+ # Build flux core first for the libmissing
110+ cd " ${here} "
111+ echo " Flux Release Version is ${FLUX_RELEASE_VERSION} "
112+ wget https://github.com/flux-framework/flux-core/releases/download/v${FLUX_RELEASE_VERSION} /flux-core-${FLUX_RELEASE_VERSION} .tar.gz
113+ tar -xzvf flux-core-${FLUX_RELEASE_VERSION} .tar.gz
114+ sudo mv flux-core-${FLUX_RELEASE_VERSION} /code
115+ sudo chown -R $( id -u) /code
116+ cd /code
117+ chmod +x etc/gen-cmdhelp.py
118+ ./autogen.sh || echo " No autogen here"
119+ CPPFLAGS=" $CPPFLAGS " LDFLAGS=$LDFLAGS PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
120+ ./configure --with-external-libev --prefix=/usr/local
121+ else
122+ ${PIP_INSTALL} IPython || ${PIP_INSTALL} IPython --break-system-packages
123+ ${PIP_INSTALL} -r .github/scripts/requirements-dev.txt || ${PIP_INSTALL} -r .github/scripts/requirements-dev.txt --break-system-packages
124+ fi
125+
126+
127+
128+ # Flux Security --
60129git clone https://github.com/flux-framework/flux-security ~ /security
61130cd ~ /security
62131./autogen.sh
63- PYTHON=/opt/conda/envs/build/bin/python3 ./configure --prefix=/usr/local
64- make
132+
133+ if [[ " $( uname) " == " Darwin" ]]; then
134+ CPPFLAGS=" $CPPFLAGS " LDFLAGS=$LDFLAGS PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
135+ ./configure --with-external-libev --prefix=/usr/local
136+ else
137+ ./configure --prefix=/usr/local
138+ fi
139+ make
65140sudo make install
66- sudo ldconfig
141+ if [[ " $( uname) " != " Darwin" ]]; then
142+ sudo ldconfig
143+ fi
67144
68- # This is a build from a release
145+ # Flux Core --
146+ cd " ${here} "
69147echo " Flux Release Version is ${FLUX_RELEASE_VERSION} "
70- echo " Flux version requested to build is ${FLUX_RELEASE_VERSION} "
71148wget https://github.com/flux-framework/flux-core/releases/download/v${FLUX_RELEASE_VERSION} /flux-core-${FLUX_RELEASE_VERSION} .tar.gz
72149tar -xzvf flux-core-${FLUX_RELEASE_VERSION} .tar.gz
73150sudo mv flux-core-${FLUX_RELEASE_VERSION} /code
@@ -76,15 +153,20 @@ sudo chown -R $(id -u) /code
76153cd /code
77154chmod +x etc/gen-cmdhelp.py
78155
79- # This is only needed for non-releases
80156./autogen.sh || echo " No autogen here"
81- PYTHON=/opt/conda/envs/build/bin/python3 ./configure --prefix=/usr/local
82157
83- # We don't really care about the version here -just building python bindings
84- make VERBOSE=1
158+ if [[ " $( uname) " == " Darwin" ]]; then
159+ CPPFLAGS=" $CPPFLAGS " LDFLAGS=$LDFLAGS PKG_CONFIG_PATH=$PKG_CONFIG_PATH \
160+ ./configure --with-external-libev --prefix=/usr/local
161+ else
162+ ./configure --prefix=/usr/local
163+ fi
85164
86- # This sometimes fails the first time but then works ok? Weird
165+ make VERBOSE=1
87166sudo make install || true
88167sudo make install
89- sudo ldconfig
90- cd ${here}
168+ if [[ " $( uname) " != " Darwin" ]]; then
169+ sudo ldconfig
170+ fi
171+
172+ cd " ${here} "
0 commit comments