Skip to content

Commit

Permalink
update to ADMB 13.0 (#54)
Browse files Browse the repository at this point in the history
* change to lower warning count

To use after fixing error msgs in ss3

* change workflow from admb 12.3 to 13.0
- requires now compiling admb from source for Mac OS

* fix filename error

* fix workflow for mac (checkout instead of unzip)

* increase timeout limit (cancelled mac build)

* increase timeout limit even further

* switch to newer ubuntu
-hoping to fix "'GLIBC_2.34' not found"

* newer version of r-lib action

* build linux from source
- admb-project/admb#272

* switch run with est action to Windows
- linux build is much slower right now

* fix issues with switch from linux to windows

* Revert "fix issues with switch from linux to windows"

This reverts commit d6f0725415cbb3a7463b68c6ae9f02a981ae0137.

* Revert "switch run with est action to Windows"

This reverts commit 6a6a99676dc4f90541f6cd08e99f0748355e2ea5.

* switch run action to build linux from source

* update more workflows for admb 13.0

* fix ADMB 13.0 build for warnings workflow

* fix admb location for warnings workflow

* attempt fix for warnings build

* another attempt to fix build with warnings

* attempt another fix for warnings build

* add diagnostics to debug failing build

* yet another try

* use revised linux distribution

* fix extra line caused fail

* another try for warnings build

* add display of warnings to console

* fix filter for warnings

* restore simpler linux install

Co-authored-by: Kathryn Doering <[email protected]>
  • Loading branch information
iantaylor-NOAA and k-doering-NOAA authored Sep 9, 2022
1 parent 1cf155e commit ab8dcd9
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 59 deletions.
27 changes: 18 additions & 9 deletions build-ss3-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,27 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@master

- name: Get admb and put in path
- name: Get admb and put in path, linux
run: |
wget https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-linux.zip
sudo unzip admb-12.3-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-12.3/bin/admb
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
wget https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-linux.zip
sudo unzip admb-13.0-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.0/bin/admb
echo "/usr/local/bin/admb-13.0/bin" >> $GITHUB_PATH
- name: Build stock synthesis with warnings
- name: Build stock synthesis with warnings displayed in console
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
/bin/bash ./Make_SS_330_new.sh -a /usr/local/bin/admb-12.3 -b SS330 -w &> warnings.txt
/bin/bash ./Make_SS_330_new.sh -a /usr/local/bin/admb-13.0 -b SS330 -w
- name: Build stock synthesis with warnings again to save to file
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
/bin/bash ./Make_SS_330_new.sh -a /usr/local/bin/admb-13.0 -b SS330 -w &> warnings.txt
# Runs a set of commands using the runners shell
- name: Use R to parse warnings output
run: |
Expand All @@ -39,7 +48,7 @@ jobs:
x = txt,
fixed = TRUE)
txt <- txt[(warn_line+1):length(txt)]
rm_warn_start_lines <- grep(pattern = "/usr/local/bin/admb-12.3", x = txt,
rm_warn_start_lines <- grep(pattern = "/usr/local/bin/admb-13.0", x = txt,
fixed = TRUE)
all_warning_end_lines <- grep(pattern = "^", x = txt, fixed = TRUE)
to_rm <- NULL
Expand All @@ -61,7 +70,7 @@ jobs:
run: |
n_warn <- read.table("n_warn.txt")
n_warn <- as.integer(n_warn[1,1])
if (n_warn > 83) {
if (n_warn > 68) {
stop("Increased number of warnings")
} else {
message("Acceptable number of warnings")
Expand Down
82 changes: 53 additions & 29 deletions build-ss3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,65 @@ jobs:
fail-fast: false
matrix:
config:
- {os: windows-2019}
- {os: macOS-latest}
- {os: windows-latest}
- {os: macos-latest}
- {os: ubuntu-latest}
# Limit run time to 15 min to avoid wasting action minutes.
timeout-minutes: 15
# Limit run time to 90 min to avoid wasting action minutes.
# was set to 15 and then 30 minutes previously, but compiling admb
# on mac took too long
timeout-minutes: 90
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Get admb and put in path, windows
if: matrix.config.os == 'windows-2019'
if: matrix.config.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-windows.zip -OutFile "D:\a\stock-synthesis\stock-synthesis\admb-12.3.zip"
Expand-Archive -LiteralPath "D:\a\stock-synthesis\stock-synthesis\admb-12.3.zip" -DestinationPath "D:\a\stock-synthesis\stock-synthesis\"
echo "D:\a\stock-synthesis\stock-synthesis\admb-12.3\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Invoke-WebRequest -Uri https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-windows.zip -OutFile "D:\a\stock-synthesis\stock-synthesis\admb-13.0.zip"
Expand-Archive -LiteralPath "D:\a\stock-synthesis\stock-synthesis\admb-13.0.zip" -DestinationPath "D:\a\stock-synthesis\stock-synthesis\"
echo "D:\a\stock-synthesis\stock-synthesis\admb-13.0\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Get admb and put in path, mac
if: matrix.config.os == 'macOS-latest'
- name: checkout admb, mac
if: matrix.config.os == 'macos-latest'
uses: actions/checkout@v2
with:
repository: admb-project/admb
path: admb
ref: admb-13.0
- name: clean, mac
if: matrix.config.os == 'macos-latest'
run: cd admb && make clean
- name: see where admb is, mac
if: matrix.config.os == 'macos-latest'
run: |
curl https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-macos.zip -L -o admb-12.3.zip
unzip admb-12.3.zip -d /usr/local/bin
ls /usr/local/bin
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
ls
cd admb && ls
- name: compile admb, mac
if: matrix.config.os == 'macos-latest'
run: |
cd admb && make
- name: see where admb is, mac
if: matrix.config.os == 'macos-latest'
run: |
cd admb && ls -l
- name: put admb in path, mac
if: matrix.config.os == 'macos-latest'
run: |
sudo mv admb /usr/local/bin
sudo chmod 755 /usr/local/bin/admb
echo "/usr/local/bin/admb" >> $GITHUB_PATH
- name: Get admb and put in path, linux
if: matrix.config.os == 'ubuntu-latest'
run: |
wget https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-linux.zip
sudo unzip admb-12.3-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-12.3/bin/admb
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
wget https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-linux.zip
sudo unzip admb-13.0-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.0/bin/admb
echo "/usr/local/bin/admb-13.0/bin" >> $GITHUB_PATH
- name: Set up R
uses: r-lib/actions/setup-r@master
uses: r-lib/actions/setup-r@v2
with:
r-version: 'release'
- name: Fetch tags
Expand All @@ -61,7 +85,7 @@ jobs:
- name: Get the last tag on windows
id: get-latest-tag-win
if: matrix.config.os == 'windows-2019'
if: matrix.config.os == 'windows-latest'
run: |
git tag
$latest_tag = (git describe --abbrev=0 --tags)
Expand All @@ -75,15 +99,15 @@ jobs:

- name: pull the last tag value to use in the Rscript on windows
id: get-version-win
if: matrix.config.os == 'windows-2019'
if: matrix.config.os == 'windows-latest'
run: |
Out-File -InputObject ${{ steps.get-latest-tag-win.outputs.tag }} -FilePath .github/last_tag.txt
Out-File -InputObject ${{ steps.get-latest-tag-win.outputs.tag_commit }} -FilePath .github/last_tag_commit.txt
Out-File -InputObject ${{ steps.get-latest-tag-win.outputs.commit}} -FilePath .github/last_commit.txt
- name: Get the last tag on unix
id: get-latest-tag-unix
if: matrix.config.os == 'macOS-latest' || matrix.config.os == 'ubuntu-latest'
if: matrix.config.os == 'macos-latest' || matrix.config.os == 'ubuntu-latest'
run: |
git tag
latest_tag=$(git describe --abbrev=0 --tags)
Expand All @@ -97,7 +121,7 @@ jobs:

- name: pull the last tag value to use in the Rscript on unix
id: get-version-unix
if: matrix.config.os == 'macOS-latest' || matrix.config.os == 'ubuntu-latest'
if: matrix.config.os == 'macos-latest' || matrix.config.os == 'ubuntu-latest'
run: |
echo "${{ steps.get-latest-tag-unix.outputs.tag }}" > .github/last_tag.txt
echo "${{ steps.get-latest-tag-unix.outputs.tag_commit }}" > .github/last_tag_commit.txt
Expand Down Expand Up @@ -168,14 +192,14 @@ jobs:
shell: Rscript {0}

- name: Build stock synthesis for windows
if: matrix.config.os == 'windows-2019'
if: matrix.config.os == 'windows-latest'
run: |
cd Compile
./Make_SS_safe.bat
./Make_SS_fast.bat
- name: Move exes to a new folder on windows
if: matrix.config.os == 'windows-2019'
if: matrix.config.os == 'windows-latest'
run: |
mkdir SS330
mv Compile/ss.exe SS330/
Expand All @@ -184,7 +208,7 @@ jobs:
mv SS330/ss_opt.exe SS330/ss_opt_win.exe
- name: Build stock synthesis for mac
if: matrix.config.os == 'macOS-latest'
if: matrix.config.os == 'macos-latest'
run: |
rm -rf SS330
rm -rf ss_osx.tar
Expand All @@ -202,13 +226,13 @@ jobs:
/bin/bash ./Make_SS_330_new.sh -b SS330 -o -p
- name: Verify binary on mac
if: matrix.config.os == 'macOS-latest'
if: matrix.config.os == 'macos-latest'
run: |
shasum -a 256 SS330/ss
shasum -a 256 SS330/ss_opt
- name: Delete unneeded files and change exe names on mac
if: matrix.config.os == 'macOS-latest'
if: matrix.config.os == 'macos-latest'
run: |
cd SS330
rm *.obj *.htp *.cpp ss_opt.tpl
Expand Down
12 changes: 6 additions & 6 deletions run-ss3-mcmc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Check mcmc wrosk
# Check mcmc works
name: run-ss3-mcmc

on:
Expand Down Expand Up @@ -26,12 +26,12 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@master

- name: Get admb and put in path
- name: Get admb and put in path, linux
run: |
wget https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-linux.zip
sudo unzip admb-12.3-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-12.3/bin/admb
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
wget https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-linux.zip
sudo unzip admb-13.0-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.0/bin/admb
echo "/usr/local/bin/admb-13.0/bin" >> $GITHUB_PATH
- name: Build stock synthesis
run: |
Expand Down
10 changes: 5 additions & 5 deletions run-ss3-no-est.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@master

- name: Get admb and put in path
- name: Get admb and put in path, linux
run: |
wget https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-linux.zip
sudo unzip admb-12.3-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-12.3/bin/admb
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
wget https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-linux.zip
sudo unzip admb-13.0-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.0/bin/admb
echo "/usr/local/bin/admb-13.0/bin" >> $GITHUB_PATH
- name: Build stock synthesis
run: |
Expand Down
10 changes: 5 additions & 5 deletions run-ss3-with-est.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@master

- name: Get admb and put in path
- name: Get admb and put in path, linux
run: |
wget https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-linux.zip
sudo unzip admb-12.3-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-12.3/bin/admb
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
wget https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-linux.zip
sudo unzip admb-13.0-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.0/bin/admb
echo "/usr/local/bin/admb-13.0/bin" >> $GITHUB_PATH
- name: Build stock synthesis
run: |
Expand Down
10 changes: 5 additions & 5 deletions test-r4ss-with-ss3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
- name: install r4ss
run: Rscript -e 'remotes::install_github("r4ss/r4ss")'

- name: Get admb and put in path
- name: Get admb and put in path, linux
run: |
wget https://github.com/admb-project/admb/releases/download/admb-12.3/admb-12.3-linux.zip
sudo unzip admb-12.3-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-12.3/bin/admb
echo "/usr/local/bin/admb-12.3/bin" >> $GITHUB_PATH
wget https://github.com/admb-project/admb/releases/download/admb-13.0/admb-13.0-linux.zip
sudo unzip admb-13.0-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.0/bin/admb
echo "/usr/local/bin/admb-13.0/bin" >> $GITHUB_PATH
- name: Build stock synthesis
run: |
Expand Down

0 comments on commit ab8dcd9

Please sign in to comment.