Comments (27)
I was able to get past the error by editing the Makeconf file as follows:
- Remove/Comment out:
CXX1X =
CXX1XFLAGS =
CXX1XPICFLAGS =
CXX1XSTD =
- Replace with:
CXX11 = g++
CXX11FLAGS = -O2 -g $(LTO)
CXX11PICFLAGS = -fPIC
CXX11STD = -std=c++11
Now the compile fails at the linking stage:
sh: line 2: -L/usr/lib64/microsoft-r/3.4/lib64/R/lib: No such file or directory
EDIT:
You also have to change the following:
- Remove/Comment out:
SHLIB_CXX1XLD = $(CXX1X) $(CXX1XSTD)
SHLIB_CXX1XLDFLAGS = -shared
- Replace with:
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared
In summary, all instances of "CXX1X" should be replaced with "CXX11" in your
${R_HOME}/etc/Makeconf
for system changes or
~/.R/Makevars
for per user changes to resolve the
C++11 standard requested but CXX11 is not defined
error when building some packages that depend on C++11 code.
from microsoft-r-open.
thanks @mjmg your solution worked.
I would add it wasn't as simple as replace CXX1X
with CXX11
since the flags were not provided in the original Makeconf
Here are the original (comment out) and 'corrections'
# CXX1X =
# CXX1XFLAGS =
# CXX1XPICFLAGS =
# CXX1XSTD =
CXX11 = g++
CXX11FLAGS = -O2 -g $(LTO)
CXX11PICFLAGS = -fPIC
CXX11STD = -std=c++11
# SHLIB_CXX1XLD = $(CXX1X) $(CXX1XSTD)
# SHLIB_CXX1XLDFLAGS = -shared
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared
edit:
if you need a Makeconf
to just paste (without having to manually edit lines) here's the one I've been using for our docker images: https://github.com/bi-sdal/mro-ldap-ssh-c7/blob/master/Makeconf
from microsoft-r-open.
Dear all, Why this issue doesn't fix? Should I make a push request?
from microsoft-r-open.
I am still getting this when installing packages on 3.4.1. The same edits to Makeconf above worked.
from microsoft-r-open.
Hi @stgries.
This was a bug in the CRAN R release. They have release a patch and we are in the process of patching our distribution right now. You should see an update soon.
from microsoft-r-open.
from microsoft-r-open.
Hi @stgries,
I'm sorry, I was actually mistaken. The bug from CRAN is a different issue that we will be soon releasing a patch for, but this one is our bug :) We will be looking into it and keep you updated.
from microsoft-r-open.
We will targeting a fix for this in our next release. Unfortunately it's not as simple as just updating our compiler flags since we are using a different toolchain to enable support for older platforms.
In the meantime, you should be able to copy the correct flags into your /etc/Makeconf. The provided Makeconf configuration should work for CentOS 7.
from microsoft-r-open.
@aarongrider Provided patch for Makeconf fails under CENTOS7
Based on CRAN R 3.4.0 notes
INSTALLATION on a UNIX-ALIKE
configure now adds a compiler switch for C++11 code, even if the compiler supports C++11 by default. (This ensures that g++ 6.x uses C++11 mode and not its default mode of C++14 with ‘GNU extensions’.)
The tests for C++11 compliance are now much more comprehensive. For gcc < 4.8, the tests from R 3.3.0 are used in order to maintain the same behaviour on Linux distributions with long-term support.
An alternative compiler for C++11 is now specified with CXX11, not CXX1X. Likewise C++11 flags are specified with CXX11FLAGS and the standard (e.g., -std=gnu++11 is specified with CXX11STD.
configure now tests for a C++14-compliant compiler by testing some basic features. This by default tries flags for the compiler specified by CXX11, but an alternative compiler, options and standard can be specified by variables CXX14, CXX14FLAGS and CXX14STD (e.g., -std=gnu++14).
There is a new macro CXXSTD to help specify the standard for C++ code, e.g. -std=c++98. This makes it easier to work with compilers which default to a later standard: for example, with CXX=g++6 CXXSTD=-std=c++98 configure will select commands for g++ 6.x which conform to C++11 and C++14 where specified but otherwise use C++98.
It seems CXX1X is no longer accepted by R 3.4 version. Will have to double check this.
CENTOS 7 compiler also gives error on a bunch of packages based on Makeconf patch gcc/g++ parameters :
gcc: error: unrecognized command line option '-Wdate-time'
Please confirm if next MRO release will be the 3.4.1 version. If so then this will be ~1 month after CRAN R 3.4.1 release?
from microsoft-r-open.
Same problem on ubuntu 14.04 cant install fst package
Error in .shlib_internal(args) :
C++11 standard requested but CXX11 is not defined
- removing ‘/usr/lib64/microsoft-r/3.4/lib64/R/library/fst’
from microsoft-r-open.
I have the same issue on Red Hat Enterprise Linux 7.3. The OS is fully updated. In my case I am attempting to install package xgboost.
installing *source* package ‘xgboost’ ...
package ‘xgboost’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
libs
Error in .shlib_internal(args) :
C++11 standard requested but CXX11 is not defined
removing ‘/usr/lib64/microsoft-r/3.4/lib64/R/library/xgboost’
GCC details.
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC)
from microsoft-r-open.
I'm running into the same problem when trying to install the feather package in MRO 3.4.0 on Red Hat Enterprise Linux 7.3:
Error in .shlib_internal(args) : C++11 standard requested but CXX11 is not defined
I tried updating the compiler flags according to the Makeconf.txt provided above but couldn't get it to work. There's no known workaround at this point, right?
from microsoft-r-open.
Thanks mjmg, I edited the Makeconf according to your instructions and it almost works. But eventually, it now throws the following error (when trying to install the feather package):
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status
make: *** [feather.so] Error 1
ERROR: compilation failed for package ‘feather’
Feels like I'm almost there. Do you have any more ideas for the workaround?
EDIT: Ignore that, I had a typo in one of the flag names despite double-checking everything twice. mjmg's solution works for me as well.
from microsoft-r-open.
@bgreve Package feather installs fine on my CENTOS7 docker container and FEDORA 25 host
from microsoft-r-open.
Same problem on SLES12 and installing shiny. @mjmg solution works!
from microsoft-r-open.
I'm getting the same error while installing ITKR using the following command.
devtools::install_github( "stnava/ITKR" )
...
** libs
Error in .shlib_internal(args) :
C++11 standard requested but CXX11 is not defined
- removing ‘/home/ysk/R/x86_64-pc-linux-gnu-library/3.3/ITKR’
Installation failed: run(bin, args = real_cmdargs, stdout_line_callback = real_callback(stdout), stderr_line_callback = real_callback(stderr), stdout_callback = real_block_callback, stderr_callback = real_block_callback, echo_cmd = echo, echo = show, spinner = spinner, error_on_status = fail_on_status, timeout = timeout) : System command error
However, I don't have Makeconf file in my /etc/ directory.
Is there any possible solution for me?
I'm using Ubuntu 16.04 & MRO 3.4
platform x86_64-pc-linux-gnu
arch x86_64
os linux-gnu
system x86_64, linux-gnu
status
major 3
minor 4.0
year 2017
month 04
day 21
svn rev 72570
language R
version.string R version 3.4.0 (2017-04-21)
nickname You Stupid Darkness
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial
from microsoft-r-open.
yo904, it's not in your /etc under root. Have you checked within your R_HOME directory for the etc directory, perhaps in one of the subfolders?
from microsoft-r-open.
Thank you for your comment. I found Makeconf at /etc/R/.
Although I changed the Makeconf file, I get different error, which I don't know whether Makeconf is related or not.
-- Installing: /usr/local/lib/R/site-library/ITKR/libs/lib/libitkMGHIO-4.12.a
make[1]: Leaving directory '/tmp/RtmpStZg1m/devtoolsd242575b402/stnava-ITKR-f071cb1/src/itkb'
-L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o ITKR.so dummy.o -L/usr/lib/R/lib -lR
/bin/bash: line 2: -L/usr/lib/R/lib: No such file or directory
/usr/share/R/share/make/shlib.mk:6: recipe for target 'ITKR.so' failed
make: *** [ITKR.so] Error 127
ERROR: compilation failed for package ‘ITKR’
- removing ‘/usr/local/lib/R/site-library/ITKR’
Installation failed: Command failed (1)
from microsoft-r-open.
This error re-appears with install.packages("forecast") on MRO 3.4.1, Ubuntu 16.04, on the "RcppArmadillo" install. It turns out that
package ‘RccpArmadillo’ is not available (for R version 3.4.1)
Work arounds?
from microsoft-r-open.
shiny
is one of the most popular packages in R, and the package httpuv
is one of its dependencies.
When try install httpuv
:
install.packages('httpuv')
It comes to:
Installing package into ‘/home/ysun/R/x86_64-pc-linux-gnu-library/3.3’
(as ‘lib’ is unspecified)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 417k 100 417k 0 0 158k 0 0:00:02 0:00:02 --:--:-- 158k
* installing *source* package ‘httpuv’ ...
** package ‘httpuv’ successfully unpacked and MD5 sums checked
** libs
Error in .shlib_internal(args) :
C++11 standard requested but CXX11 is not defined
* removing ‘/home/ysun/R/x86_64-pc-linux-gnu-library/3.3/httpuv’
Warning in install.packages :
installation of package ‘httpuv’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpGN8vxY/downloaded_packages’
So it seems C++11 standard requested but CXX11 is not defined
error has confused us for long time. If it is a bug in MRO, can anyone fix it?
from microsoft-r-open.
This issue also reproducible in CentOS 7.
from microsoft-r-open.
This issue seems to be fixed in MRO 3.4.2
${R_HOME}/etc/Makeconf gives:
CXX11 = g++
CXX11FLAGS = -DU_STATIC_IMPLEMENTATION -g -O2
CXX11PICFLAGS = -fpic
CXX11STD = -std=gnu++11
CXX14 =
CXX14FLAGS =
CXX14PICFLAGS =
CXX14STD =
CXX17 =
CXX17FLAGS =
CXX17PICFLAGS =
CXX17STD =
SHLIB_CFLAGS =
SHLIB_CXXFLAGS =
SHLIB_CXXLD = $(CXX)
SHLIB_CXXLDFLAGS = -shared
SHLIB_CXX98LD = $(CXX98) $(CXX98STD)
SHLIB_CXX98LDFLAGS = -shared
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared
SHLIB_CXX14LD = $(CXX14) $(CXX14STD)
SHLIB_CXX14LDFLAGS = -shared
SHLIB_CXX17LD = $(CXX17) $(CXX17STD)
SHLIB_CXX17LDFLAGS = -shared
## legacy
CXX1X = g++
CXX1XFLAGS = -g -O2
CXX1XPICFLAGS = -fpic
CXX1XSTD = -std=gnu++11
SHLIB_CXX1XLD = $(CXX11) $(CXX11STD)
SHLIB_CXX1XLDFLAGS = -shared
from microsoft-r-open.
from microsoft-r-open.
this issue is happening on HDInsight (ubuntu 16.4, Microsoft Machine Learning Server 1.5.0). It is funny Microsoft has changed the name of the product once or twice since rhis bug was reported, however the bug is still here :)
from microsoft-r-open.
Any solution to this issue? I have a Microsoft R Enterprise 9.2 (Machine Learning Server) running on Azure Ubuntu VM and we are facing this issue with R and C++11 when try to install Prophet (Facebook Forecasting Library)
Best regards.
from microsoft-r-open.
from microsoft-r-open.
emmm.....,i solve this problem by finding {R_HOME}. in my system it is /usr/lib/R , thank you @mjmg
from microsoft-r-open.
Related Issues (20)
- Support for Ubuntu 20.04 HOT 2
- MRO 4.0.2 Rscript.exe displays initial messages HOT 4
- Was MRAN down last night?
- CRAN snapshots are missing from MRAN HOT 2
- Unable to install Rsamtools
- Is a new release of "Microsoft R open" planned soon? HOT 1
- Build R4.1.1 with MKL multithreading
- MRAN Time Machine and Microsoft CRAN Down...
- OSS vulnerabilities
- MRAN down again and again and again HOT 8
- cran.microsoft.com mirror down
- MRAN Time machine for R Open 3.3.3 is DOWN HOT 1
- MRAN down again... HOT 2
- Expired Certificates on mran causing failures
- Microsoft R Open Discontinuation
- https://mran.microsoft.com/timemachine is not working and critically impacting our business
- This repo is missing a LICENSE file
- This repo is missing important files HOT 1
- mran site down again
- can't reach https://cran.microsoft.com/snapshot/ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft-r-open.