Closed JenM1 closed 4 years ago
I wonder if you are using the wrong compiler? Please run where("g++")
in the console and report back what it says.
Can you run other TMB models? Does TMB::run_example('simple')
work?
I should have said this: TMB::runExample(all=TRUE, clean=TRUE)
that will run all examples after cleaning to force a recompilation of all .cpp files.
Hi Cole,
I get a bunch of warnings.
Warning messages: 1: In file.remove(dynlib(name)) : cannot remove file 'ar1xar1.so', reason 'No such file or directory' 2: In file.remove(paste0(name, ".o")) : cannot remove file 'ar1xar1.o', reason 'No such file or directory' 3: In file.remove(dynlib(name)) : cannot remove file 'linreg_parallel.so', reason 'No such file or directory' 4: In file.remove(paste0(name, ".o")) : cannot remove file 'linreg_parallel.o', reason 'No such file or directory' 5: In file.remove(dynlib(name)) : cannot remove file 'randomregression.so', reason 'No such file or directory' 6: In file.remove(paste0(name, ".o")) : cannot remove file 'randomregression.o', reason 'No such file or directory' 7: In file.remove(paste0(name, ".o")) : cannot remove file 'simple.o', reason 'No such file or directory'
Thanks, Jen
On Mon, Feb 10, 2020 at 10:26 AM Cole Monnahan notifications@github.com wrote:
I should have said this: TMB::runExample(all=TRUE, clean=TRUE) that will run all examples after cleaning to force a recompilation of all .cpp files.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AJMKBSV3QPV5A6EBGZQYVCTRCGS6XA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELJ5GEQ#issuecomment-584307474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMKBSRWHPDGGQD7NUTFPUTRCGS6XANCNFSM4KSTYRJA .
Hi,
Which package it the where function in? I installed pryr and this is what I get.
where("g++") Error: Can't find g++
On Mon, Feb 10, 2020 at 10:40 AM Jen Marsh jennifer.m.marsh@gmail.com wrote:
Hi Cole,
I get a bunch of warnings.
Warning messages: 1: In file.remove(dynlib(name)) : cannot remove file 'ar1xar1.so', reason 'No such file or directory' 2: In file.remove(paste0(name, ".o")) : cannot remove file 'ar1xar1.o', reason 'No such file or directory' 3: In file.remove(dynlib(name)) : cannot remove file 'linreg_parallel.so', reason 'No such file or directory' 4: In file.remove(paste0(name, ".o")) : cannot remove file 'linreg_parallel.o', reason 'No such file or directory' 5: In file.remove(dynlib(name)) : cannot remove file 'randomregression.so', reason 'No such file or directory' 6: In file.remove(paste0(name, ".o")) : cannot remove file 'randomregression.o', reason 'No such file or directory' 7: In file.remove(paste0(name, ".o")) : cannot remove file 'simple.o', reason 'No such file or directory'
Thanks, Jen
On Mon, Feb 10, 2020 at 10:26 AM Cole Monnahan notifications@github.com wrote:
I should have said this: TMB::runExample(all=TRUE, clean=TRUE) that will run all examples after cleaning to force a recompilation of all .cpp files.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AJMKBSV3QPV5A6EBGZQYVCTRCGS6XA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELJ5GEQ#issuecomment-584307474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMKBSRWHPDGGQD7NUTFPUTRCGS6XANCNFSM4KSTYRJA .
You gotta wrap it in a system call, at least on Windows:
system('where g++') C:\Rtools\mingw_64\bin\g++.exe
it just asks which file is used to compile the model.
Those warnings are fine. It seems like everything is compiling fine except for VAST then. VAST must be using an option that the other models aren't. I'm at a bit of a loss, this isn't really my speciality. But at least we know TMB is working on your machine. Are you on a Mac? There's a couple solved issues with VAST:
https://github.com/James-Thorson-NOAA/VAST/issues/182 https://github.com/James-Thorson-NOAA/VAST/issues/140
Please have a look and try that maybe?
On Mon, Feb 10, 2020 at 11:56 AM JenM1 notifications@github.com wrote:
Hi,
Which package it the where function in? I installed pryr and this is what I get.
where("g++") Error: Can't find g++
On Mon, Feb 10, 2020 at 10:40 AM Jen Marsh jennifer.m.marsh@gmail.com wrote:
Hi Cole,
I get a bunch of warnings.
Warning messages: 1: In file.remove(dynlib(name)) : cannot remove file 'ar1xar1.so', reason 'No such file or directory' 2: In file.remove(paste0(name, ".o")) : cannot remove file 'ar1xar1.o', reason 'No such file or directory' 3: In file.remove(dynlib(name)) : cannot remove file 'linreg_parallel.so', reason 'No such file or directory' 4: In file.remove(paste0(name, ".o")) : cannot remove file 'linreg_parallel.o', reason 'No such file or directory' 5: In file.remove(dynlib(name)) : cannot remove file 'randomregression.so', reason 'No such file or directory' 6: In file.remove(paste0(name, ".o")) : cannot remove file 'randomregression.o', reason 'No such file or directory' 7: In file.remove(paste0(name, ".o")) : cannot remove file 'simple.o', reason 'No such file or directory'
Thanks, Jen
On Mon, Feb 10, 2020 at 10:26 AM Cole Monnahan <notifications@github.com
wrote:
I should have said this: TMB::runExample(all=TRUE, clean=TRUE) that will run all examples after cleaning to force a recompilation of all .cpp files.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AJMKBSV3QPV5A6EBGZQYVCTRCGS6XA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELJ5GEQ#issuecomment-584307474 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJMKBSRWHPDGGQD7NUTFPUTRCGS6XANCNFSM4KSTYRJA
.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=ABEVC3W7ELCRKL7LQKVQ52TRCGWGVA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKAIRY#issuecomment-584320071, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEVC3RYJAG5SW6BW32RKA3RCGWGVANCNFSM4KSTYRJA .
Hi,
Yes, I am on a Mac. I'll try your suggestions.
Thanks, Jen
On Mon, Feb 10, 2020 at 11:06 AM Cole Monnahan notifications@github.com wrote:
You gotta wrap it in a system call, at least on Windows:
system('where g++') C:\Rtools\mingw_64\bin\g++.exe
it just asks which file is used to compile the model.
Those warnings are fine. It seems like everything is compiling fine except for VAST then. VAST must be using an option that the other models aren't. I'm at a bit of a loss, this isn't really my speciality. But at least we know TMB is working on your machine. Are you on a Mac? There's a couple solved issues with VAST:
https://github.com/James-Thorson-NOAA/VAST/issues/182 https://github.com/James-Thorson-NOAA/VAST/issues/140
Please have a look and try that maybe?
On Mon, Feb 10, 2020 at 11:56 AM JenM1 notifications@github.com wrote:
Hi,
Which package it the where function in? I installed pryr and this is what I get.
where("g++") Error: Can't find g++
On Mon, Feb 10, 2020 at 10:40 AM Jen Marsh jennifer.m.marsh@gmail.com wrote:
Hi Cole,
I get a bunch of warnings.
Warning messages: 1: In file.remove(dynlib(name)) : cannot remove file 'ar1xar1.so', reason 'No such file or directory' 2: In file.remove(paste0(name, ".o")) : cannot remove file 'ar1xar1.o', reason 'No such file or directory' 3: In file.remove(dynlib(name)) : cannot remove file 'linreg_parallel.so', reason 'No such file or directory' 4: In file.remove(paste0(name, ".o")) : cannot remove file 'linreg_parallel.o', reason 'No such file or directory' 5: In file.remove(dynlib(name)) : cannot remove file 'randomregression.so', reason 'No such file or directory' 6: In file.remove(paste0(name, ".o")) : cannot remove file 'randomregression.o', reason 'No such file or directory' 7: In file.remove(paste0(name, ".o")) : cannot remove file 'simple.o', reason 'No such file or directory'
Thanks, Jen
On Mon, Feb 10, 2020 at 10:26 AM Cole Monnahan < notifications@github.com
wrote:
I should have said this: TMB::runExample(all=TRUE, clean=TRUE) that will run all examples after cleaning to force a recompilation of all .cpp files.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <
,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AJMKBSRWHPDGGQD7NUTFPUTRCGS6XANCNFSM4KSTYRJA
.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=ABEVC3W7ELCRKL7LQKVQ52TRCGWGVA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKAIRY#issuecomment-584320071 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABEVC3RYJAG5SW6BW32RKA3RCGWGVANCNFSM4KSTYRJA
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AJMKBSQGXHCBCDC3NUK5DDLRCGXVLA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKCHNY#issuecomment-584328119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMKBSXQHIN7H7Z7JIYV4ADRCGXVLANCNFSM4KSTYRJA .
Hi,
I think it's working, well fit_model() has been spitting out numbers for the last 10 minutes... I added what Sarah Gaichas suggested to ~/.R/Markvars in this thread https://github.com/kaskr/adcomp/issues/297 I did substitute "clang7" for "clang6".
Thanks for your help. Jen
On Mon, Feb 10, 2020 at 11:11 AM Jen Marsh jennifer.m.marsh@gmail.com wrote:
Hi,
Yes, I am on a Mac. I'll try your suggestions.
Thanks, Jen
On Mon, Feb 10, 2020 at 11:06 AM Cole Monnahan notifications@github.com wrote:
You gotta wrap it in a system call, at least on Windows:
system('where g++') C:\Rtools\mingw_64\bin\g++.exe
it just asks which file is used to compile the model.
Those warnings are fine. It seems like everything is compiling fine except for VAST then. VAST must be using an option that the other models aren't. I'm at a bit of a loss, this isn't really my speciality. But at least we know TMB is working on your machine. Are you on a Mac? There's a couple solved issues with VAST:
https://github.com/James-Thorson-NOAA/VAST/issues/182 https://github.com/James-Thorson-NOAA/VAST/issues/140
Please have a look and try that maybe?
On Mon, Feb 10, 2020 at 11:56 AM JenM1 notifications@github.com wrote:
Hi,
Which package it the where function in? I installed pryr and this is what I get.
where("g++") Error: Can't find g++
On Mon, Feb 10, 2020 at 10:40 AM Jen Marsh jennifer.m.marsh@gmail.com wrote:
Hi Cole,
I get a bunch of warnings.
Warning messages: 1: In file.remove(dynlib(name)) : cannot remove file 'ar1xar1.so', reason 'No such file or directory' 2: In file.remove(paste0(name, ".o")) : cannot remove file 'ar1xar1.o', reason 'No such file or directory' 3: In file.remove(dynlib(name)) : cannot remove file 'linreg_parallel.so', reason 'No such file or directory' 4: In file.remove(paste0(name, ".o")) : cannot remove file 'linreg_parallel.o', reason 'No such file or directory' 5: In file.remove(dynlib(name)) : cannot remove file 'randomregression.so', reason 'No such file or directory' 6: In file.remove(paste0(name, ".o")) : cannot remove file 'randomregression.o', reason 'No such file or directory' 7: In file.remove(paste0(name, ".o")) : cannot remove file 'simple.o', reason 'No such file or directory'
Thanks, Jen
On Mon, Feb 10, 2020 at 10:26 AM Cole Monnahan < notifications@github.com
wrote:
I should have said this: TMB::runExample(all=TRUE, clean=TRUE) that will run all examples after cleaning to force a recompilation of all .cpp files.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <
,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AJMKBSRWHPDGGQD7NUTFPUTRCGS6XANCNFSM4KSTYRJA
.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=ABEVC3W7ELCRKL7LQKVQ52TRCGWGVA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKAIRY#issuecomment-584320071 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABEVC3RYJAG5SW6BW32RKA3RCGWGVANCNFSM4KSTYRJA
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AJMKBSQGXHCBCDC3NUK5DDLRCGXVLA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKCHNY#issuecomment-584328119, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJMKBSXQHIN7H7Z7JIYV4ADRCGXVLANCNFSM4KSTYRJA .
Yeah if it compiled and is optimizing it is working. The example he provided can take a long time to run. You should be set.
On Mon, Feb 10, 2020 at 2:21 PM JenM1 notifications@github.com wrote:
Hi,
I think it's working, well fit_model() has been spitting out numbers for the last 10 minutes... I added what Sarah Gaichas suggested to ~/.R/Markvars in this thread https://github.com/kaskr/adcomp/issues/297 I did substitute "clang7" for "clang6".
Thanks for your help. Jen
On Mon, Feb 10, 2020 at 11:11 AM Jen Marsh jennifer.m.marsh@gmail.com wrote:
Hi,
Yes, I am on a Mac. I'll try your suggestions.
Thanks, Jen
On Mon, Feb 10, 2020 at 11:06 AM Cole Monnahan <notifications@github.com
wrote:
You gotta wrap it in a system call, at least on Windows:
system('where g++') C:\Rtools\mingw_64\bin\g++.exe
it just asks which file is used to compile the model.
Those warnings are fine. It seems like everything is compiling fine except for VAST then. VAST must be using an option that the other models aren't. I'm at a bit of a loss, this isn't really my speciality. But at least we know TMB is working on your machine. Are you on a Mac? There's a couple solved issues with VAST:
https://github.com/James-Thorson-NOAA/VAST/issues/182 https://github.com/James-Thorson-NOAA/VAST/issues/140
Please have a look and try that maybe?
On Mon, Feb 10, 2020 at 11:56 AM JenM1 notifications@github.com wrote:
Hi,
Which package it the where function in? I installed pryr and this is what I get.
where("g++") Error: Can't find g++
On Mon, Feb 10, 2020 at 10:40 AM Jen Marsh < jennifer.m.marsh@gmail.com> wrote:
Hi Cole,
I get a bunch of warnings.
Warning messages: 1: In file.remove(dynlib(name)) : cannot remove file 'ar1xar1.so', reason 'No such file or directory' 2: In file.remove(paste0(name, ".o")) : cannot remove file 'ar1xar1.o', reason 'No such file or directory' 3: In file.remove(dynlib(name)) : cannot remove file 'linreg_parallel.so', reason 'No such file or directory' 4: In file.remove(paste0(name, ".o")) : cannot remove file 'linreg_parallel.o', reason 'No such file or directory' 5: In file.remove(dynlib(name)) : cannot remove file 'randomregression.so', reason 'No such file or directory' 6: In file.remove(paste0(name, ".o")) : cannot remove file 'randomregression.o', reason 'No such file or directory' 7: In file.remove(paste0(name, ".o")) : cannot remove file 'simple.o', reason 'No such file or directory'
Thanks, Jen
On Mon, Feb 10, 2020 at 10:26 AM Cole Monnahan < notifications@github.com
wrote:
I should have said this: TMB::runExample(all=TRUE, clean=TRUE) that will run all examples after cleaning to force a recompilation of all .cpp files.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <
,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/AJMKBSRWHPDGGQD7NUTFPUTRCGS6XANCNFSM4KSTYRJA
.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <
, or unsubscribe <
https://github.com/notifications/unsubscribe-auth/ABEVC3RYJAG5SW6BW32RKA3RCGWGVANCNFSM4KSTYRJA
.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AJMKBSQGXHCBCDC3NUK5DDLRCGXVLA5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKCHNY#issuecomment-584328119 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AJMKBSXQHIN7H7Z7JIYV4ADRCGXVLANCNFSM4KSTYRJA
.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/James-Thorson-NOAA/VAST/issues/218?email_source=notifications&email_token=AOBEDUFRO5N5YX7JFUKWKIDRCHHP3A5CNFSM4KSTYRJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELKQR5Q#issuecomment-584386806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOBEDUDBFM3PB6VRN7NU7KDRCHHP3ANCNFSM4KSTYRJA .
If you get the 'Compilation failed' warning using Windows OS you might try using an earlier version of Rtools. I had installed Rtools35 and had issues with compile but installed Rtools34 instead and ran the TMB simple example successfully
install.packages("devtools")
require(devtools)
install.packages("Matrix")
require(Matrix)
Before proceeding, follow these instructions: https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/. Recommend using the "Manual Install Guide" instructions (via the terminal [Applications > Utilities > Terminal]).
Install TMB from CRAN:
install.packages("TMB")
# select option 1 (update all packages), if prompted
require(TMB)
Replace ~/.R/Makevars contents with the following (type 'open ~/.R/Makevars' in the terminal to edit) :
CC=gcc
CXX=/usr/local/gfortran/bin/g++
CXX1X=/usr/local/clang7/bin/clang++
CXX98=/usr/local/clang7/bin/clang++
CXX11=/usr/local/clang7/bin/clang++
CXX14=/usr/local/clang7/bin/clang++
CXX17=/usr/local/clang7/bin/clang++
LDFLAGS=-L/usr/local/clang7/lib
# The final line with no data may be necessary...for some unknown reason.
Test TMB following code from: https://github.com/nwfsc-assess/geostatistical_delta-GLMM/wiki/Steps-to-install-TMB.
Version = "linear_mixed_model"
# Simulate data for a linear mixed model with random intercepts:
set.seed(1)
Factor = rep(1:10, each=10)
Z = rnorm(length(unique(Factor)), mean=0, sd=1)
X0 = 0
Y = Z[Factor] + X0 + rnorm( length(Factor), mean=0, sd=1)
# Download CPP file:
setwd(tempdir())
download.file(url="https://raw.githubusercontent.com/James-Thorson/mixed-effects/master/linear_mixed_model/linear_mixed_model.cpp", destfile="linear_mixed_model.cpp", method="auto")
compile(paste0(Version,".cpp"))
# Generate inputs for TMB:
Data = list("n_data"=length(Y), "n_factors"=length(unique(Factor)), "Factor"=Factor-1, "Y"=Y)
Parameters = list("X0"=-10, "log_SD0"=2, "log_SDZ"=2, "Z"=rep(0,Data$n_factor))
Random = c("Z")
# Build TMB object:
dyn.load(dynlib(Version))
Obj = MakeADFun(data=Data, parameters=Parameters, random=Random) #
# Check that TMB is working properly:
Obj$fn(Obj$par)
# This should return 313.4137.
Install VAST dependency, FishStatsUtils:
install_github("james-thorson/FishStatsUtils", INSTALL_opts="--no-staged-install")
require(FishStatsUtils)
Install VAST dependency, INLA:
install.packages("INLA", repos=c(getOption("repos"), INLA="https://inla.r-inla-download.org/R/stable"), dep=TRUE)
require(INLA)
Install the latest version of VAST, dowloaded from github: https://github.com/James-Thorson-NOAA/VAST.
install_local("~/Downloads/VAST-master")
require(VAST)
Test VAST using code from: https://github.com/James-Thorson-NOAA/VAST/wiki/Simple-example):
setwd("~/Desktop/VAST")
# change for your requirements; this is where model results and plots will be saved
# load data set
# see `?load_example` for list of stocks with example data
# that are installed automatically with `FishStatsUtils`.
example = load_example(data_set="EBS_pollock")
# Make settings (turning off bias.correct to save time for example):
settings = make_settings(n_x=100, Region=example$Region, purpose="index",
strata.limits=example$strata.limits, bias.correct=FALSE)
# Run model
fit = fit_model("settings"=settings, "Lat_i"=example$sampling_data[,'Lat'],
"Lon_i"=example$sampling_data[,'Lon'], "t_i"=example$sampling_data[,'Year'],
"c_i"=rep(0,nrow(example$sampling_data)), "b_i"=example$sampling_data[,'Catch_KG'],
"a_i"=example$sampling_data[,'AreaSwept_km2'], "v_i"=example$sampling_data[,'Vessel'])
# Plot results
install.packages("rnaturalearthdata")
require(rnaturalearthdata)
plot(fit)
Please disregard "If, after completing the steps above, you still have compilation issues - consider installing Xcode 11.3 from https://developer.apple.com/download/more/" from my comment above.
Installing Xcode from Apple Developer seems to be causing (or at least not resolving) issues for people. If you go to install the Xcode CLI toolchain from Terminal and get a message about the software already being installed, run:
sudo rm -rf/Library/Developer/CommandLineTools
< and then >
xcode -select --install
If you follow the remaining steps above, all should be right in the world!
If you are having installation issues with INLA, use the 'testing' version instead of the 'stable' version (this is recommended by the authors):
install.packages("INLA", repos=c(getOption("repos"), INLA="https://inla.r-inla-download.org/R/testing"), dep=TRUE)
Also, make sure that gfortran is up-to-date. I recently updated R (v4.0.0) and RStudio (v1.2.5042) and needed to use gfortran 8.2.
I am having the same issue with Windows 10 machine. R4.02. Rtool4.0. TMB sample c;ode worked fine. Simple VAST example does not work
Error in TMB::compile(paste0(Version, ".cpp")) : Compilation failed In addition: Warning messages: 1: In showSRID(uprojargs, format = "PROJ", multiline = "NO") : Discarded datum Unknown based on WGS84 ellipsoid in CRS definition 2: In showSRID(uprojargs, format = "PROJ", multiline = "NO") : Discarded datum Unknown based on WGS84 ellipsoid in CRS definition 3: In sp::spTransform(posTri, CRSobj = map_data@proj4string) : NULL target CRS comment, falling back to PROJ string
System check appears to be correct
system('where g++') C:\rtools40\mingw64\bin\g++.exe [
Hi all,
After lots of back-and-forth about these issues, I have decided to comment out the VamConfig[1]=3
feature (which constrained oscillations arising from species interactions in a VAM). This then eliminates all the macOS compiler errors that are documented above. The new Version = "VAST_v9_4_0"
file in VAST release 3.5.3 should now compile on macOS.
Dan Cushing has already checked this fix on his machine, but could anyone else on this thread also try to re-install latest numeric release of VAST, and check whether the compiler errors are now fixed?
I'm closing the issue for now, but happy to re-open or hear other encouragement about it being fixed :)
Note: CRAN R 4.0.0 builds and higher no longer use any custom compilers and thus this directory is no longer relevant. We now use Apple Xcode 10.1 and GNU Fortran 8.2 from https://github.com/fxcoudert/gfortran-for-macOS/releases. For more details on compiling R, please see also https://mac.R-project.org/tools/
Part of the output below: Calculated and saved to /private/var/folders/87/z7zyllzd4hld9fwy_7s535p00000gp/T/RtmpC4fB10/Summer-Gadus_chalcogrammus-2020-02-10//Kmeans-500.RData
Making data object
FieldConfig_input is: Component_1 Component_2 Omega -2 -2 Epsilon -2 -2 Beta -2 -2 Epsilon_time -3 -3 OverdispersionConfig_input is: Eta1 Eta2 -1 -1 Calculating range shift for stratum #1:
Making TMB object
Note: Using Makevars in /Users/jmmarsh/.R/Makevars clang++ -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Users/jmmarsh/Library/R/3.6/library/TMB/include -I/Users/jmmarsh/Library/R/3.6/library/RcppEigen/include -DTMB_SAFEBOUNDS -DLIB_UNLOAD=R_unload_VAST_v9_1_0 -DTMB_LIB_INIT=R_init_VAST_v9_1_0 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include -fPIC -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -c VAST_v9_1_0.cpp -o VAST_v9_1_0.o In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:1: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Core:535: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:2: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/LU:47: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:3: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Cholesky:12: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Jacobi:29: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:3: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Cholesky:43: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:4: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/QR:17: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Householder:27: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:5: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/SVD:48: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:6: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Geometry:58: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:53: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Dense:7: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Eigenvalues:58: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:54: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:26: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/SparseCore:66: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:54: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:27: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/OrderingMethods:71: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:54: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:29: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/SparseCholesky:43: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:54: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:32: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/SparseQR:35: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
In file included from VAST_v9_1_0.cpp:2: In file included from /Users/jmmarsh/Library/R/3.6/library/TMB/include/TMB.hpp:54: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/Sparse:33: In file included from /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/IterativeLinearSolvers:46: /Users/jmmarsh/Library/R/3.6/library/RcppEigen/include/Eigen/src/Core/util/ReenableStupidWarnings.h:10:30: warning: pragma diagnostic pop could not pop, no matching push [-Wunknown-pragmas]
pragma clang diagnostic pop
VAST_v9_1_0.cpp:725:18: error: call to 'sqrt' is ambiguous Range_raw1 = sqrt(8) / exp( logkappa1 ); // Range = approx. distance @ 10% correlation ^~~~ /usr/local/clang7/include/c++/v1/math.h:1038:1: note: candidate function [with _A1 = int] sqrt(_A1 lcpp_x) _NOEXCEPT {return ::sqrt((double)lcpp_x);} ^ VAST_v9_1_0.cpp:68:6: note: candidate function [with Type = int] Type sqrt(Type x){ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:433:15: note: candidate function extern double sqrt(double); ^ /usr/local/clang7/include/c++/v1/math.h:1031:46: note: candidate function inline _LIBCPP_INLINE_VISIBILITY float sqrt(float lcpp_x) _NOEXCEPT {return ::sqrtf(lcpp_x);} ^ /usr/local/clang7/include/c++/v1/math.h:1032:46: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double lcpp_x) _NOEXCEPT {return ::sqrtl(lcpp_x);} ^ VAST_v9_1_0.cpp:726:18: error: call to 'sqrt' is ambiguous Range_raw2 = sqrt(8) / exp( logkappa2 ); // Range = approx. distance @ 10% correlation ^~~~ /usr/local/clang7/include/c++/v1/math.h:1038:1: note: candidate function [with _A1 = int] sqrt(_A1 lcpp_x) _NOEXCEPT {return ::sqrt((double)lcpp_x);} ^ VAST_v9_1_0.cpp:68:6: note: candidate function [with Type = int] Type sqrt(Type x){ ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:433:15: note: candidate function extern double sqrt(double); ^ /usr/local/clang7/include/c++/v1/math.h:1031:46: note: candidate function inline _LIBCPP_INLINE_VISIBILITY float sqrt(float lcpp_x) _NOEXCEPT {return ::sqrtf(lcpp_x);} ^ /usr/local/clang7/include/c++/v1/math.h:1032:46: note: candidate function inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double lcpp_x) _NOEXCEPT {return ::sqrtl(lcpp_x);} ^ VAST_v9_1_0.cpp:848:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] if( (Options_vec(8)==1) ){