C++14 standard requested but CXX14 is not defined

Zhongxu blog

C++14 standard requested but CXX14 is not defined

2021-09-09 

 Default Category

文章目录

在安装R包的时候遇到报错,C++14 standard requested but CXX14 is not defined

查了很多办法,刚开始是根据https://github.com/stan-dev/rstan/issues/892修改.R下面的Makevars,

但是包另外一个错g++: error: unrecognized command line option ‘-std=c++14’

于是继续查到c++1y这个问题,但依然没有解决问题。

复盘了一下,感觉是gcc的问题,所以升级了最新的gcc

1
2
3
4
# 系统是CentOS
sudo yum install centos-release-scl
sudo yum install devtoolset-10
scl enable devtoolset-10 bash

但是装包的时候新版的gcc依然不能别识别,所以修改Makevars,最终用了如下的配置,重点是指定了新版的g++和c++的路径,这样问题就解决了

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
MAKEFLAGS = -j18

## C++ flags
CXX=g++
CXX11=g++
CXX14=/opt/rh/devtoolset-9/root/usr/bin/g++
CXX17=g++

CXXFLAGS=-O3 -march=native -Wno-ignored-attributes
CXX11FLAGS=-O3 -march=native -Wno-ignored-attributes
CXX14FLAGS=-O3 -march=native -Wno-ignored-attributes
CXX17FLAGS=-O3 -march=native -Wno-ignored-attributes

CXXPICFLAGS=-fPIC
CXX11PICFLAGS=-fPIC
CXX14PICFLAGS=-fPIC
CXX17PICFLAGS=-fPIC

CXX11STD=-std=c++11
CXX14STD=-std=c++14
CXX17STD=-std=c++17

## C flags
CC=/opt/rh/devtoolset-10/root/usr/bin/gcc
FLAGS=-O3 -march=native

## Fortran flags
FC=gfortran
F77=gfortran
FFLAGS=-O3 -march=native
FCFLAGS=-O3 -march=native

总结: 1,upgrade gcc

2, specify the absolute gcc and g++ path

如果可以的话,建议把整个系统的gcc都替换成新版的

####################################################################

#版权所有 转载请告知 版权归作者所有 如有侵权 一经发现 必将追究其法律责任

#Author: Jason

#####################################################################

文章作者 zzx

来源

C++14 standard requested but CXX14 is not defined - Zhongxu blog

上次更新 2021-09-09

Linux

 肿瘤免疫表型-cold (excluded, desert) and hotTake only memories, leave only footprints 

  

由 Hugo 强力驱动 | 主题 - Even© 2012 - 2023zzx浙ICP备2022010110号 |浙公网安备 33010502007012号

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值