renozao / RcppOctave

Seamless Interface to Octave -- and Matlab code
18 stars 9 forks source link

failing build using R 4.0.3 on Ubuntu 20.04 #21

Open tverbeke opened 3 years ago

tverbeke commented 3 years ago

Many thanks for your work on this project. Please find the log below when trying to build the package using R 4.0.3 on Ubuntu 20.04. Let me know if any additional information is required

WARNING: ignoring environment value of R_HOME
* checking for file ‘/home/tverbeke/git/RcppOctave/DESCRIPTION’ ... OK
* preparing ‘RcppOctave’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* running ‘cleanup’
* installing the package to process help pages
      -----------------------------------
* installing *source* package ‘RcppOctave’ ...
** using staged installation
checking R architecture... none
checking for R... /opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/bin/R
checking for Rscript... /opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/bin/Rscript
checking whether loading Rprofile writes to stdout... no
checking R version... R version 4.0.3 (2020-10-10)
checking R platform... x86_64-pc-linux-gnu
checking R CC... gcc
checking R CFLAGS... -g -O2
checking R CPPFLAGS... -I/usr/local/include
checking R CXXFLAGS... -g -O2
checking for gcc... /usr/bin/gcc
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for g++... /usr/bin/g++
configure: Original R_LDFLAGS: -Wl,--export-dynamic -fopenmp -L/usr/local/lib -L/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n
configure: Original R_CPPFLAGS: -I/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/include
checking whether R is a shared library... yes
checking type of Operating System... Linux
checking whether OS is Mac OS (Darwin)... no
configure: Using mkoctfile with R_LDFLAGS: -Wl,--export-dynamic  -L/usr/local/lib -L/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n
configure: Using mkoctfile with R_CPPFLAGS: -I/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/include
checking Octave custom binary path specification... none
configure: using Octave binary path from $PATH
checking for octave-config... /usr/bin/octave-config
checking for mkoctfile... /usr/bin/mkoctfile
checking Octave Octave bin directory... /usr/bin
checking Octave Octave libraries directory... /usr/lib/x86_64-linux-gnu/octave/5.2.0
checking for octave... /usr/bin/octave
checking PATH changes... none
checking Octave module make target... all
checking mkoctfile command... /usr/bin/mkoctfile
checking Octave cpp flags... -Wdate-time -D_FORTIFY_SOURCE=2
checking Octave include flags... -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave
checking Octave -L flags... warning: LFLAGS is deprecated and will be removed in a future version of Octave, use LDFLAGS instead
 -L/usr/lib/x86_64-linux-gnu
checking Octave libraries... -loctinterp -loctave 
checking Octave C compiler... gcc
checking Octave Fortran compiler... gfortran
checking Octave platform... x86_64-pc-linux-gnu
checking Octave API version... api-v53
checking Octave version... 5.2.0
checking whether to infer output names for Octave function (>= 3.4.3)... yes
configure: Using Octave LDFLAGS:   -L/usr/lib/x86_64-linux-gnu -loctinterp -loctave 
configure: Using Octave CPPFLAGS: -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave -DOCT_POST_3_4_0=1
checking RcppOctave Octave module directory... /tmp/RtmpHjp7hc/Rinst7776743922341/00LOCK-RcppOctave/00new/RcppOctave/modules
configure: creating ./config.status
config.status: creating R/config-vars.R
configure: creating ./config.status
config.status: creating R/config-vars.R
config.status: creating src/Makevars
configure: creating ./config.status
config.status: creating R/config-vars.R
config.status: creating src/Makevars
config.status: creating src/modules/Makefile
** libs
# Making Octave module [r_arch: all]
make[1]: Entering directory '/tmp/RtmpHjp7hc/Rbuild777672e578c36/RcppOctave/src/modules'
*** Building octave module: utils.oct
/usr/bin/mkoctfile -v utils.cc
g++ -std=gnu++11 -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave  -pthread -fopenmp -g -O2 -fdebug-prefix-map=/build/octave-rvRilm/octave-5.2.0=. -fstack-protector-strong -Wformat -Werror=format-security    utils.cc -o /tmp/oct-e5EBmh.o
In file included from ../compatibility.h:9,
                 from utils.cc:21:
../swig_octave_version.h:10:10: fatal error: octave/config.h: No such file or directory
   10 | #include <octave/config.h>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:47: utils.oct] Error 1
make[1]: Leaving directory '/tmp/RtmpHjp7hc/Rbuild777672e578c36/RcppOctave/src/modules'
make: *** [Makevars:33: OctaveModule] Error 2
ERROR: compilation failed for package ‘RcppOctave’
* removing ‘/tmp/RtmpHjp7hc/Rinst7776743922341/RcppOctave’
      -----------------------------------
ERROR: package installation failed
tverbeke commented 3 years ago

I was able to overcome this, cf. commits here, but bumped on a new issue:

[...]
# Making Octave module [r_arch: all]
make[1]: Entering directory '/tmp/Rtmpx73VS6/Rbuild1e4ec64e2ad12/RcppOctave/src/modules'
*** Building octave module: utils.oct
/usr/bin/mkoctfile -v utils.cc
g++ -std=gnu++11 -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave  -pthread -fopenmp -g -O2 -fdebug-prefix-map=/build/octave-rvRilm/octave-5.2.0=. -fstack-protector-strong -Wformat -Werror=format-security    utils.cc -o /tmp/oct-4ZyVZ4.o
g++ -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave  -pthread -fopenmp -g -O2 -fdebug-prefix-map=/build/octave-rvRilm/octave-5.2.0=. -fstack-protector-strong -Wformat -Werror=format-security -shared -Wl,-Bsymbolic -Wl,-Bsymbolic-functions -Wl,-z,relro  -o utils.oct  /tmp/oct-4ZyVZ4.o    -L/usr/lib/x86_64-linux-gnu  -Wl,-Bsymbolic-functions -Wl,-z,relro 
*** Building octave module: Rrng.oct
/usr/bin/mkoctfile -v -I/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/include -Wl,--export-dynamic  -L/usr/local/lib -L/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n Rrng.cc
g++ -std=gnu++11 -c -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave  -pthread -fopenmp -g -O2 -fdebug-prefix-map=/build/octave-rvRilm/octave-5.2.0=. -fstack-protector-strong -Wformat -Werror=format-security   -I/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/include  Rrng.cc -o /tmp/oct-aDqKJ6.o
g++ -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave  -pthread -fopenmp -g -O2 -fdebug-prefix-map=/build/octave-rvRilm/octave-5.2.0=. -fstack-protector-strong -Wformat -Werror=format-security -shared -Wl,-Bsymbolic -Wl,-Bsymbolic-functions -Wl,-z,relro  -o Rrng.oct  /tmp/oct-aDqKJ6.o   -Wl,--export-dynamic -L/usr/local/lib -L/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/lib -lR -lpcre2-8 -llzma -lbz2 -lz -lrt -ldl -lm -licuuc -licui18n  -L/usr/lib/x86_64-linux-gnu  -Wl,-Bsymbolic-functions -Wl,-z,relro 
make[1]: Leaving directory '/tmp/Rtmpx73VS6/Rbuild1e4ec64e2ad12/RcppOctave/src/modules'
# Copying Octave modules to directory '/tmp/Rtmpx73VS6/Rinst1e4ec777a5b75/00LOCK-RcppOctave/00new/RcppOctave/modules'
g++ -std=gnu++11 -I"/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/include" -DNDEBUG `"/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/bin/Rscript" -e "Rcpp:::CxxFlags()"` -Wdate-time -D_FORTIFY_SOURCE=2 -I/usr/include/octave-5.2.0/octave/.. -I/usr/include/octave-5.2.0/octave -DOCT_POST_3_4_0=1  -I'/home/tverbeke/.architect/workspace/.metadata/.r/eplugin-local-eu.openanalytics.r.server/user-library/Rcpp/include' -I/usr/local/include   -fpic  -g -O2  -c conversion.cpp -o conversion.o
conversion.cpp: In function ‘T Rcpp::as(SEXP) [with T = octave_value; SEXP = SEXPREC*]’:
conversion.cpp:471:50: error: invalid initialization of reference of type ‘const octave_value&’ from expression of type ‘octave_value_list’
  471 |    const octave_value& ol = as<octave_value_list>(x);
      |                             ~~~~~~~~~~~~~~~~~~~~~^~~
make: *** [/opt/architect/plugins/eu.openanalytics.architect.r.server.gtk.linux/R/etc/Makeconf:181: conversion.o] Error 1
ERROR: compilation failed for package ‘RcppOctave’
* removing ‘/tmp/Rtmpx73VS6/Rinst1e4ec777a5b75/RcppOctave’
      -----------------------------------
ERROR: package installation failed