Skip to content

Commit 5a86cfb

Browse files
authored
update triangle build options (#258)
* update triangle source https path * modified how scheduled steps are run
1 parent caa91e2 commit 5a86cfb

4 files changed

Lines changed: 23 additions & 93 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
1414
paths-ignore:
1515
- 'README.md'
1616
- 'docs/*.md'
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1719
concurrency:
1820
group: ${{ github.workflow }}-${{ github.ref }}
1921
cancel-in-progress: true
@@ -106,100 +108,22 @@ jobs:
106108
run: |
107109
pixi run autotest-base
108110
109-
- name: Upload failed test output
110-
if: failure()
111-
uses: actions/upload-artifact@v4
112-
with:
113-
name: failed-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}
114-
path: ./autotest/.failed
115-
116-
- name: Print coverage report before upload
111+
- name: Run scheduled tests on MacOS and Linux with all compilers but intel-classic
112+
if: ${{ github.event_name == 'schedule' && (runner.os != 'Windows' || matrix.compiler != 'intel-classic') }}
117113
run: |
118-
pixi run coverage-report
119-
120-
- name: Upload coverage to Codecov
121-
uses: codecov/codecov-action@v5
122-
env:
123-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
124-
with:
125-
file: ./autotest/coverage.xml
126-
127-
pymake-schedule:
128-
name: pymake scheduled
129-
if: github.event_name == 'schedule'
130-
runs-on: matrix.os
131-
strategy:
132-
fail-fast: false
133-
matrix:
134-
include:
135-
# test latest gcc and python
136-
- {os: ubuntu-latest, compiler: gcc, version: 13, shell: bash}
137-
- {os: macos-latest, compiler: gcc, version: 13, shell: bash}
138-
- {os: windows-latest, compiler: gcc, version: 13, shell: pwsh}
139-
# test latest python and intel
140-
- {os: ubuntu-22.04, compiler: intel-classic, version: 2021.7, shell: bash}
141-
- {os: macos-13, compiler: intel-classic, version: 2021.7, shell: bash}
142-
- {os: windows-2022, compiler: intel-classic, version: 2021.7, shell: pwsh}
143-
defaults:
144-
run:
145-
shell: matrix.shell
114+
pixi run autotest-schedule
146115
147-
steps:
148-
- name: Free Disk Space (Ubuntu)
149-
if: runner.os == 'Linux'
150-
uses: jlumbroso/free-disk-space@main
151-
with:
152-
tool-cache: false
153-
android: true
154-
dotnet: true
155-
haskell: true
156-
large-packages: true
157-
docker-images: true
158-
swap-storage: true
159-
160-
- name: Checkout repo
161-
uses: actions/checkout@v5
162-
163-
- uses: maxim-lobanov/setup-xcode@v1
164-
if: runner.os == 'macOS' && matrix.compiler == 'intel-classic'
165-
with:
166-
xcode-version: "14.3.1"
167-
168-
- name: Setup Graphviz on Linux
169-
if: runner.os == 'Linux'
170-
uses: ts-graphviz/setup-graphviz@v2
171-
172-
- name: Setup pixi
173-
uses: prefix-dev/setup-pixi@v0.9.0
174-
with:
175-
pixi-version: v0.42.1
176-
manifest-path: "pixi.toml"
177-
178-
- name: pixi post-install
179-
working-directory: pymake
116+
- name: Run scheduled tests on Windows with intel-classic compiler
117+
if: ${{ github.event_name == 'schedule' && runner.os == 'Windows' && matrix.compiler == 'intel-classic' }}
180118
run: |
181-
pixi run postinstall
182-
183-
- name: Setup ${{ matrix.compiler }} ${{ matrix.version }} on ${{ matrix.os }}
184-
uses: fortran-lang/setup-fortran@v1
185-
with:
186-
compiler: ${{ matrix.compiler }}
187-
version: ${{ matrix.version }}
188-
189-
- name: Run scheduled tests on ${{ matrix.os }} with ${{ matrix.compiler }}
190-
if: runner.os != 'Windows' || matrix.compiler != 'intel-classic'
191-
run: pixi run autotest-schedule
119+
pixi run autotest-schedule --exclude gridgen
192120
193-
- name: Run scheduled tests on ${{ matrix.os }} with ${{ matrix.compiler }}
194-
if: runner.os == 'Windows' && matrix.compiler == 'intel-classic'
195-
run: pixi run autotest-schedule --exclude gridgen
196-
197121
- name: Upload failed test output
198122
if: failure()
199123
uses: actions/upload-artifact@v4
200124
with:
201-
name: failed-schedule-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}
202-
path: autotest/.failed
125+
name: failed-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.version }}
126+
path: ./autotest/.failed
203127

204128
- name: Print coverage report before upload
205129
run: |
@@ -212,4 +136,3 @@ jobs:
212136
with:
213137
file: ./autotest/coverage.xml
214138

215-

pymake/utils/_compiler_switches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ def _set_cflags(target, cc="gcc", argv=True, osname=None, verbose=False):
896896
if cc.startswith("g"):
897897
cflags += ["-lm"]
898898
else:
899-
cflags += ["-DNO_TIMER"]
899+
cflags += ["-DNO_TIMER", "-DCPU86", "-DWINDOWS"]
900900
elif target == "gridgen":
901901
if osname in ("linux", "darwin"):
902902
if cc.startswith("i"):

pymake/utils/_usgs_src_update.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,20 @@ def _update_triangle_files(srcdir, fc, cc, arch, double):
119119
# modify long to long long on windows
120120
if "win32" in sys.platform.lower() and cc in ("icl", "cl"):
121121
src = os.path.join(srcdir, "triangle.c")
122+
updateSource = True
122123
with open(src, "r") as f:
123124
lines = f.readlines()
124-
for idx, line in enumerate(lines):
125-
lines[idx] = line.replace("unsigned long", "unsigned long long")
126-
with open(src, "w") as f:
127125
for line in lines:
128-
f.write(line)
126+
if "unsigned_long" in line:
127+
updateSource = False
128+
break
129+
if updateSource:
130+
for idx, line in enumerate(lines):
131+
lines[idx] = line.replace("unsigned long", "unsigned long long")
132+
if updateSource:
133+
with open(src, "w") as f:
134+
for line in lines:
135+
f.write(line)
129136
return
130137

131138

pymake/utils/usgsprograms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mp7 , 7.2.001 , True , https://water.usgs.gov/water-resources/soft
66
mt3dms , 5.3.0 , True , https://github.com/MODFLOW-ORG/mt3dms/releases/download/2.0/mt3dms-2.0.zip , mt3dms-2.0 , true-binary , True , False , False
77
mt3dusgs , 1.1.0 , True , https://github.com/MODFLOW-ORG/mt3d-usgs/releases/download/1.1.0/mt3dusgs1.1.0.zip , mt3dusgs1.1.0 , src , True , False , False
88
vs2dt , 3.3 , True , https://water.usgs.gov/water-resources/software/VS2DI/vs2dt3_3.zip , vs2dt3_3 , include , True , False , False
9-
triangle , 1.6 , True , https://github.com/MODFLOW-ORG/triangle/releases/download/1.0/triangle-1.0.zip , triangle-1.0 , src , True , False , False
9+
triangle , 1.6 , True , https://github.com/MODFLOW-ORG/triangle/releases/download/latest_build/triangle_source.zip , . , src , True , False , False
1010
gridgen , 1.0.02 , True , https://github.com/MODFLOW-ORG/gridgen/releases/download/1.0.02/gridgen-1.0.02.zip , gridgen-1.0.02 , src , True , False , False
1111
crt , 1.3.1 , True , https://water.usgs.gov/ogw/CRT/CRT_1.3.1.zip , CRT_1.3.1 , SOURCE , True , False , False
1212
sutra , 4.0 , True , https://water.usgs.gov/water-resources/software/sutra/4.0/SUTRA_4_0_0.zip , SutraSuite , SUTRA_4_0/source , True , False , False

0 commit comments

Comments
 (0)