James-Thorson / spatial_DFA

Spatial dynamic factor analysis, for estimating spatiotemporal density dependence in community dynamics
7 stars 4 forks source link

Compiling C++ file #1

Open DubChen opened 8 years ago

DubChen commented 8 years ago

Hi Jim,

Trying to set up spatial DFA on my computer, but seem to be running into issues after getting all the packages installed. When I go to compile with the following code from your example:

TmbFile = system.file("executables", package="SpatialDFA")

library( INLA )
library( TMB )

library( SpatialDFA )
Version = "spatial_dfa_v18"

setwd( TmbFile )
compile( paste0(Version,".cpp") )

I get the following errors:

Note: Using Makevars in C:/Users/wchen16/Documents/.R/Makevars c:/Rtools/mingw_64/bin/g++ -I"C:/PROGRA~1/R/R-33~1.1/include" -DNDEBUG -IC:/Users/wchen16/DOCUME~1/R/WIN-LI~1/3.3/TMB/include -DTMB_SAFEBOUNDS -DLIB_UNLOAD=R_unload_spatial_dfa_v18 -DTMB_LIB_INIT=R_init_spatial_dfa_v18 -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -mtune=core2 -c spatial_dfa_v18.cpp -o spatial_dfa_v18.o c:/Rtools/mingw_64/bin/g++: not found make: *\ [spatial_dfa_v18.o] Error 127 Error in compile(paste0(Version, ".cpp")) : Compilation failed In addition: Warning message: running command 'make -f "C:/PROGRA~1/R/R-33~1.1/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-33~1.1/share/make/winshlib.mk" -f "C:\Users\wchen16\AppData\Local\Temp\RtmpQrHdY7\file3b43c5e6ef0" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="spatial_dfa_v18.dll" WIN=64 TCLBIN=64 OBJECTS="spatial_dfa_v18.o"' had status 2

Is it possible that the paths/directories to the missing files are incorrect? I notice a lowercase "c:" rather than "C:", but I don't know where I'd go to change that.

Thanks in advance! Will

James-Thorson commented 8 years ago

Will,

I'm sorry to say that this is a TMB-installation problem rather than a problem with SpatialDFA per se (you can tell from the "Error 127" message). I recommend trying the three installation methods listed here: https://github.com/James-Thorson/2016_Spatio-temporal_models. If none of them work, please post an issue on the TMB issue tracker (https://github.com/kaskr/adcomp/issues).

jim

DubChen commented 8 years ago

Ah, thanks. I'll try again.

Hanqingpeng commented 6 years ago

@DubChen Hi, DubChen I'm also facing this problem. Have you solved this problem yet? Can you give me some help with this question?

Thanks in advance! Han Qingpeng

James-Thorson commented 6 years ago

What specific error message are you getting?

On Oct 30, 2017 11:34 PM, "Hanqingpeng" notifications@github.com wrote:

@DubChen https://github.com/dubchen Hi, DubChen I'm also facing this problem. Have you solved this problem yet? Can you give me some help with this question?

Thanks in advance! Han Qingpeng

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/James-Thorson/spatial_DFA/issues/1#issuecomment-340650384, or mute the thread https://github.com/notifications/unsubscribe-auth/AHnqTRStnxzP77YP544qF2Pk3pX52lfaks5sxpVbgaJpZM4KBG5q .

Hanqingpeng commented 6 years ago

Note: Using Makevars in C:/Users/PC/Documents/.R/Makevars Error in compile(paste0(Version, ".cpp")) : Compilation failed In addition: Warning message: running command 'make -f "d:/PROGRA~2/R/R-34~1.2/etc/x64/Makeconf" -f "d:/PROGRA~2/R/R-34~1.2/share/make/winshlib.mk" -f "C:\Users\PC\AppData\Local\Temp\RtmpgDmj48\file97450543bad" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="geo_index_v4b.dll" WIN=64 TCLBIN=64 OBJECTS="geo_index_v4b.o"' had status 127

James-Thorson commented 6 years ago

In my experience, status 127 indicates that TMB is not installed correctly.

Did you follow these steps to confirm that TMB was working: https://github.com/nwfsc-assess/geostatistical_delta-GLMM/wiki/Steps-to-install-TMB.. .?

On Mon, Oct 30, 2017 at 11:40 PM, Hanqingpeng notifications@github.com wrote:

Note: Using Makevars in C:/Users/PC/Documents/.R/Makevars Error in compile(paste0(Version, ".cpp")) : Compilation failed In addition: Warning message: running command 'make -f "d:/PROGRA2/R/R-341.2/etc/x64/Makeconf" -f "d:/PROGRA2/R/R-341.2/share/make/winshlib.mk" -f "C:\Users\PC\AppData\Local\Temp\RtmpgDmj48\file97450543bad" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="geo_index_v4b.dll" WIN=64 TCLBIN=64 OBJECTS="geo_index_v4b.o"' had status 127

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/James-Thorson/spatial_DFA/issues/1#issuecomment-340650983, or mute the thread https://github.com/notifications/unsubscribe-auth/AHnqTZ7jKkQXvjt24zUtpbZ2ZcFkIsV9ks5sxpasgaJpZM4KBG5q .

Hanqingpeng commented 6 years ago

@James-Thorson thank you I have solved this problem through these steps to confirm that TMB was working: https://github.com/nwfsc-assess/geostatistical_delta-GLMM/wiki/Steps-to-install-TMB..

diogoprov commented 4 years ago

While I could easily install TMB, I think my problem is with TMBHelper

ERROR: hard-coded installation path: please report to the package maintainer and use ‘--no-staged-install’
* removing ‘/Users/diogoborgesprovete/Library/R/3.6/library/00LOCK-FishStatsUtils/00new/TMBhelper’
Error: package or namespace load failed for ‘FishStatsUtils’:
 .onAttach failed in attachNamespace() for 'FishStatsUtils', details:
  call: NULL
  error: Failed to install 'TMBhelper' from GitHub:
  (converted from warning) installation of package ‘/var/folders/kd/_k75gv855qxbyrqq0rtqk1w40000gr/T//RtmpGath4o/filed1524fd43114/TMBhelper_1.2.0.tar.gz’ had non-zero exit status
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Users/diogoborgesprovete/Library/R/3.6/library/FishStatsUtils’
Error: Failed to install 'SpatialDFA' from GitHub:
  Failed to install 'FishStatsUtils' from GitHub:
  (converted from warning) installation of package ‘/var/folders/kd/_k75gv855qxbyrqq0rtqk1w40000gr/T//RtmpTwKdJd/file1ee37f8942f0/FishStatsUtils_2.5.0.tar.gz’ had non-zero exit status

Any thoughts?

Thank you in advance

James-Thorson-NOAA commented 4 years ago

This package is deprecated, and (essentially) all functionality is available in package VAST. VAST also contains instructions here for dealing with this "staged-install" error.

What are you aiming to use SpatialDFA for?

diogoprov commented 4 years ago

Thanks for the quick @James-Thorson ! I was hoping to use your JSDM for spatio-temporal dynamics, the GEB paper. Is it implemented in SpatialDFA, isn't it?

Best

James-Thorson-NOAA commented 4 years ago

the GEB paper is implemented using SpatialDFA. As I said though, VAST does the same stuff and is better maintained and has more functionality. Are you trying to do a strict replication study (which would require SpatialDFA), or you trying to adapt it to new circumstances (where I recommend using VAST)?

diogoprov commented 4 years ago

I see. I missread the previous message as you saying the TMBhelper was deprecated, not SpatialDFA. I quickly tried to install VAST, but came across some errors. I'm check your debugging page and see if I can deal with it. I saw MacOS and recent version of R may have errors.

BTW, yes I'm trying to adapt it to new circumstances, analysing a frog metacommunity with temporal replication (13 months and 14 ponds) with respective environmental predictor variables.

Thanks a lot again.