grantbrown / libspatialSEIR

A C++ and OpenCL framework for fast Bayesian spatio-temporal compartmental epidemic modeling.
Other
15 stars 2 forks source link

Problems with installation on a Windows 10 machine #2

Closed Shaurya-47 closed 4 years ago

Shaurya-47 commented 4 years ago

I am trying to install the spatialSEIR package on a Windows 10 computer. I followed all the instructions given on the Wiki, but when I run the final step, I get the following error (stating that the ModelContext.hpp file does not exist):

Microsoft Windows [Version 10.0.18362.836] (c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\User>cd C:\Users\User\Documents\libspatialSEIR\R\release_package

C:\Users\User\Documents\libspatialSEIR\R\release_package>install_win

C:\Users\User\Documents\libspatialSEIR\R\release_package>cp -r ../dev_package/* ./ 'cp' is not recognized as an internal or external command, operable program or batch file.

C:\Users\User\Documents\libspatialSEIR\R\release_package>cd src

C:\Users\User\Documents\libspatialSEIR\R\release_package\src>mkdir LSS A subdirectory or file LSS already exists.

C:\Users\User\Documents\libspatialSEIR\R\release_package\src>cd include

C:\Users\User\Documents\libspatialSEIR\R\release_package\src\include>mkdir LSS A subdirectory or file LSS already exists.

C:\Users\User\Documents\libspatialSEIR\R\release_package\src\include>cd ..

C:\Users\User\Documents\libspatialSEIR\R\release_package\src>cp -r ../../../libSpatialSEIR/src/* ./LSS 'cp' is not recognized as an internal or external command, operable program or batch file.

C:\Users\User\Documents\libspatialSEIR\R\release_package\src>cp -r ../../../libSpatialSEIR/include/* ./include/LSS 'cp' is not recognized as an internal or external command, operable program or batch file.

C:\Users\User\Documents\libspatialSEIR\R\release_package\src>cd ../

C:\Users\User\Documents\libspatialSEIR\R\release_package>mv ./src/Makevars_release.win ./src/Makevars.win 'mv' is not recognized as an internal or external command, operable program or batch file.

C:\Users\User\Documents\libspatialSEIR\R\release_package>cd ..

C:\Users\User\Documents\libspatialSEIR\R>R CMD INSTALL release_package

*** arch - i386 "C:/rtools40/mingw32/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I./../../../eigen -I.//include -I'C:/Users/User/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c RcppExports.cpp -o RcppExports.o "C:/rtools40/mingw32/bin/"g++ -std=gnu++11 -I"C:/PROGRA~1/R/R-40~1.0/include" -DNDEBUG -I./../../../eigen -I.//include -I'C:/Users/User/Documents/R/win-library/4.0/Rcpp/include' -O2 -Wall -mfpmath=sse -msse2 -mstackrealign -c dataModel.cpp -o dataModel.o In file included from dataModel.cpp:2: .//include/dataModel.hpp:4:9: fatal error: ModelContext.hpp: No such file or directory

include

     ^~~~~~~~~~~~~~~~~~

compilation terminated. make: *** [C:/PROGRA~1/R/R-40~1.0/etc/i386/Makeconf:229: dataModel.o] Error 1 ERROR: compilation failed for package 'spatialSEIR'

I checked the downloaded folder and the file is present on my system. It would be really helpful if you could provide some instructions or insights on how to proceed with the installation.

Thank you

grantbrown commented 4 years ago

Hi Shaurya-47, this code is a bit "orphaned", and hasn't been updated for more recent versions of R and Rtools (last update was in 2015 on Windows 7). Nevertheless, I think this is just an issue with your command line environment. Always pay attention to the first error - here, it's the following:

'cp' is not recognized as an internal or external command, operable program or batch file.

That means that when the installation script tries to copy the various files to be in the right locations, it can't find the program "cp", which does the copying. This program is provided by Rtools, but the path appears to be a bit different than in the past. Depending on where you install Rtools, this may be a bit different, but here are the relevant entries in my PATH variable:

C:\Program Files\R\R-4.0.0\bin\x64 C:\Program Files\R\R-4.0.0\bin C:\rtools40\mingw64\bin C:\rtools40 C:\rtools40\usr\bin

That last one is where the "cp" function is located. If you add these to your user PATH, then following the installation instructions should work (I tried it out on a Windows 10 workstation).

Shaurya-47 commented 4 years ago

Thanks a lot for the prompt response, Mr Brown! The installation was successful after following these instructions.