Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false
fail-fast: true

# Set up a matrix to run the following 3 configurations:
# 1. <Windows, Release, latest MPI toolchain on the default runner image, default generator>
Expand All @@ -32,6 +31,8 @@ jobs:
defaults:
run:
shell: ${{ contains(matrix.os, 'windows') && 'msys2 {0}' || 'bash {0}' }}
env:
MSYS2_PATH_TYPE: 'inherit'

steps:
- run: git config --global core.autocrlf false
Expand Down Expand Up @@ -63,6 +64,8 @@ jobs:
git
bison
flex
patch
bc
pacboy: |
toolchain
autotools
Expand All @@ -71,8 +74,8 @@ jobs:
ccache
make
msmpi
openblas64
lapack64
openblas
lapack
fftw
suitesparse
msmpi
Expand All @@ -92,21 +95,37 @@ jobs:
path: _source
key: ${{ runner.os }}-sources

- name: Cache Trilinos build
id: cache-trilinos
uses: actions/cache@v4
with:
path: |
_build_*/libs
_b/libs
key: ${{ runner.os }}-trilinos-${{ hashFiles('build.sh','scripts/*trilinos*', 'scripts/fetch-source.sh') }}


- name: Fetch Source
run: ./build.sh -s

- name: Build Trilinos
if: ${{ steps.cache-trilinos.outputs.cache-hit != 'true' && ! contains(matrix.os, 'windows') }}
run: ./build.sh -t


# Horrible things to reduce path length in build..
- name: Build for Windows (${{ matrix.os }})
if: contains(matrix.os, 'windows')
- name: Build Trilinos for Windows
if: ${{ steps.cache-trilinos.outputs.cache-hit != 'true' && contains(matrix.os, 'windows') }}
shell: msys2 {0}
working-directory: 'c:\a\'
run: |
mv /c/a/Xyce-build/Xyce-build /c/a/wb
cd /c/a/wb && ./build.sh -s -t -m -x -i
mv /c/a/wb /c/a/Xyce-build/Xyce-build

mv $GITHUB_WORKSPACE /c/a/wb
cd /c/a/wb && ./build.sh -t
mv /c/a/wb/* $GITHUB_WORKSPACE

- name: Build
if: ${{ ! contains(matrix.os, 'windows') }}
run: ./build.sh -s -t -m -x -i

- name: Build rest
run: ./build.sh -m -x -i

- name: Run Regression
run: ./build.sh -r
Expand Down
34 changes: 22 additions & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ if [ -z $option_passed ]; then
BUILD_TRILINOS=1
BUILD_XDM=1
BUILD_XYCE=1
RUN_REGRESSION=1
INSTALL_XYCE=1
#RUN_REGRESSION=1
#INSTALL_XYCE=1
fi


Expand All @@ -126,6 +126,11 @@ echo

export BUILDDIR=_build_$OS

if [ -n "$FETCH_SOURCE" ]; then
./scripts/fetch-source.sh
fi


if [[ "$OS" == "Linux" ]]; then
if [ -e /etc/lsb-release ]; then
DISTRO=$( cat /etc/lsb-release | tr [:upper:] [:lower:] | grep -Poi '(debian|ubuntu|red hat|centos)' | uniq )
Expand Down Expand Up @@ -200,31 +205,34 @@ elif [[ "$OS" == "Windows_MSYS2" || "$OS" == "Cygwin" ]]; then

./scripts/windows-install.sh

TRILINOS_CONFIGURE_OPTS="-DBLAS_LIBRARY_NAMES=openblas_64 -DBLAS_INCLUDE_DIRS=/ucrt64/include/openblas64 -DLAPACK_LIBRARY_NAMES=lapack64"
LDFLAGS="-L/urtc/lib/ -lblas64 -llapack64"
export PATH="$PATH:/c/Program Files/Microsoft MPI/Bin/"

TRILINOS_CONFIGURE_OPTS="-DBLAS_LIBRARY_NAMES=openblas -DBLAS_INCLUDE_DIRS=/ucrt64/include/openblas -DLAPACK_LIBRARY_NAMES=lapack"
XTRALIBS="-L/urtc/lib/ -lopenblas -llapack"
CPPFLAGS="-I/usr/include -I/ucrt64/include"
SUITESPARSE_INC=/ucrt64/include/suitesparse
LIBRARY_PATH=/ucrt64/lib/x86_64-linux-gnu
INCLUDE_PATH=/ucrt64/include
BOOST_ROOT=/ucrt64
BOOST_INCLUDEDIR=/ucrt64/include/boost
BOOST_LIBRARYDIR=/ucrt64/lib/
PYTHON=/ucrt64/usr/bin/python3
export LDFLAGS SUITESPARSE_INC LIBRARY_PATH INCLUDE_PATH BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR
export XTRALIBS CPPFLAGS SUITESPARSE_INC LIBRARY_PATH INCLUDE_PATH BOOST_ROOT BOOST_INCLUDEDIR BOOST_LIBRARYDIR

CFLAGS="$CFLAGS -fpermissive"
CFLAGS="$CFLAGS -fpermissive -Wno-deprecated-declarations"
NCPUS=$NUMBER_OF_PROCESSORS
export NCPUS

# keep filenames short
export BUILDDIR="_b"
# Windows needs a patch to build sucessfully :(
if [ -n "$BUILD_XYCE" ]; then
git -C $ROOT/_source/Xyce apply $ROOT/data/windows/*.patch
fi
else
echo "Unknown environment"
fi

if [ -n "$FETCH_SOURCE" ]; then
./scripts/fetch-source.sh
fi

# Set up environment variables
export CFLAGS="$CFLAGS -fPIC"
export CXXFLAGS="$CFLAGS -fPIC -std=c++17"
Expand All @@ -239,10 +247,12 @@ if [ -z "$CCACHE" ]; then
echo "ccache not found"
else
echo "ccache found, using $CCACHE"
export CMAKE_C_COMPILER_LAUNCHER="$CCACHE"
export CMAKE_CXX_COMPILER_LAUNCHER="$CCACHE"
TRILINOS_CONFIGURE_OPTS="$TRILINOS_CONFIGURE_OPTS -DCMAKE_C_COMPILER_LAUNCHER=$CCACHE -DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE"
fi

# make cmake quieter..
TRILINOS_CONFIGRURE_OPTS="$TRILINOS_CONFIGRURE_OPTS-Wno-dev"

export ARCHDIR="$ROOT/$BUILDDIR/libs"

if [ -z "$INSTALL_PATH" ]; then
Expand Down
56 changes: 56 additions & 0 deletions data/0001-Enable-64bit-MPI-messages.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
From 1c8dcbb3839c6bc3efea351a48667b3bbfcf26bd Mon Sep 17 00:00:00 2001
From: Rob Taylor <rob.taylor@chipflow.io>
Date: Sun, 22 Jun 2025 22:09:00 +0100
Subject: [PATCH] Enable 64bit MPI messages

---
src/ParallelDistPKG/N_PDS_MPI.h | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)

diff --git a/src/ParallelDistPKG/N_PDS_MPI.h b/src/ParallelDistPKG/N_PDS_MPI.h
index 2e3d80b..bdb1569 100644
--- a/src/ParallelDistPKG/N_PDS_MPI.h
+++ b/src/ParallelDistPKG/N_PDS_MPI.h
@@ -272,25 +272,21 @@ struct Datatype<unsigned long>
}
};

-// #ifdef MPI_LONG_LONG_INT
-// template <>
-// struct Datatype<long long>
-// {
-// static MPI_Datatype type() {
-// return MPI_LONG_LONG_INT;
-// }
-// };
-// #endif
+template <>
+struct Datatype<long long>
+{
+ static MPI_Datatype type() {
+ return MPI_LONG_LONG;
+ }
+};

-// #ifdef MPI_UNSIGNED_LONG_LONG_INT
-// template <>
-// struct Datatype<unsigned long long>
-// {
-// static MPI_Datatype type() {
-// return MPI_UNSIGNED_LONG_LONG_INT;
-// }
-// };
-// #endif
+template <>
+struct Datatype<unsigned long long>
+{
+ static MPI_Datatype type() {
+ return MPI_UNSIGNED_LONG_LONG;
+ }
+};

template <>
struct Datatype<float>
--
2.39.5 (Apple Git-154)

21 changes: 21 additions & 0 deletions data/0002-Fix-datetimestamp-when-no-tags-available.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From 8aa2f41f8fe8eb1e82a9beba6a2643be7a88c974 Mon Sep 17 00:00:00 2001
From: Rob Taylor <rob.taylor@chipflow.io>
Date: Sun, 22 Jun 2025 23:00:33 +0100
Subject: [PATCH] Fix datetimestamp when no tags available

diff --git a/utils/XyceDatestamp.sh b/utils/XyceDatestamp.sh
index a1d78345..2a052a98 100755
--- a/utils/XyceDatestamp.sh
+++ b/utils/XyceDatestamp.sh
@@ -5,7 +5,7 @@ DATESTR=`date +%Y%m%d%H%M`
cd $SRCDIR
if [ -e .git ]
then
- GITSHA=`git describe --dirty`
+ GITSHA=`git describe --dirty --all`
DATESTR="${DATESTR}-(${GITSHA})"
fi
echo $DATESTR
--
2.39.5 (Apple Git-154)

23 changes: 23 additions & 0 deletions data/windows/0003-Quote-harder-for-XYCEBUILDTIMESTAMP.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From 89d2421132e0190dd9b6c861ee4f268f499018f7 Mon Sep 17 00:00:00 2001
From: Rob Taylor <rob.taylor@chipflow.io>
Date: Mon, 23 Jun 2025 13:51:42 +0100
Subject: [PATCH] Quote harder for XYCEBUILDTIMESTAMP

---
src/UtilityPKG/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/UtilityPKG/Makefile.am b/src/UtilityPKG/Makefile.am
index f76b3756..e9b3de5c 100644
--- a/src/UtilityPKG/Makefile.am
+++ b/src/UtilityPKG/Makefile.am
@@ -1,5 +1,5 @@

-AM_CPPFLAGS = @Xyce_INCS@ -DXYCEBUILDTIMESTAMP=\"`$(top_srcdir)/utils/XyceDatestamp.sh $(top_srcdir)`\"
+AM_CPPFLAGS = @Xyce_INCS@ -DXYCEBUILDTIMESTAMP=\\\"`$(top_srcdir)/utils/XyceDatestamp.sh $(top_srcdir)`\\\"

SUBDIRS = ExpressionSrc

--
2.39.5 (Apple Git-154)

1 change: 1 addition & 0 deletions scripts/build-xdm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ cmake \
-DPython3_EXECUTABLE=$PYTHON \
-DCC="$CC" \
-DCXX="$CXX" \
-Wno-dev \
$CONFIGURE_OPTS \
-S "$ROOT/_source/XDM" \
-B "$ROOT/$BUILDDIR/XDM" 2>&1 | tee "$ROOT/$BUILDDIR/configure-XDM.log"
Expand Down
7 changes: 6 additions & 1 deletion scripts/build-xyce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ TRILINOS_LIBS="-lisorropia -lzoltan -ltpetra -lkokkoskernels -lteuchosparameterl

pushd "$ROOT/_source/Xyce"
./bootstrap
git apply $ROOT/data/*.patch

echo "Getting timedatestamp"
./utils/XyceDatestamp.sh "$ROOT/_source/Xyce"
echo
popd

pushd "$ROOT/$BUILDDIR/Xyce"
Expand All @@ -38,5 +43,5 @@ popd
echo "Building Xyce..."
NCPUS="${NCPUS:-$(nproc)}"
echo "make -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee \"$ROOT/$BUILDDIR/Xyce-build.log\""
make -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee "$ROOT/$BUILDDIR/Xyce-build.log"
make -C $BUILDDIR/Xyce -j $NCPUS V=1 2>&1 | tee "$ROOT/$BUILDDIR/Xyce-build.log" || true

29 changes: 17 additions & 12 deletions scripts/windows-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@ echo "Installing dependencies..."
pacman -S --needed \
bison \
flex \
mingw-w64-ucrt-x86_64-cmake \
mingw-w64-ucrt-x86_64-make \
mingw-w64-ucrt-x86_64-msmpi \
mingw-w64-ucrt-x86_64-openblas64 \
mingw-w64-ucrt-x86_64-lapack64 \
mingw-w64-ucrt-x86_64-fftw \
mingw-w64-ucrt-x86_64-suitesparse \
mingw-w64-ucrt-x86_64-msmpi \
mingw-w64-ucrt-x86_64-pkgconf \
mingw-w64-ucrt-x86_64-boost \
mingw-w64-ucrt-x86_64-boost-libs
autoconf \
automake \
patch \
pacboy

pacboy -S --needed \
cmake \
make \
msmpi \
openblas \
lapack \
fftw \
suitesparse \
msmpi \
pkgconf \
boost \
boost-libs

curl -L -O https://github.com/microsoft/Microsoft-MPI/releases/download/v10.1.1/msmpisetup.exe
./msmpisetup.exe -unattend -force
export PATH="/c/Program Files/Microsoft MPI/Bin/$PATH"
10 changes: 9 additions & 1 deletion scripts/xyce-regression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ if [[ $NCPUS -gt $REGRESSION_MAX_CPUS ]]; then
NCPUS=$REGRESSION_MAX_CPUS
fi

EXECSTRING="mpirun -np 2 $XYCE_BINARY"
echo
echo "Running Xyce regression suite. Using Binary $XYCE_BINARY with $XYCE_REGRESSION"
echo
echo "Testing $XYCE_BINARY"
$XYCE_BINARY || echo "$XYCE_BINARY failed"
echo "Testing mpiexec"
mpiexec -np 2 $XYCE_BINARY || echo "mpirun -np 2 $XYCE_BINARY failed"

EXECSTRING="mpiexec -np 2 $XYCE_BINARY"
eval `$XYCE_REGRESSION/TestScripts/suggestXyceTagList.sh "$XYCE_BINARY"`
$XYCE_REGRESSION/TestScripts/run_xyce_regressionMP \
--verbose \
Expand Down
Loading