Skip to content

Commit

Permalink
Merge branch 'master' into github_action_mac
Browse files Browse the repository at this point in the history
  • Loading branch information
j-woz committed Sep 5, 2024
2 parents 9a415c6 + d0d31c3 commit c96f6a9
Show file tree
Hide file tree
Showing 25 changed files with 137 additions and 140 deletions.
4 changes: 4 additions & 0 deletions dev/conda/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ Setup:
create the "exported" Swift/T source tree in `$TMP/distro`,
where `$TMP` defaults to `/tmp`.
This source code location is hard-coded into `meta.yaml`.
** Thus, the working Swift/T clone and the copy in `$TMP/distro` must be
identical! Version numbers are pulled from the working clone.

Loop:

Expand Down Expand Up @@ -138,6 +140,8 @@ $ anaconda login
$ anaconda upload $PKG
----

Use `dev/conda/upload.sh` to automate this.

== Dependencies

`r-rinside`::
Expand Down
9 changes: 5 additions & 4 deletions dev/conda/build-generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,19 @@ echo ENABLE_R=$ENABLE_R
echo "ENABLE_R: $ENABLE_R"
} > $RECIPE_DIR/build-generic.log

# Cf. helpers.zsh
if [[ $PLATFORM =~ osx-* ]]
then
NULL=""
ZT=""
if [[ $PLATFORM =~ osx-arm64 ]]
then
export MPICH_CC=clang
export MPICH_CXX=clang++
# These variables affect the mpicc/mpicxx wrappers
export MPICH_CC=clang
export MPICH_CXX=clang++
fi
else
NULL="--null" ZT="--zero-terminated"
NULL="--null"
ZT="--zero-terminated"
fi
printenv ${NULL} | sort ${ZT} | tr '\0' '\n' > \
$RECIPE_DIR/build-env.log
Expand Down
16 changes: 12 additions & 4 deletions dev/conda/conda-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Options:
END
}

C="" R=""
zparseopts -D -E -F h=HELP C=C r=R
C="" R="" R_VERSION=""
zparseopts -D -E -F h=HELP C=C r:=R

if (( ${#HELP} )) {
help
Expand All @@ -37,20 +37,28 @@ if (( ${#HELP} )) {

# Get this directory (absolute):
DEV_CONDA=${0:A:h}
source $DEV_CONDA/helpers.zsh

# The Swift/T Git clone:
SWIFT_T_TOP=${DEV_CONDA:h:h}
TMP=${TMP:-/tmp}

source $SWIFT_T_TOP/turbine/code/scripts/helpers.zsh
source $DEV_CONDA/helpers.zsh
# Sets SWIFT_T_VERSION:
source $SWIFT_T_TOP/dev/get-versions.sh
export SWIFT_T_VERSION
# Sets PYTHON_VERSION:
source $DEV_CONDA/get-python-version.sh
# Optionally set R_VERSION from user argument:
if (( ${#R} )) export R_VERSION=${R[2]}

if (( ${#PLATFORM:-} == 0 )) {
log "unset: PLATFORM"
log " This script should be called by a conda-platform.sh"
return 1
}

log "VERSION: $SWIFT_T_VERSION"
log "PLATFORM: $PLATFORM $*"

# This is passed into meta.yaml:
Expand Down Expand Up @@ -114,7 +122,7 @@ m4 -P -I $DEV_CONDA $COMMON_M4 $SETTINGS_SED > settings.sed

if (( ${#C} )) {
log "configure-only: exit."
exit
return
}

# Backup the old log
Expand Down
29 changes: 29 additions & 0 deletions dev/conda/conda-platform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/zsh
set -eu

# CONDA PLATFORM
# Dependency files are in the PLATFORM directory
# Generated scripts and log files are put in the PLATFORM directory
# Arguments:
# -C configure-only- generate meta.yaml and settings.sed, then stop
# -r R_VERSION for the R version
# PLATFORM: The PLATFORM directory

C="" R=""
zparseopts -D -E -F h=HELP C=C r:=R
if (( ${#*} != 1 )) {
print "conda-platform.sh: Provide PLATFORM!"
return 1
}
export PLATFORM=$1

# The Swift/T Conda script directory (absolute):
DEV_CONDA=${0:A:h}

if [[ ! -d $DEV_CONDA/$PLATFORM ]] {
printf "conda-platform.sh: No such platform: '%s'\n" $PLATFORM
return 1
}

cd $DEV_CONDA/$PLATFORM
$DEV_CONDA/conda-build.sh $HELP $C $R
25 changes: 0 additions & 25 deletions dev/conda/linux-64/conda-platform.sh

This file was deleted.

25 changes: 0 additions & 25 deletions dev/conda/linux-aarch64/conda-platform.sh

This file was deleted.

12 changes: 5 additions & 7 deletions dev/conda/meta-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ COMMENT(
# Will be filtered into PLATFORM/meta.yaml by conda-build.sh:m4
)

# Date that this meta.yaml was filtered:
# Date that this meta.yaml was filtered from meta-template.yaml:
# DATE: getenv(DATE)

{% set name = "getenv(PKG_NAME)" %}
{% set version = "1.6.4" %}
{% set major = version.rpartition('.')[0] %}
{% set sha256 = 'f5b26bb1ac427c271e19dff2146101f7c4da03652d66426a291e96638ba15c03' %}
{% set name = "getenv(PKG_NAME)" %}
{% set version = "getenv(SWIFT_T_VERSION)" %}
{% set major = version.rpartition('.')[0] %}

package:
name: {{ name|lower }}
name: {{ name|lower }}
version: {{ version }}
sha256: {{ sha256 }}

source:
path: getenv(DISTRO)/swift-t-{{ version }}/swift-t-{{ version }}
Expand Down
25 changes: 0 additions & 25 deletions dev/conda/osx-64/conda-platform.sh

This file was deleted.

24 changes: 0 additions & 24 deletions dev/conda/osx-arm64/conda-platform.sh

This file was deleted.

2 changes: 1 addition & 1 deletion dev/conda/pkgs-R.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ COMMENT( inside build-generic.sh )m4_dnl
COMMENT( Retain indentation )m4_dnl
m4_ifelse(getenv(PLATFORM),`osx-arm64',
` - swift-t::emews-rinside',
` - r'
` - r=getenv(R_VERSION)'
)m4_dnl
# pkgs-R.yaml: STOP
15 changes: 9 additions & 6 deletions dev/get-versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
# from all Swift/T components

# This has to be manually edited:
SWIFT_T_VERSION=1.6.4
SWIFT_T_VERSION=1.6.5

# These are automatically extracted:
CUTILS_VERSION=$( cat c-utils/code/version.txt )
ADLBX_VERSION=$( cat lb/code/version.txt )
TURBINE_VERSION=$( cat turbine/code/version.txt )
STC_VERSION=$( cat stc/code/etc/version.txt )
THIS=$( cd $( dirname $0 ) ; /bin/pwd )
SWIFT_TOP=$( cd $THIS/.. ; /bin/pwd )

# These are automatically extracted:
CUTILS_VERSION=$( cat $SWIFT_TOP/c-utils/code/version.txt )
ADLBX_VERSION=$( cat $SWIFT_TOP/lb/code/version.txt )
TURBINE_VERSION=$( cat $SWIFT_TOP/turbine/code/version.txt )
STC_VERSION=$( cat $SWIFT_TOP/stc/code/etc/version.txt )
2 changes: 0 additions & 2 deletions dev/release/make-release-pkg.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ do
esac
done

source ${THIS}/../get-versions.sh

# Define tokens (location in SVN or Git):
# If using release paths, use "release/version" or git branch/tag name
# If using master (USE_MASTER), use "master"
Expand Down
20 changes: 20 additions & 0 deletions dev/report-versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env zsh

THIS=${0:h:A}
source $THIS/get-versions.sh

Vs=( CUTILS_VERSION
ADLBX_VERSION
TURBINE_VERSION
STC_VERSION
SWIFT_T_VERSION
)

for V in $Vs
do
printf "%-15s %6s\n" $V ${(P)V}
done




3 changes: 2 additions & 1 deletion lb/code/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ AC_ARG_WITH(c-utils,
AS_HELP_STRING(
[--with-c-utils], [location of ExM c-utils]),
[
AC_CHECK_FILE(${withval}/include/c-utils.h,
CPPFLAGS+=" -I${withval}/include"
AC_CHECK_HEADER(tools.h,
[USE_C_UTILS=1], [])
if [[ ${USE_C_UTILS} == 0 ]]
then
Expand Down
2 changes: 1 addition & 1 deletion lb/code/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.3
1.0.4
15 changes: 14 additions & 1 deletion turbine/code/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,13 @@ AC_ARG_WITH(launcher,
[USE_LAUNCHER=${withval}],
[USE_LAUNCHER=$(which mpiexec)]
)

if ! [[ $cross_compiling == "yes" ]]
then
AC_CHECK_FILE($USE_LAUNCHER,
[AC_MSG_RESULT([Using Turbine MPI launcher: $USE_LAUNCHER])],
[AC_MSG_ERROR([Launcher not found: '$USE_LAUNCHER'])])

fi
AC_CHECK_HEADER([mpi.h], [], [AC_MSG_ERROR([Could not find mpi.h!])])
AC_CHECK_LIB([mpi], [MPI_Init], [],
[AC_MSG_ERROR([Could not find MPI library!])])
Expand All @@ -249,6 +252,7 @@ AC_CHECK_LIB([mpi], [MPI_Init], [],
# Use the preprocessor to extract tokens that identify MPICH or OpenMPI:
HAVE_MPI_IMPL_OPENMPI=0
HAVE_MPI_IMPL_MPICH=0
HAVE_MPI_IMPL_SMPI=0
MPI_OUTPUT=$( mktemp )
$CC -E $CPPFLAGS $CFLAGS maint/mpi_identification.c 2>&1 > $MPI_OUTPUT

Expand All @@ -258,6 +262,9 @@ then
elif grep -q FOUND_OpenMPI $MPI_OUTPUT
then
MPI_IMPL="OpenMPI"
elif grep -q FOUND_SMPI $MPI_OUTPUT
then
MPI_IMPL="SMPI"
else
MPI_IMPL="UNKNOWN"
fi
Expand Down Expand Up @@ -286,6 +293,10 @@ elif [[ $MPI_IMPL == "MPICH" ]]
then
HAVE_MPI_IMPL_MPICH=1
MPI_LINE_OUTPUT_FLAG="-l"
elif [[ $MPI_IMPL == "SMPI" ]]
then
HAVE_MPI_IMPL_SMPI=1
MPI_LINE_OUTPUT_FLAG="-l"
else
AC_MSG_WARN([No MPI implementation tokens found in mpi.h !])
fi
Expand All @@ -297,6 +308,8 @@ AC_DEFINE_UNQUOTED(HAVE_MPI_IMPL_OPENMPI,
${HAVE_MPI_IMPL_OPENMPI},[True if using OpenMPI])
AC_DEFINE_UNQUOTED(HAVE_MPI_IMPL_MPICH,
${HAVE_MPI_IMPL_MPICH},[True if using MPICH])
AC_DEFINE_UNQUOTED(HAVE_MPI_IMPL_SMPI,
${HAVE_MPI_IMPL_SMPI},[True if using SMPI])

# Write out MPI settings
AC_SUBST(USE_MACHINE)
Expand Down
2 changes: 1 addition & 1 deletion turbine/code/maint/file-list.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ print tests/{*.manifest,*.sh,*.data,*.txt}
print src/util/debug-tokens.tcl.in
print src/**/*.manifest
print py/*.py
print scripts/*-config.sh.in scripts/helpers.zsh
print scripts/*-config.sh.in scripts/helpers.{z,}sh
print scripts/{data-log.sh,leak-find.py,rank.zsh,common.m4}
print scripts/main-wrap/genleaf
print scripts/main-wrap/settings/*.sh
Expand Down
5 changes: 5 additions & 0 deletions turbine/code/maint/mpi_identification.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ FOUND_OpenMPI();
MAJOR-VERSION OMPI_MAJOR_VERSION
MINOR-VERSION OMPI_MINOR_VERSION
#endif

#ifdef SMPI_H
// If this text makes it through the preprocessor, this is SMPI:
FOUND_SMPI();
#endif
Loading

0 comments on commit c96f6a9

Please sign in to comment.