Skip to content

Commit 8a640a5

Browse files
committed
Add fortran language support
1 parent 5960658 commit 8a640a5

File tree

179 files changed

+17817
-9
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+17817
-9
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ jobs:
5353
# - SWIGLANG: d
5454
# VER: '2.066.0'
5555
# os: ubuntu-18.04 # This dlang version doesn't work under 20.04.
56+
- SWIGLANG: fortran
57+
CPPSTD: c++11
5658
- SWIGLANG: go
5759
VER: '1.6'
5860
CSTD: gnu11
@@ -181,6 +183,8 @@ jobs:
181183
# c++11 testing
182184
- SWIGLANG: csharp
183185
CPPSTD: c++11
186+
- SWIGLANG: fortran
187+
CPPSTD: c++11
184188
- SWIGLANG: go
185189
VER: '1.17'
186190
CPPSTD: c++11
@@ -248,6 +252,10 @@ jobs:
248252
- SWIGLANG: csharp
249253
CPPSTD: c++17
250254
GCC: 11
255+
- SWIGLANG: fortran
256+
CPPSTD: c++17
257+
FCSTD: f2003
258+
GCC: 11
251259
- SWIGLANG: go
252260
VER: '1.17'
253261
CPPSTD: c++17
@@ -313,6 +321,7 @@ jobs:
313321
CSTD: ${{ matrix.CSTD }}
314322
CPPSTD: ${{ matrix.CPPSTD }}
315323
CPPFLAGS: ${{ matrix.CPPFLAGS }}
324+
FCSTD: ${{ matrix.FCSTD }}
316325

317326
steps:
318327
- name: Checkout
@@ -365,19 +374,23 @@ jobs:
365374
elif test -n "$GCC"; then
366375
CC="gcc-$GCC"
367376
CXX="g++-$GCC"
377+
FC="gfortran-$GCC"
368378
else
369379
CC="gcc"
370380
CXX="g++"
381+
FC="gfortran"
371382
fi
372383
373-
export CC CXX
384+
export CC CXX FC
374385
375386
echo CC="$CC" >> $GITHUB_ENV
376387
echo CXX="$CXX" >> $GITHUB_ENV
388+
echo FC="$FC" >> $GITHUB_ENV
377389
378390
ls -la $(which $CC) $(which $CXX)
379391
$CC --version
380392
$CXX --version
393+
$FC --version
381394
382395
- name: Configure
383396
run: |
@@ -395,6 +408,7 @@ jobs:
395408
if test -z "$CPPSTD"; then CONFIGOPTS+=("--disable-cpp11-testing"); fi
396409
if test -n "$CPPSTD"; then CONFIGOPTS+=("CXXFLAGS=-std=$CPPSTD $CXXFLAGS"); fi
397410
if test -n "$CSTD"; then CONFIGOPTS+=("CFLAGS=-std=$CSTD $CFLAGS"); fi
411+
if test -n "$FCSTD"; then CONFIGOPTS+=("FCFLAGS=-std=$FCSTD $FCFLAGS"); fi
398412
if test -n "$SWIGLANG"; then CONFIGOPTS+=(--without-alllang --with-$WITHLANG); fi
399413
echo "${CONFIGOPTS[@]}"
400414
./autogen.sh && mkdir -p build/build && cd build/build && ../../configure "${CONFIGOPTS[@]}"
@@ -432,10 +446,11 @@ jobs:
432446
# Stricter compile flags for examples. Various headers and SWIG generated code prevents full use of -pedantic.
433447
cflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cflags --std=$CSTD --compiler=$CC)
434448
cxxflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --cxxflags --std=$CPPSTD --compiler=$CC)
449+
fcflags=$($GITHUB_WORKSPACE/Tools/testflags.py --language $SWIGLANG --fcflags --std=$FCSTD --compiler=$FC)
435450
make check-$SWIGLANG-version
436451
make check-$SWIGLANG-enabled
437-
make $SWIGJOBS check-$SWIGLANG-examples CFLAGS="$cflags" CXXFLAGS="$cxxflags"
438-
make $SWIGJOBS check-$SWIGLANG-test-suite CFLAGS="$cflags" CXXFLAGS="$cxxflags"
452+
make $SWIGJOBS check-$SWIGLANG-examples CFLAGS="$cflags" CXXFLAGS="$cxxflags" FCFLAGS="$fcflags"
453+
make $SWIGJOBS check-$SWIGLANG-test-suite CFLAGS="$cflags" CXXFLAGS="$cxxflags" FCFLAGS="$fcflags"
439454
fi
440455
441456
- name: Install

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ Examples/d/**/example.d
133133
Examples/d/**/example_im.d
134134
Examples/d/**/runme
135135

136+
# Fortran
137+
*.mod
138+
Examples/test-suite/fortran/*.f90
139+
!Examples/test-suite/fortran/*runme.F90
140+
Examples/fortran/*/*.f90
141+
!Examples/fortran/*/*runme.f90
142+
!Examples/fortran/*/*runme.F90
143+
136144
# Go
137145
*.[5689]
138146
*_gc.c

COPYRIGHT

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Copyright (c) 1995-1998 The University of Utah and the Regents of the University
99
Portions also copyrighted by:
1010
Network Applied Communication Laboratory, Inc
1111
Information-technology Promotion Agency, Japan
12+
UT-Battelle, LLC
1213

1314
Active SWIG Developers:
1415
William Fulton ([email protected]) (SWIG core, Java, C#, Windows, Cygwin)
@@ -20,6 +21,7 @@ Active SWIG Developers:
2021
Neha Narang ([email protected]) (Javascript)
2122
Simon Marchetto ([email protected]) (Scilab)
2223
Zackery Spytz ([email protected]) (OCaml, SWIG core)
24+
Seth Johnson ([email protected]) (Fortran)
2325

2426
Past SWIG developers and major contributors include:
2527
Dave Beazley ([email protected]) (SWIG core, Python, Tcl, Perl)

0 commit comments

Comments
 (0)