Skip to content

Commit 79115a3

Browse files
committed
Update to fix Mac
1 parent ea1e432 commit 79115a3

File tree

11 files changed

+93
-68
lines changed

11 files changed

+93
-68
lines changed

dev/conda/build-generic.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ set -o pipefail
2020
# PREFIX is provided by Conda
2121
# ENABLE_R may be set by meta.yaml
2222

23+
# Try to force everything to stdout for correct ordering
24+
# Also do this in PLATFORM/build.sh
25+
# Works on Mac: 2025-10-27
26+
exec 2>&1
27+
2328
log()
2429
{
2530
echo "build-generic.sh:" ${*}
@@ -152,15 +157,21 @@ fi
152157
# Edit swift-t-settings
153158
${SED_I[@]} -f $SETTINGS_SED swift-t-settings.sh
154159

160+
log "check aclocal"
161+
which aclocal # 2>&1
162+
163+
155164
# Build it!
156165
# Merge output streams to try to prevent buffering
157166
# problems with conda build
158167
{
159168
echo
160-
# Anaconda Autoconf 2.72 is buggy
169+
log "check aclocal"
170+
which aclocal
161171
log "build tools:"
162172
which m4 autoreconf aclocal autom4te mpicc
163173
m4 --version | head -1
174+
# Anaconda Autoconf 2.72 is buggy
164175
autoreconf --version | head -1
165176
log "mpicc show:"
166177
mpicc -show

dev/conda/common.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ dnl This file must have a newline at the end for OSX.
44
dnl Simply remove this text:
55
m4_define(`COMMENT', `')dnl
66
dnl This simply does environment variable substition when m4 runs:
7-
m4_define(`getenv', `m4_esyscmd(printf -- "$`$1'")')dnl
7+
m4_define(`m4_getenv', `m4_esyscmd(printf -- "$`$1'")')dnl
88
m4_divert

dev/conda/conda-build.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ setopt PIPE_FAIL
44

55
# CONDA BUILD
66
# Generic wrapper around `conda build'
7-
# Called by ./conda-platform.sh
87
# Generates meta.yaml and runs `conda build'
9-
# Generates settings.sed for the Swift/T build
8+
# Generates settings.sed to edit swift-t-settings.sh
109
# Many exported environment variables here
1110
# are substituted into meta.yaml
1211
# This script runs in the CONDA_PLATFORM subdirectory
1312
# and should not change directories
14-
# A LOG is produced named platform/conda-build.log
13+
# A LOG is produced named CONDA_PLATFORM/conda-build.log
1514
# You can only run 1 job concurrently per Anaconda installation
1615
# because of the log and
1716
# because of meta.yaml
@@ -120,9 +119,12 @@ if (( ! ${#R} )) {
120119
# Default dependencies:
121120
export USE_ANT=1
122121
export USE_GCC=1
122+
export USE_CLANG=0
123123
export USE_TK=0
124124
export USE_ZLIB=0
125125
export USE_ZSH=1
126+
export SPEC_MPICH="mpich-mpicc"
127+
export SPEC_CLANG=""
126128

127129
# Allow platform to modify dependencies
128130
source $DEV_CONDA/$CONDA_PLATFORM/deps.sh

dev/conda/conda-install.sh

Lines changed: 19 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -82,46 +82,30 @@ then
8282
return 1
8383
fi
8484

85-
# Get 2nd token from the version string:
86-
PV=( $( python --version ) )
87-
PV=${PV[2]}
85+
source $DEV_CONDA/get-python-version.sh
8886

89-
print "using python:" $( which python ) "(v$PV)"
87+
print "using python:" $( which python ) $PYTHON_VERSION
9088
print "using conda: " $( which conda )
9189

9290
# conda env list
9391

9492
# Defaults:
93+
# A SPEC is a 'package==version' specifier.
94+
# The version may be omitted if we are flexible.
9595
USE_ANT=1
9696
USE_GCC=1
9797
USE_ZSH=1
98+
SPEC_CLANG=""
99+
SPEC_MPICH="mpich"
100+
SPEC_PYTHON="python"
101+
TK="tk"
98102

99103
# Load platform-specific settings:
100-
source $DEV_CONDA/$CONDA_PLATFORM/deps.sh
101-
102-
# Auto-configuration
103-
# PINs are version pins applied to the package names
104-
PIN_CLANG=""
105-
PIN_MPICH=""
106-
PIN_PV=""
107-
if [[ $CONDA_PLATFORM == "osx-arm64" ]] {
108-
SOLVER=( --solver classic )
109-
# Pin Python version for these versions:
110-
# On GitHub, Conda will try to change them!
111-
case $PV {
112-
3.9*) PIN_PV="==3.9.7" ;;
113-
3.10*) ;& # Fall-through
114-
3.11*) ;& # Fall-through
115-
3.12*) ;& # Fall-through
116-
3.13*) PIN_PV="==$PV" ;;
117-
*) print "conda-install.sh: unsupported Python version: '$PV'"
118-
exit 1 ;;
119-
}
120-
# Pin Clang for everything but Python 3.9
121-
# In Py 3.9, 18 => 18.1.7
122-
PIN_CLANG="-18==18.1.8"
123-
PIN_MPICH="==4.3.0"
124-
}
104+
if ! source $DEV_CONDA/$CONDA_PLATFORM/deps.sh
105+
then
106+
abortf "conda-install.sh: failed during source %s\n" \
107+
$DEV_CONDA/$CONDA_PLATFORM/deps.sh
108+
fi
125109

126110
# Build dependency list:
127111
LIST=()
@@ -130,16 +114,18 @@ if (( USE_GCC )) LIST+=gcc
130114
if (( USE_ZSH )) LIST+=zsh
131115
LIST+=(
132116
autoconf
117+
$SPEC_CLANG
133118
make
134-
"mpich-mpicc$PIN_MPICH"
119+
$SPEC_MPICH
135120
openjdk
136121
# May need to pin version:
137-
"python$PIN_PV"
122+
$SPEC_PYTHON
138123
swig
124+
$SPEC_TK
139125
)
140126

141-
# # Needed for _strstr issue:
142-
if [[ $CONDA_PLATFORM == "osx-arm64" ]] LIST+=( "clang$PIN_CLANG" )
127+
# # # Needed for _strstr issue:
128+
# if [[ $CONDA_PLATFORM == "osx-arm64" ]] LIST+=( "clang$PIN_CLANG" )
143129

144130
# Needed for libstdc++ GLIBCXX version issue on GCE Jenkins:
145131
if [[ ${JENKINS_HOME:-} != "" ]] LIST+=( "gcc=14" )

dev/conda/meta-template.yaml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,67 @@
11
COMMENT(
22
# META TEMPLATE YAML
33
# Will be filtered into PLATFORM/meta.yaml by conda-build.sh:m4
4+
# Any m4_getenv() values are substituted when m4 runs!
45
)
56

67
# Date that this meta.yaml was filtered from meta-template.yaml:
7-
# DATE: getenv(DATE)
8+
# DATE: m4_getenv(DATE)
89

9-
{% set name = "getenv(PKG_NAME)" %}
10-
{% set version = "getenv(SWIFT_T_VERSION)" %}
10+
{% set name = "m4_getenv(PKG_NAME)" %}
11+
{% set version = "m4_getenv(SWIFT_T_VERSION)" %}
1112
{% set major = version.rpartition('.')[0] %}
1213

1314
package:
1415
name: {{ name|lower }}
1516
version: {{ version }}
1617

1718
source:
18-
path: getenv(DISTRO)/swift-t-{{ version }}/swift-t-{{ version }}
19+
path: m4_getenv(DISTRO)/swift-t-{{ version }}/swift-t-{{ version }}
1920

2021
build:
2122
number: 1
2223
# Environment variables for build.sh must be listed here,
2324
# normal environment inheritance does not happen!
2425
script_env:
25-
- CONDA_PLATFORM=getenv(CONDA_PLATFORM)
26-
- GITHUB_ACTIONS=getenv(GITHUB_ACTIONS)
27-
m4_ifelse(getenv(ENABLE_R),`1',m4_include(env-R.yaml))
26+
- CONDA_PLATFORM=m4_getenv(CONDA_PLATFORM)
27+
- GITHUB_ACTIONS=m4_getenv(GITHUB_ACTIONS)
28+
m4_ifelse(m4_getenv(ENABLE_R),`1',m4_include(env-R.yaml))
2829

2930
# Remember to sync any dependency changes here with conda-install.sh
3031
requirements:
3132
build:
33+
- python==m4_getenv(PYTHON_VERSION)
3234
# Anaconda Autoconf 2.72 is buggy 2025-05-12
3335
- autoconf==2.71
36+
# Automake is needed on osx-arm64: 2025-10-27
37+
- automake
3438
- make
3539
- openjdk>=17 # Security issue in Java < 11.72.19
36-
- mpich-mpicc
37-
- python==getenv(PYTHON_VERSION)
40+
- m4_getenv(SPEC_MPICH)
3841
- swig
39-
m4_ifelse(getenv(USE_ANT),`1',m4_include(pkgs-ant.yaml))
40-
m4_ifelse(getenv(USE_GCC),`1',m4_include(pkgs-gcc.yaml))
41-
m4_ifelse(getenv(USE_TK), `1',m4_include(pkgs-tk.yaml))
42-
m4_ifelse(getenv(USE_ZSH),`1',m4_include(pkgs-zsh.yaml))
43-
m4_ifelse(getenv(ENABLE_R),`1',m4_include(pkgs-R.yaml))
42+
m4_ifelse(m4_getenv(USE_ANT), `1',m4_include(pkgs-ant.yaml))m4_dnl
43+
m4_ifelse(m4_getenv(USE_CLANG),`1',m4_include(pkgs-clang.yaml))m4_dnl
44+
m4_ifelse(m4_getenv(USE_GCC), `1',m4_include(pkgs-gcc.yaml))m4_dnl
45+
m4_ifelse(m4_getenv(USE_TK), `1',m4_include(pkgs-tk.yaml))m4_dnl
46+
m4_ifelse(m4_getenv(USE_ZSH), `1',m4_include(pkgs-zsh.yaml))m4_dnl
47+
m4_ifelse(m4_getenv(ENABLE_R), `1',m4_include(pkgs-R.yaml))m4_dnl
4448
run:
45-
- mpich-mpicc
46-
- openjdk>=17 # Security issue in Java < 11.72.19
47-
- python==getenv(PYTHON_VERSION)
49+
- python==m4_getenv(PYTHON_VERSION)
50+
- openjdk>=17
51+
- m4_getenv(SPEC_MPICH)
4852
- swig
49-
m4_ifelse(getenv(USE_GCC),`1',m4_include(pkgs-gcc.yaml))
50-
m4_ifelse(getenv(USE_TK), `1',m4_include(pkgs-tk.yaml))
51-
m4_ifelse(getenv(USE_ZSH),`1',m4_include(pkgs-zsh.yaml))
52-
m4_ifelse(getenv(ENABLE_R),`1',m4_include(pkgs-R.yaml))
53+
m4_ifelse(m4_getenv(USE_CLANG),`1',m4_include(pkgs-clang.yaml))m4_dnl
54+
m4_ifelse(m4_getenv(USE_GCC), `1',m4_include(pkgs-gcc.yaml))m4_dnl
55+
m4_ifelse(m4_getenv(USE_TK), `1',m4_include(pkgs-tk.yaml))m4_dnl
56+
m4_ifelse(m4_getenv(USE_ZSH), `1',m4_include(pkgs-zsh.yaml))m4_dnl
57+
m4_ifelse(m4_getenv(ENABLE_R), `1',m4_include(pkgs-R.yaml))m4_dnl
5358

5459
test:
5560
commands:
5661
- swift-t -v
62+
- swift-t -E 'trace(42);'
63+
- which swift-t
64+
- cp $PREFIX/swift-t/turbine/lib/libtclturbine.dylib /Users/woz
5765

5866
about:
5967
home: http://swift-lang.org/Swift-T

dev/conda/osx-arm64/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
21
# osx-arm64 BUILD SH
32
# Simply calls build-generic.
43
# `conda build` calls this as Bash.
54

5+
exec 2>&1
6+
7+
# Try to force everything to stdout for correct ordering
8+
# Works on Mac: 2025-10-27
69
echo "build.sh: START"
710

811
DEV_CONDA=$( cd $RECIPE_DIR/.. ; /bin/pwd -P )

dev/conda/osx-arm64/deps.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11

22
# osx-arm64 DEPS SH
33

4-
# For OSX/ARM64, we rely on these in the system:
5-
USE_ANT=0
4+
USE_ANT=1
5+
USE_CLANG=1
66
USE_GCC=0
7+
USE_TK=1
78
USE_ZSH=0
89

9-
# For OSX/ARM64, this dependency must be explicit:
10-
USE_TK=1
10+
# We export the SPECs so that M4 can use them in m4_getenv()
11+
12+
if [[ ${PYTHON_VERSION} == 3.13.* ]] {
13+
PYTHON_VERSION=3.13.2
14+
export SPEC_PYTHON="python==$PYTHON_VERSION"
15+
}
16+
17+
# Prevent MPICH from updating Clang to 19
18+
# SPEC_CLANG='clang==16.0.6'
19+
export SPEC_CLANG='clang==18.1.8'
20+
export SPEC_MPICH='mpich==4.1.2'
21+
export SPEC_TK='tk==8.6.13'

dev/conda/pkgs-R.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ COMMENT( custom-built emews-r )m4_dnl
55
COMMENT( Note that we now simply install r or emews-r )m4_dnl
66
COMMENT( and build RInside inside build-generic.sh )m4_dnl
77
COMMENT( Retain indentation )m4_dnl
8-
m4_ifelse(getenv(CONDA_PLATFORM),`osx-arm64',
8+
m4_ifelse(m4_getenv(CONDA_PLATFORM),`osx-arm64',
99
` - emews-r',
10-
` - r=getenv(R_VERSION)')
10+
` - r=m4_getenv(R_VERSION)')
1111
# pkgs-R.yaml: STOP
1212
m4_dnl Local Variables:
1313
m4_dnl mode: m4

dev/conda/pkgs-clang.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# pkgs-clang.yaml: START
2+
# Extra packages for clang
3+
- m4_getenv(SPEC_CLANG)
4+
# pkgs-clang.yaml: STOP

dev/conda/pkgs-gcc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# pkgs-gcc.yaml: START
22
# Extra packages for gcc
33
- gcc
4-
m4_ifelse(getenv(USE_ZLIB),1,
4+
m4_ifelse(m4_getenv(USE_ZLIB),1,
55
` - zlib'
66
)
77
# pkgs-gcc.yaml: STOP

0 commit comments

Comments
 (0)