什么是设置我的环境变量错误?

时间:2016-07-07 04:50:35

标签: r ubuntu boost compilation include-path

当我尝试install.packages('readr')时,我会收到来自

的错误
clang++ -I/usr/local/lib/R/include -DNDEBUG -I/usr/local/lib/R/include
        -I/usr/local/include -I"/usr/local/lib/R/site-library/Rcpp/include"
        -I"/usr/local/lib/R/site-library/BH/include"
        -fpic  -g -O2  -O3 -fstack-protector --param=ssp-buffer-size=4
        -Wformat -Wformat-security -Werror=format-security 
        -D_FORTIFY_SOURCE=2 -g    -std=c++11
        -c Collector.cpp -o Collector.o

我正在检查~/.R/Makevars/etc/R/Makeconf是否可以设置此clang++ -I....命令但不包含该语言。

echo $CXX
echo $CC

都是空的,并且在开始R之前将它们设置为其他内容并没有帮助。开始R --no-environ也不会更改错误消息。

那么可以设置这些环境变量的位置,如何更改或禁用它们,以及如何在下一次从某个地方找出这个"全局变量"错误来自?

提前致谢。

1 个答案:

答案 0 :(得分:0)

我可能需要to add导出LIBRARY_PATH = / opt / boost_1_61_0 / boost / to my〜/ .bashrc`。

这不回答我的问题(关于如何清除clang来电),而是将CXX中的~/.R/Makevars值从clang++更改为g++确实修复了我无法安装readr的直接问题。

以下是clang下的构建错误:

In file included from Collector.cpp:4:
In file included from ./Collector.h:8:
In file included from ./Token.h:6:
In file included from ./Source.h:5:
In file included from ./boost.h:13:
In file included from /usr/local/lib/R/site-library/BH/include/boost/spirit/include/qi.hpp:16:
In file included from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi.hpp:14:
In file included from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/action.hpp:14:
In file included from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/action/action.hpp:14:
In file included from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/meta_compiler.hpp:14:
In file included from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/support/meta_compiler.hpp:19:
In file included from /usr/local/lib/R/site-library/BH/include/boost/proto/proto.hpp:12:
In file included from /usr/local/lib/R/site-library/BH/include/boost/proto/core.hpp:21:
In file included from /usr/local/lib/R/site-library/BH/include/boost/proto/fusion.hpp:22:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/include/intrinsic.hpp:11:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/sequence/intrinsic.hpp:23:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/sequence/intrinsic/swap.hpp:15:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/view/zip_view.hpp:12:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/view/zip_view/zip_view.hpp:16:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/view/zip_view/detail/begin_impl.hpp:14:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/algorithm/transformation/transform.hpp:11:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/view/transform_view/transform_view.hpp:22:
In file included from /usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector10.hpp:25:
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:261:61: error: 
      invalid use of 'this' outside of a nonstatic member function
            auto at_impl(J) -> decltype(at_detail<J::value>(this))
                                                            ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:262:13: error: 
      type name requires a specifier or qualifier
            {
            ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:262:13: error: 
      C++ requires a type specifier for all declarations
            {
            ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:261:13: error: 
      'auto' return without trailing return type
            auto at_impl(J) -> decltype(at_detail<J::value>(this))
            ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:268:67: error: 
      invalid use of 'this' outside of a nonstatic member function
            auto at_impl(J) const -> decltype(at_detail<J::value>(this))
                                                                  ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:269:13: error: 
      type name requires a specifier or qualifier
            {
            ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:269:13: error: 
      C++ requires a type specifier for all declarations
            {
            ^
/usr/local/lib/R/site-library/BH/include/boost/fusion/container/vector/vector.hpp:268:13: error: 
      'auto' return without trailing return type
            auto at_impl(J) const -> decltype(at_detail<J::value>(this))
            ^
8 errors generated.
make: *** [Collector.o] Error 1
ERROR: compilation failed for package ‘readr’

如果我使用g++代替clang++进行编译,则错误会成为警告:

In file included from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/is_dereferenceable.hpp:12:0,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/resolve.hpp:26,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/push.hpp:24,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:31,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/stream_buffer.hpp:22,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/stream.hpp:21,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream/detail/iterator_source.hpp:14,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream/stream.hpp:16,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream.hpp:15,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi.hpp:30,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/include/qi.hpp:16,
                 from boost.h:14,
                 from Source.h:5,
                 from Token.h:6,
                 from Collector.h:8,
                 from Collector.cpp:4:
/usr/local/lib/R/site-library/BH/include/boost/type_traits/detail/bool_trait_def.hpp:18:79: note: #pragma message: NOTE: Use of this header (bool_trait_def.hpp) is deprecated
 # pragma message("NOTE: Use of this header (bool_trait_def.hpp) is deprecated")
                                                                               ^
In file included from /usr/local/lib/R/site-library/BH/include/boost/type_traits/detail/bool_trait_def.hpp:21:0,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/is_dereferenceable.hpp:12,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/resolve.hpp:26,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/push.hpp:24,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:31,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/stream_buffer.hpp:22,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/stream.hpp:21,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream/detail/iterator_source.hpp:14,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream/stream.hpp:16,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream.hpp:15,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi.hpp:30,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/include/qi.hpp:16,
                 from boost.h:14,
                 from Source.h:5,
                 from Token.h:6,
                 from Collector.h:8,
                 from Collector.cpp:4:
/usr/local/lib/R/site-library/BH/include/boost/type_traits/detail/template_arity_spec.hpp:13:84: note: #pragma message: NOTE: Use of this header (template_arity_spec.hpp) is deprecated
 gma message("NOTE: Use of this header (template_arity_spec.hpp) is deprecated")
                                                                               ^
In file included from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/is_dereferenceable.hpp:13:0,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/resolve.hpp:26,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/push.hpp:24,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp:31,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/stream_buffer.hpp:22,
                 from /usr/local/lib/R/site-library/BH/include/boost/iostreams/stream.hpp:21,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream/detail/iterator_source.hpp:14,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream/stream.hpp:16,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi/stream.hpp:15,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/home/qi.hpp:30,
                 from /usr/local/lib/R/site-library/BH/include/boost/spirit/include/qi.hpp:16,
                 from boost.h:14,
                 from Source.h:5,
                 from Token.h:6,
                 from Collector.h:8,
                 from Collector.cpp:4:

(错误太长,粘贴在http://ix.io/11F0

所以两个编译器都不喜欢spiritfusion(用我选择的标志,我仍然无法弄清楚如何清理)。