-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/AWehrhahn/SMElib
- Loading branch information
Showing
10 changed files
with
369 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: 'Delete old artifacts' | ||
on: [push] | ||
|
||
|
||
jobs: | ||
delete-artifacts: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: kolpav/purge-artifacts-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
expire-in: 0 # Setting this to 0 will delete all artifacts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,194 @@ | ||
name: make | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
env: | ||
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
create_release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: GitHub Tag | ||
id: tag_release | ||
# You may pin to the exact commit or the version. | ||
# uses: mathieudutour/github-tag-action@1bab3ab0712cafa42b54c512453487b89bb06504 | ||
uses: mathieudutour/github-tag-action@v5 | ||
with: | ||
# Required for permission to tag the repo. | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
# Which type of bump to use when none explicitly provided (default: `patch`). | ||
# default_bump: # optional, default is patch | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ steps.tag_release.outputs.new_tag }} | ||
release_name: Release ${{ steps.tag_release.outputs.new_tag }} | ||
draft: false | ||
prerelease: false | ||
|
||
manylinux-build: | ||
needs: [create_release] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- name: manylinux2010-gfortran | ||
compiler: gfortran | ||
container: quay.io/pypa/manylinux2010_x86_64 | ||
- name: manylinux2010-f2c | ||
compiler: f2c | ||
container: quay.io/pypa/manylinux2010_x86_64 | ||
|
||
container: ${{ matrix.container }} | ||
steps: | ||
# We need to install packages first, because the checkout needs gcc already | ||
- run: yum install -y gcc-gfortran f2c cmake autoconf automake libtool | ||
- run: git clone https://github.com/AWehrhahn/SMElib . | ||
- name: Replace Makefile | ||
if: matrix.compiler == 'f2c' | ||
run: rm Makefile.am && mv Makefile_f2c.am Makefile.am | ||
- name: Run F2C | ||
if: matrix.compiler == 'f2c' | ||
run: f2c -w -a -C++ -Nn1604 -Nq1200 -dsrc/eos/ src/eos/*.f & f2c -w -a -C++ -dsrc/sme/ src/sme/*.f | ||
- run: ./bootstrap && ./configure --prefix=$PWD | ||
- run: make install | ||
- run: zip -r ${{ matrix.name }} lib share | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./${{ matrix.name }}.zip | ||
asset_name: ${{ matrix.name }}.zip | ||
asset_content_type: application/zip | ||
|
||
build: | ||
needs: create_release | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- name: ubuntu-gfortran | ||
runs_on: ubuntu-latest | ||
packages: gfortran | ||
outputs: lib share | ||
- name: ubuntu-f2c | ||
runs_on: ubuntu-latest | ||
packages: f2c | ||
outputs: lib share | ||
- name: windows-gfortran | ||
runs_on: ubuntu-latest | ||
packages: gfortran mingw-w64 mingw-w64-tools mingw-w64-common gfortran-mingw-w64 gfortran-mingw-w64-x86-64 gcc-mingw-w64 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-x86-64 | ||
cxx: x86_64-w64-mingw32-gcc | ||
f77: x86_64-w64-mingw32-gfortran | ||
config_flags: --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 | ||
outputs: bin share | ||
# F2C doesn't work for Windows, use gfortran instead | ||
# will figure this out when possible | ||
# - name: windows-f2c | ||
# runs_on: ubuntu-latest | ||
# packages: f2c mingw-w64 mingw-w64-tools mingw-w64-common gcc-mingw-w64 gcc-mingw-w64-x86-64 g++-mingw-w64 g++-mingw-w64-x86-64 | ||
# cxx: x86_64-w64-mingw32-gcc | ||
# config_flags: --build=x86_64-pc-linux-gnu --host=x86_64-w64-mingw32 | ||
# outputs: bin share | ||
- name: macos-gfortran | ||
runs_on: macos-latest | ||
packages: automake libtool | ||
cxx: gcc-9 | ||
f77: gfortran-9 | ||
outputs: lib share | ||
- name: macos-f2c | ||
runs_on: macos-latest | ||
taps: FranklinChen/tap | ||
packages: automake libtool | ||
cxx: gcc-9 | ||
outputs: lib share | ||
|
||
# The CMake configure and build commands are platform agnostic and should work equally | ||
# well on Windows or Mac. You can convert this to a matrix build if you need | ||
# cross-platform coverage. | ||
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
runs-on: ${{ matrix.runs_on }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install packages | ||
if: matrix.runs_on == 'ubuntu-latest' | ||
run: sudo apt-get install -y ${{ matrix.packages }} | ||
|
||
- name: Install packages | ||
if: matrix.runs_on == 'macos-latest' | ||
run: brew tap ${{ matrix.taps }} && brew install ${{ matrix.packages }} | ||
|
||
- name: Install F2C | ||
if: matrix.name == 'macos-f2c' | ||
run: brew install --verbose --HEAD franklinchen/tap/f2c | ||
|
||
- name: Run F2C | ||
if: matrix.name == 'ubuntu-f2c' || matrix.name == 'windows-f2c' || matrix.name == 'macos-f2c' | ||
run: f2c -w -a -C++ -Nn1604 -Nq1200 -dsrc/eos/ src/eos/*.f & f2c -w -a -C++ -dsrc/sme/ src/sme/*.f | ||
|
||
- name: Replace Makefile.am | ||
if: matrix.name == 'ubuntu-f2c' || matrix.name == 'windows-f2c' | ||
run: rm Makefile.am && mv Makefile_f2c.am Makefile.am | ||
|
||
- name: Replace Makefile.am | ||
if: matrix.name == 'macos-f2c' | ||
run: rm Makefile.am && mv Makefile_mac.am Makefile.am | ||
|
||
- name: Copy F2C headers | ||
if: matrix.name == 'windows-f2c' | ||
run: cp /usr/include/f2c.h src/eos/ & cp /usr/include/f2c.h src/sme/ | ||
|
||
- name: Run Bootstrap and Configure | ||
env: | ||
CXX: ${{ matrix.cxx }} | ||
F77: ${{ matrix.f77 }} | ||
run: ./bootstrap && ./configure --prefix=$PWD ${{ matrix.config_flags }} | ||
|
||
- name: Install | ||
env: | ||
CXX: ${{ matrix.cxx }} | ||
F77: ${{ matrix.f77 }} | ||
run: make install | ||
|
||
- name: Zip data # This would actually build your project, using zip for an example artifact | ||
run: zip -r ${{ matrix.name }} ${{ matrix.outputs }} | ||
|
||
- name: Archive compiled library | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: library | ||
path: ${{ matrix.name }}.zip | ||
|
||
- name: Prepare Test Environment | ||
if: matrix.name != 'windows-gfortran' && matrix.name != 'windows-f2c' | ||
run: pip3 install -r test/requirements.txt | ||
|
||
- name: Test Library | ||
if: matrix.name != 'windows-gfortran' && matrix.name != 'windows-f2c' | ||
run: python3 -m pytest | ||
|
||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | ||
asset_path: ./${{ matrix.name }}.zip | ||
asset_name: ${{ matrix.name }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
AUTOMAKE_OPTIONS = foreign | ||
|
||
ACLOCAL_AMFLAGS = -I m4 | ||
|
||
lib_LTLIBRARIES = libsme.la | ||
libsme_la_SOURCES = \ | ||
src/sme/platform.h \ | ||
src/sme/sme_synth_faster.cpp \ | ||
src/eos/eos.c \ | ||
src/eos/eos_eqns.c \ | ||
src/eos/eos_math_special.c \ | ||
src/eos/kp_q_spln.c \ | ||
src/sme/hlinop.c \ | ||
src/sme/hlinprof.c | ||
libsme_la_LDFLAGS = -fPIC -version-info 5:22:0 -shared -no-undefined | ||
libsme_la_CPPFLAGS = -fPIC -shared | ||
libsme_la_LIBADD = -lc -l:libf2c.a -lm -lstdc++ | ||
|
||
dist_pkgdata_DATA = src/data/bpo_self.grid.INTEL \ | ||
src/data/Fe1_Bautista2017.dat.INTEL \ | ||
src/data/NH_Stancil2018.dat.INTEL \ | ||
src/data/stehle_long.dat.INTEL \ | ||
src/data/vcsbalmer.dat | ||
|
||
BUILT_SOURCES = src/sme/platform.h old_link | ||
|
||
CLEANFILES = src/sme/platform.h | ||
|
||
PLATFORM = @TARGET@ | ||
MACHINE = @TARGET_CPU@ | ||
BITS = 64 | ||
SHL_EXT = "$(PLATFORM).$(MACHINE).$(BITS)" | ||
|
||
DATA_DIR = @datadir@/libsme/ | ||
|
||
src/sme/platform.h: | ||
echo '#define PLATFORM "$(PLATFORM)"' > src/sme/platform.h | ||
echo '#define DATA_DIR "$(DATA_DIR)"' >> src/sme/platform.h | ||
|
||
old_link: libsme.la | ||
$(MKDIR_P) $(@OUTPUT_DIR@) && cd $(@OUTPUT_DIR@) && $(LN_S) -f libsme@EXTENSION@ sme_synth.so.$(SHL_EXT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
AUTOMAKE_OPTIONS = foreign | ||
|
||
ACLOCAL_AMFLAGS = -I m4 | ||
|
||
lib_LTLIBRARIES = libsme.la | ||
libsme_la_SOURCES = \ | ||
src/sme/platform.h \ | ||
src/sme/sme_synth_faster.cpp \ | ||
src/eos/eos.c \ | ||
src/eos/eos_eqns.c \ | ||
src/eos/eos_math_special.c \ | ||
src/eos/kp_q_spln.c \ | ||
src/sme/hlinop.c \ | ||
src/sme/hlinprof.c | ||
libsme_la_LDFLAGS = -fPIC -version-info 5:22:0 -shared -no-undefined | ||
libsme_la_CPPFLAGS = -fPIC -shared | ||
# Here we assume that f2c has been installed using homebrew, since the automatic detection seems to fail... | ||
libsme_la_LIBADD = -lc /usr/local/Cellar/f2c/HEAD/lib/libf2c.a -lm -lstdc++ | ||
|
||
dist_pkgdata_DATA = src/data/bpo_self.grid.INTEL \ | ||
src/data/Fe1_Bautista2017.dat.INTEL \ | ||
src/data/NH_Stancil2018.dat.INTEL \ | ||
src/data/stehle_long.dat.INTEL \ | ||
src/data/vcsbalmer.dat | ||
|
||
BUILT_SOURCES = src/sme/platform.h old_link | ||
|
||
CLEANFILES = src/sme/platform.h | ||
|
||
PLATFORM = @TARGET@ | ||
MACHINE = @TARGET_CPU@ | ||
BITS = 64 | ||
SHL_EXT = "$(PLATFORM).$(MACHINE).$(BITS)" | ||
|
||
DATA_DIR = @datadir@/libsme/ | ||
|
||
src/sme/platform.h: | ||
echo '#define PLATFORM "$(PLATFORM)"' > src/sme/platform.h | ||
echo '#define DATA_DIR "$(DATA_DIR)"' >> src/sme/platform.h | ||
|
||
old_link: libsme.la | ||
$(MKDIR_P) $(@OUTPUT_DIR@) && cd $(@OUTPUT_DIR@) && $(LN_S) -f libsme@EXTENSION@ sme_synth.so.$(SHL_EXT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.