Makevars.win seems to be ignored and igraph won’t build.
I updated R and RStudio to the latest versions, 4.1.2 and 2021.09.1-372, respectively, and then followed RStan Getting Started · stan-dev/rstan Wiki · GitHub. Since Sys.getenv(“HOME”) return my user root directory, not the documents folder, I put the .R directory under the former and created Makevars.win, including a leading newline and space before the macro definition.
Makevars.win
Makevars.win seemed to be ignored, or possibly it didn’t matter. Typical compilation:
"J:/rtools40/mingw32/bin/"gcc -I"J:/Programs/R-4.1.2/include" -DNDEBUG -I/mingw32/include/libxml2 -I/mingw32/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML=1 -DHAVE_UNISTD_H -Wall -DPACKAGE_VERSION=\"1.2.11\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -DHAVE_GFORTRAN -Ics -I/mingw32/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/mingw32/include -DINTERNAL_SUITESPARSE -DINTERNAL_ARPACK -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c components.c -o components.o
The std=gnu99
or gnu++11
in other places suggests it’s not using C++ 14, in which case I presume the settings for CXX14FLAGS
is irrelevant.
igraph
At the start the console log indicated the source version was newer than the binary version, and it attempted to build the newer version from source. It ended with
"J:/rtools40/mingw32/bin/"gcc -I"J:/Programs/R-4.1.2/include" -DNDEBUG -I/mingw32/include/libxml2 -I/mingw32/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML=1 -DHAVE_UNISTD_H -Wall -DPACKAGE_VERSION=\"1.2.11\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -DHAVE_GFORTRAN -Ics -I/mingw32/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/mingw32/include -DINTERNAL_SUITESPARSE -DINTERNAL_ARPACK -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c fast_community.c -o fast_community.o
fast_community.c:261:13: warning: 'igraph_i_fastgreedy_community_list_check_heap' defined but not used [-Wunused-function]
static void igraph_i_fastgreedy_community_list_check_heap(
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"J:/rtools40/mingw32/bin/"gcc -I"J:/Programs/R-4.1.2/include" -DNDEBUG -I/mingw32/include/libxml2 -I/mingw32/include -DLIBXML_STATIC -DUSING_R -DHAVE_FMEMOPEN=0 -DHAVE_OPEN_MEMSTREAM=0 -DHAVE_RINTF -DWin32 -DHAVE_LIBXML=1 -DHAVE_UNISTD_H -Wall -DPACKAGE_VERSION=\"1.2.11\" -DHAVE_FMIN=1 -DHAVE_LOG2=1 -DHAVE_SNPRINTF -DHAVE_GFORTRAN -Ics -I/mingw32/include -DHAVE_GLPK=1 -Iplfit -Iprpack -DIGRAPH_THREAD_LOCAL= -DPRPACK_IGRAPH_SUPPORT -I. -Iinclude -ISuiteSparse_config -DNDEBUG -DNPARTITION -DNTIMER -DNCAMD -DNPRINT -I/mingw32/include -DINTERNAL_SUITESPARSE -DINTERNAL_ARPACK -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c feedback_arc_set.c -o feedback_arc_set.o
In file included from feedback_arc_set.c:31:
igraph_glpk_support.h:36:10: fatal error: glpk.h: No such file or directory
#include <glpk.h>
^~~~~~~~
compilation terminated.
make: *** [J:/Programs/R-4.1.2/etc/i386/Makeconf:238: feedback_arc_set.o] Error 1
ERROR: compilation failed for package 'igraph'
I presume igraph is not under stan developers’ control, but I still need a way to build the package in the face of this.
Other
It’s odd that most of the builds seem to be 32 bit; my hardware, OS, RStudio are all 64 bit. I think R installs both 32 and 64 bit versions. The log does show some sections that say *** arch - x64
.
There are various other warnings.
Contents of .R/Makevars
Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
cannot open file 'C:\Users\rdboylan/.R/Makevars': No such file or directory
> writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars.win")))
CXX14FLAGS += -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2"
Error in loadNamespace(x) : there is no package called ‘devtools’
> install.packages("devtools")
also installing the dependencies ‘credentials’, ‘zip’, ‘gitcreds’, ‘ini’, ‘diffobj’, ‘gert’, ‘gh’, ‘whisker’, ‘xopen’, ‘brew’, ‘brio’, ‘praise’, ‘waldo’, ‘usethis’, ‘memoise’, ‘pkgload’, ‘rcmdcheck’, ‘remotes’, ‘roxygen2’, ‘rversions’, ‘sessioninfo’, ‘testthat’
There is a binary version available but the source version is later:
binary source needs_compilation
gert 1.4.3 1.5.0 TRUE # I said use the binary
# tons of setup
> devtools::session_info("rstan")
- Session info -------------------------------------------------------------------------------------------------------------------------------------------------
setting value
version R version 4.1.2 (2021-11-01)
os Windows Server x64 (build 17763)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.1252
ctype English_United States.1252
tz America/Los_Angeles
date 2022-01-05
rstudio 2021.09.1+372 Ghost Orchid (desktop)
pandoc 2.14.0.3 @ J:/Programs/RStudio/bin/pandoc/ (via rmarkdown)
- Packages -----------------------------------------------------------------------------------------------------------------------------------------------------
package * version date (UTC) lib source
backports 1.4.1 2021-12-13 [1] CRAN (R 4.1.2)
BH 1.78.0-0 2021-12-15 [1] CRAN (R 4.1.2)
callr 3.7.0 2021-04-20 [1] CRAN (R 4.1.2)
checkmate 2.0.0 2020-02-06 [1] CRAN (R 4.1.2)
cli 3.1.0 2021-10-27 [1] CRAN (R 4.1.2)
colorspace 2.0-2 2021-06-24 [1] CRAN (R 4.1.2)
crayon 1.4.2 2021-10-29 [1] CRAN (R 4.1.2)
desc 1.4.0 2021-09-28 [1] CRAN (R 4.1.2)
digest 0.6.29 2021-12-01 [1] CRAN (R 4.1.2)
ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.2)
fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.2)
farver 2.1.0 2021-02-28 [1] CRAN (R 4.1.2)
ggplot2 * 3.3.5 2021-06-25 [1] CRAN (R 4.1.2)
glue 1.6.0 2021-12-17 [1] CRAN (R 4.1.2)
gridExtra 2.3 2017-09-09 [1] CRAN (R 4.1.2)
gtable 0.3.0 2019-03-25 [1] CRAN (R 4.1.2)
inline 0.3.19 2021-05-31 [1] CRAN (R 4.1.2)
isoband 0.2.5 2021-07-13 [1] CRAN (R 4.1.2)
labeling 0.4.2 2020-10-20 [1] CRAN (R 4.1.1)
lattice 0.20-45 2021-09-22 [1] CRAN (R 4.1.2)
lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.2)
loo 2.4.1 2020-12-09 [1] CRAN (R 4.1.2)
magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.2)
MASS 7.3-54 2021-05-03 [1] CRAN (R 4.1.2)
Matrix 1.4-0 2021-12-08 [1] CRAN (R 4.1.2)
matrixStats 0.61.0 2021-09-17 [1] CRAN (R 4.1.2)
mgcv 1.8-38 2021-10-06 [1] CRAN (R 4.1.2)
munsell 0.5.0 2018-06-12 [1] CRAN (R 4.1.2)
nlme 3.1-153 2021-09-07 [1] CRAN (R 4.1.2)
pillar 1.6.4 2021-10-18 [1] CRAN (R 4.1.2)
pkgbuild 1.3.1 2021-12-20 [1] CRAN (R 4.1.2)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.2)
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.1.2)
processx 3.5.2 2021-04-30 [1] CRAN (R 4.1.2)
ps 1.6.0 2021-02-28 [1] CRAN (R 4.1.2)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.2)
RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 4.1.1)
Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.1.2)
RcppEigen 0.3.3.9.1 2020-12-17 [1] CRAN (R 4.1.2)
RcppParallel 5.1.5 2022-01-05 [1] CRAN (R 4.1.2)
rlang 0.4.12 2021-10-18 [1] CRAN (R 4.1.2)
rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.1.2)
rstan * 2.21.3 2021-12-19 [1] CRAN (R 4.1.2)
scales 1.1.1 2020-05-11 [1] CRAN (R 4.1.2)
StanHeaders * 2.21.0-7 2020-12-17 [1] CRAN (R 4.1.2)
tibble 3.1.6 2021-11-07 [1] CRAN (R 4.1.2)
utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.2)
vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.2)
viridisLite 0.4.0 2021-04-13 [1] CRAN (R 4.1.2)
withr 2.4.3 2021-11-30 [1] CRAN (R 4.1.2)
[1] J:/Programs/R-4.1.2/library
--