Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions .github/workflows/build-ss3-warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
RSPM: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"

steps:
- name: Checkout ss repo
- name: Checkout ss3 repo
uses: actions/checkout@v3

- name: Update Ubuntu packages
Expand All @@ -35,45 +35,50 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@v2

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

- name: Build stock synthesis with warnings displayed in console
- name: Build stock synthesis with warnings displayed in console using admb docker image
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
/bin/bash ./Make_SS_330_new.sh -a /usr/local/bin/admb-13.1 -b SS330 -w
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -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.1 -b SS330 -w &> warnings.txt
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -w &> warnings.txt

# Runs a set of commands using the runners shell
- name: Use R to parse warnings output
run: |
txt <- readLines("warnings.txt", encoding = "UTF-8" )
warn_line <- grep(pattern = "compiling a second time to get warnings", x = txt, fixed = TRUE)
txt <- txt[(warn_line+1):length(txt)]
rm_warn_start_lines <- grep(pattern = "/usr/local/bin/admb-13.1", x = txt, fixed = TRUE)
warn_line <- grep(pattern = "g++ -c -std=c++17 -O3 -Wall -Wextra -D_USE_MATH_DEFINES -DUSE_ADMB_CONTRIBS", x = txt, fixed = TRUE)
end_warn_line <- grep(pattern = "*** Linking: ss.obj ", x = txt, fixed = TRUE)
txt <- txt[(warn_line+2):(end_warn_line-1)]
rm_warn_start_lines <- grep(pattern = "/usr/local/admb/include/admodel.h", x = txt, fixed = TRUE)
all_warning_end_lines <- grep(pattern = "^", x = txt, fixed = TRUE)
to_rm <- NULL
for (l in rm_warn_start_lines) {
tmp_end_line <- min(all_warning_end_lines[all_warning_end_lines > l])
to_rm <- c(to_rm, l:tmp_end_line)
}
txt <- txt[-to_rm]
n_errors <- length(grep(pattern = "^", x = txt, fixed = TRUE))
n_errors <- length(grep(pattern = "^", x = txt))
message("There are ", n_errors, " warning messages related to SS.")
write.table(n_errors, "n_warn.txt")
writeLines(txt, "warnings_ss.txt")
# warn_line <- grep(pattern = "compiling a second time to get warnings", x = txt, fixed = TRUE)
# txt <- txt[(warn_line+1):length(txt)]
shell: Rscript {0}

- name: Print warnings
Expand Down Expand Up @@ -102,4 +107,4 @@ jobs:
uses: actions/upload-artifact@main
with:
name: 'warnings_ss.txt'
path: warnings_ss.txt
path: warnings_ss.txt
163 changes: 64 additions & 99 deletions .github/workflows/build-ss3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,69 +34,49 @@ jobs:
if: matrix.config.os == 'ubuntu-latest'
run: sudo apt-get update

- name: Build stock synthesis for linux with p flag and docker
if: matrix.config.os == 'ubuntu-latest'
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -p
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o -p

- name: Build stock synthesis for mac with docker
if: matrix.config.os == 'macos-latest'
run: |
brew install docker
colima start
docker pull johnoel/admb:linux

rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o

colima stop

- name: checkout admb, mac
if: matrix.config.os == 'macos-latest'
uses: actions/checkout@v3
with:
repository: admb-project/admb
path: admb
ref: admb-13.1
- 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: |
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, windows
# if: matrix.config.os == 'windows-latest'
# run: |
# Invoke-WebRequest -Uri https://github.com/admb-project/admb/releases/download/admb-13.1/admb-13.1b-windows.zip -OutFile "D:\a\ss3-source-code\ss3-source-code\admb-13.1.zip"
# Expand-Archive -LiteralPath "D:\a\ss3-source-code\ss3-source-code\admb-13.1.zip" -DestinationPath "D:\a\ss3-source-code\ss3-source-code\"
# echo "D:\a\ss3-source-code\ss3-source-code\admb-13.1\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# - name: checkout admb, mac
# if: matrix.config.os == 'macos-latest'
# uses: actions/checkout@v3
# with:
# repository: admb-project/admb
# path: admb
# ref: admb-13.1
# - 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: |
# 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-13.1/admb-13.1-linux.zip
sudo unzip admb-13.1-linux.zip -d /usr/local/bin
sudo chmod 755 /usr/local/bin/admb-13.1/bin/admb
echo "/usr/local/bin/admb-13.1/bin" >> $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-13.1/admb-13.1-linux.zip
# sudo unzip admb-13.1-linux.zip -d /usr/local/bin
# sudo chmod 755 /usr/local/bin/admb-13.1/bin/admb
# echo "/usr/local/bin/admb-13.1/bin" >> $GITHUB_PATH

- name: Set up R
uses: r-lib/actions/setup-r@v2
Expand Down Expand Up @@ -214,28 +194,7 @@ jobs:
writeLines(ver_info, "SS_versioninfo_330opt.tpl")
shell: Rscript {0}

- name: Build stock synthesis for windows with docker
if: matrix.config.os == 'windows-latest'
run: |
pushd Compile
./Make_SS_safe.bat
./Make_SS_fast.bat
popd

- name: Get admb and put in path, windows
if: matrix.config.os == 'windows-latest'
run: |
Invoke-WebRequest -Uri https://github.com/admb-project/admb/releases/download/admb-13.1/admb-13.1b-windows.zip -OutFile "D:\a\ss3-source-code\ss3-source-code\admb-13.1.zip"
Expand-Archive -LiteralPath "D:\a\ss3-source-code\ss3-source-code\admb-13.1.zip" -DestinationPath "D:\a\ss3-source-code\ss3-source-code\"
echo "D:\a\ss3-source-code\ss3-source-code\admb-13.1\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: get info on gcc version and path
if: matrix.config.os == 'windows-latest'
run: |
g++ -v
echo $env:GITHUB_PATH

- name: Build stock synthesis for windows
- name: Build stock synthesis for windows with admb docker image
if: matrix.config.os == 'windows-latest'
run: |
cd Compile
Expand All @@ -252,26 +211,22 @@ jobs:
mv Compile/ss_opt.exe SS330/
mv SS330/ss.exe SS330/ss3_win.exe
mv SS330/ss_opt.exe SS330/ss3_opt_win.exe

- name: Build stock synthesis for mac
- name: Build stock synthesis for mac with admb docker image
if: matrix.config.os == 'macos-latest'
run: |
brew install docker
colima start
docker pull johnoel/admb:linux

rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh -b SS330
/bin/bash ./Make_SS_330_new.sh -b SS330 -o

- name: Build stock synthesis for linux with p flag
if: matrix.config.os == 'ubuntu-latest'
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh -b SS330 -p
/bin/bash ./Make_SS_330_new.sh -b SS330 -o -p
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o

colima stop

- name: Verify binary on mac
if: matrix.config.os == 'macos-latest'
Expand All @@ -286,7 +241,17 @@ jobs:
rm *.obj *.htp *.cpp ss_opt.tpl
mv ss ss3_osx
mv ss_opt ss3_opt_osx


- name: Build stock synthesis for linux with p flag and admb docker image
if: matrix.config.os == 'ubuntu-latest'
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -p
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330 -o -p

- name: Verify binary on linux
if: matrix.config.os == 'ubuntu-latest'
run: |
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/reference_files/warnings_ss_ref.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
In file included from ss.cpp:7:
In file included from ss.cpp:7:
ss.cpp: In member function 'void model_parameters::evaluate_the_objective_function()':
ss.cpp:27544:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
27544 | for (i = 1; i <= Svy_N_fleet(f); i++)
| ^~~
ss.cpp:27571:11: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
27571 | surv_like(f) = sum(Svy_like_I(f));
| ^~~~~~~~~
28 changes: 18 additions & 10 deletions .github/workflows/run-ss3-bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,34 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@v2

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

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

# - name: Build stock synthesis
# run: |
# rm -rf SS330
# mkdir SS330
# /bin/bash ./Make_SS_330_new.sh -b SS330

- name: Build stock synthesis with admb docker image
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
/bin/bash ./Make_SS_330_new.sh -b SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330

- name: move exes, scripts to needed locations
run: |
mv test-models-repo/models test-models-repo/model_runs
mv SS330/ss test-models-repo/model_runs/Simple_with_DM_sizefreq/ss3

- name: change permissions on ss3 exes
run: chmod a+x test-models-repo/model_runs/Simple_with_DM_sizefreq/ss3
run: sudo chmod a+x test-models-repo/model_runs/Simple_with_DM_sizefreq/ss3

- name: download R packages
run: Rscript -e 'install.packages(c("remotes", "purrr", "arsenal", "utils"))'
Expand Down
26 changes: 17 additions & 9 deletions .github/workflows/run-ss3-mcmc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,26 @@ jobs:
- name: setup R
uses: r-lib/actions/setup-r@v2

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

# - name: Build stock synthesis
# run: |
# rm -rf SS330
# mkdir SS330
# /bin/bash ./Make_SS_330_new.sh -b SS330

- name: Build stock synthesis
- name: Build stock synthesis with admb docker image
run: |
rm -rf SS330
rm -rf ss_osx.tar
mkdir SS330
/bin/bash ./Make_SS_330_new.sh -b SS330
chmod 777 SS330
/bin/bash ./Make_SS_330_new.sh --admb docker -b SS330

- name: move exes, scripts to needed locations
run: |
Expand All @@ -63,7 +71,7 @@ jobs:
ls

- name: change permissions on ss exe
run: chmod a+x ss3
run: sudo chmod a+x ss3

- name: run models without estimation
run: |
Expand Down
Loading