Skip to content

Commit b6ffba4

Browse files
committed
Try simplifying build to use Rtools
1 parent 04b5468 commit b6ffba4

File tree

2 files changed

+23
-41
lines changed

2 files changed

+23
-41
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: Windows build
42

53
defaults:
@@ -31,59 +29,43 @@ jobs:
3129

3230
steps:
3331
- uses: actions/checkout@v2
34-
- uses: ilammy/msvc-dev-cmd@v1
32+
- name: install-rtools
33+
run: |
34+
choco install rtools --no-progress
35+
- name: show-gfortran
36+
run: |
37+
gcc --version
38+
gfortran --version
3539
36-
- name: Setup
40+
- name: Set env variables
3741
run: |
3842
BITS=${{ matrix.BUILD_BITS }}
3943
echo "BUILD_BITS=$BITS" >> $GITHUB_ENV;
44+
# For interpretation of MSYSTEM, see:
45+
# https://sourceforge.net/p/msys2/discussion/general/thread/b7dfdac8/#3939
4046
if [ "$BITS" == "32" ]; then
41-
echo "PLAT=i686" >> $GITHUB_ENV;
47+
echo "PLAT=i686" >> $GITHUB_ENV
48+
echo "MSYSTEM=MINGW32" >> $GITHUB_ENV
49+
echo "LDFLAGS='-static -static-libgcc'" >> $GITHUB_ENV
4250
else
43-
echo "PLAT=x86_64" >> $GITHUB_ENV;
51+
echo "PLAT=x86_64" >> $GITHUB_ENV
52+
echo "MSYSTEM=UCRT64" >> $GITHUB_ENV
53+
echo "LDFLAGS='-lucrt -static -static-libgcc'" >> $GITHUB_ENV
4454
fi
45-
echo "START_DIR=$PWD" >> $GITHUB_ENV;
46-
choco install -y zip
47-
48-
- run: |
49-
choco install -y mingw --forcex86 --force --version=8.1.0
50-
choco install -y make
51-
name: Install 32-bit mingw
52-
shell: powershell
53-
if: ${{ matrix.BUILD_BITS == '32' }}
54-
55-
- run: |
56-
# see https://www.mail-archive.com/[email protected]/msg586184.html
57-
if [ "${{ matrix.BUILD_BITS }}" == "64" ]; then
58-
include=/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/avx512fintrin.h
59-
else
60-
include=/c/ProgramData/Chocolatey/lib/mingw/tools/install/mingw32/lib/gcc/i686-w64-mingw32/8.1.0/include/avx512fintrin.h
55+
echo "START_DIR=$PWD" >> $GITHUB_ENV
56+
if [ "${{ matrix.INTERFACE64 }}" == "1" ]; then
57+
echo "INTERFACE64=1" >> $GITHUB_ENV
6158
fi
62-
sed -i -e"s/_mm512_abs_pd (__m512 __A)/_mm512_abs_pd (__m512d __A)/" $include
63-
name: Fix gcc bug
59+
# Preserve the current working directory in bash call.
60+
echo "CHERE_INVOKING='yes'" >> $GITHUB_ENV
6461
6562
- name: Build
6663
run: |
67-
BITS=${{ matrix.BUILD_BITS }}
68-
if [ "${{ matrix.INTERFACE64 }}" == "1" ]; then
69-
export INTERFACE64=1
70-
fi
71-
if [ "$BITS" == "32" ]; then
72-
export PATH=/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw32/bin:$PATH
73-
fi
74-
echo $PATH
7564
git submodule update --init --recursive
76-
tools/build_openblas.sh
65+
/c/rtools40/usr/bin/bash -lc tools/build_openblas.sh
7766
7867
- name: Test
7968
run: |
80-
BITS=${{ matrix.BUILD_BITS }}
81-
if [ "$BITS" == "32" ]; then
82-
export PATH=/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw32/bin:$PATH
83-
fi
84-
if [ "${{ matrix.INTERFACE64 }}" == "1" ]; then
85-
export INTERFACE64=1
86-
fi
8769
tools/build_gfortran.sh
8870
cp test.exe builds
8971
cp test_dyn.exe builds

OpenBLAS

0 commit comments

Comments
 (0)