Skip to content

An installation error: 'Expected in: flat namespace' #224

@sentian

Description

@sentian

I got a bunch of warnings and an error when installing the package from source (details below). I'm on Mac OS 10.13.4 and R 3.5.0.

* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
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 /usr/local/bin/g++-8 accepts -g... yes
checking how to run the C++ preprocessor... /usr/local/bin/g++-8 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether /usr/local/bin/g++-8 accepts -g... (cached) yes
checking whether g++ version is sufficient... yes, with OpenMP as version 8.1.0
checking for macOS... found
checking for macOS Apple compiler... not found
checking LAPACK_LIBS... R-supplied partial LAPACK found
configure: WARNING: Some complex-valued LAPACK functions may not be available
checking for OpenMP... found and suitable
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
/usr/local/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include  -I../inst/include -fopenmp -fPIC  -Wall -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:76,
                 from ../inst/include/RcppArmadilloForward.h:26,
                 from ../inst/include/RcppArmadillo.h:31,
                 from RcppArmadillo.cpp:22:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/sprintf.h: In function 'std::__cxx11::string Rcpp::sprintf(const char*, ...)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/sprintf.h:30:12: warning: unnecessary parentheses in declaration of 'ap' [-Wparentheses]
     va_list(ap);
            ^
/usr/local/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include  -I../inst/include -fopenmp -fPIC  -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:76,
                 from ../inst/include/RcppArmadilloForward.h:26,
                 from ../inst/include/RcppArmadillo.h:31,
                 from RcppExports.cpp:4:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/sprintf.h: In function 'std::__cxx11::string Rcpp::sprintf(const char*, ...)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/sprintf.h:30:12: warning: unnecessary parentheses in declaration of 'ap' [-Wparentheses]
     va_list(ap);
            ^
/usr/local/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include" -I/usr/local/include  -I../inst/include -fopenmp -fPIC  -Wall -g -O2 -c fastLm.cpp -o fastLm.o
In file included from /Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/RcppCommon.h:76,
                 from ../inst/include/RcppArmadilloForward.h:26,
                 from ../inst/include/RcppArmadillo.h:31,
                 from fastLm.cpp:22:
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/sprintf.h: In function 'std::__cxx11::string Rcpp::sprintf(const char*, ...)':
/Library/Frameworks/R.framework/Versions/3.5/Resources/library/Rcpp/include/Rcpp/sprintf.h:30:12: warning: unnecessary parentheses in declaration of 'ap' [-Wparentheses]
     va_list(ap);
            ^
In file included from ../inst/include/armadillo:683,
                 from ../inst/include/RcppArmadilloForward.h:46,
                 from ../inst/include/RcppArmadillo.h:31,
                 from fastLm.cpp:22:
../inst/include/armadillo_bits/glue_times_meat.hpp: In instantiation of 'static void arma::glue_times_redirect2_helper<do_inv_detect>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Mat<double>; T2 = arma::Col<double>; bool do_inv_detect = false; typename T1::elem_type = double]':
../inst/include/armadillo_bits/glue_times_meat.hpp:112:44:   required from 'static void arma::glue_times_redirect2_helper<true>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Mat<double>; T2 = arma::Col<double>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/glue_times_meat.hpp:347:74:   required from 'static void arma::glue_times_redirect<2>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Mat<double>; T2 = arma::Col<double>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/glue_times_meat.hpp:441:36:   required from 'static void arma::glue_times::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Mat<double>; T2 = arma::Col<double>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/Mat_meat.hpp:4972:19:   required from 'arma::Mat<eT>::Mat(const arma::Glue<T1, T2, glue_type>&) [with T1 = arma::Mat<double>; T2 = arma::Col<double>; glue_type = arma::glue_times; eT = double]'
../inst/include/armadillo_bits/Proxy.hpp:607:10:   required from 'arma::Proxy<arma::Glue<T1, T2, glue_type> >::Proxy(const arma::Glue<T1, T2, glue_type>&) [with T1 = arma::Mat<double>; T2 = arma::Col<double>; glue_type = arma::glue_times]'
../inst/include/armadillo_bits/eGlue_meat.hpp:35:12:   required from 'arma::eGlue<T1, T2, eglue_type>::eGlue(const T1&, const T2&) [with T1 = arma::Col<double>; T2 = arma::Glue<arma::Mat<double>, arma::Col<double>, arma::glue_times>; eglue_type = arma::eglue_minus]'
../inst/include/armadillo_bits/operator_minus.hpp:134:10:   required from 'typename arma::enable_if2<((arma::is_arma_type<T1>::value && arma::is_arma_type<T2>::value) && arma::is_same_type<typename T1::elem_type, typename T2::elem_type>::value), const arma::eGlue<T1, T2, arma::eglue_minus> >::result arma::operator-(const T1&, const T2&) [with T1 = arma::Col<double>; T2 = arma::Glue<arma::Mat<double>, arma::Col<double>, arma::glue_times>; typename arma::enable_if2<((arma::is_arma_type<T1>::value && arma::is_arma_type<T2>::value) && arma::is_same_type<typename T1::elem_type, typename T2::elem_type>::value), const arma::eGlue<T1, T2, arma::eglue_minus> >::result = const arma::eGlue<arma::Col<double>, arma::Glue<arma::Mat<double>, arma::Col<double>, arma::glue_times>, arma::eglue_minus>]'
fastLm.cpp:30:31:   required from here
../inst/include/armadillo_bits/glue_times_meat.hpp:39:14: warning: variable 'use_alpha' set but not used [-Wunused-but-set-variable]
   const bool use_alpha = partial_unwrap<T1>::do_times || partial_unwrap<T2>::do_times;
              ^~~~~~~~~
../inst/include/armadillo_bits/glue_times_meat.hpp: In instantiation of 'static void arma::glue_times_redirect2_helper<do_inv_detect>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Glue<arma::Mat<double>, arma::Op<arma::Col<double>, arma::op_diagmat>, arma::glue_times_diag>; T2 = arma::Op<arma::Mat<double>, arma::op_htrans>; bool do_inv_detect = false; typename T1::elem_type = double]':
../inst/include/armadillo_bits/glue_times_meat.hpp:112:44:   required from 'static void arma::glue_times_redirect2_helper<true>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Glue<arma::Mat<double>, arma::Op<arma::Col<double>, arma::op_diagmat>, arma::glue_times_diag>; T2 = arma::Op<arma::Mat<double>, arma::op_htrans>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/glue_times_meat.hpp:347:74:   required from 'static void arma::glue_times_redirect<2>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Glue<arma::Mat<double>, arma::Op<arma::Col<double>, arma::op_diagmat>, arma::glue_times_diag>; T2 = arma::Op<arma::Mat<double>, arma::op_htrans>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/glue_times_meat.hpp:441:36:   required from 'static void arma::glue_times::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Glue<arma::Mat<double>, arma::Op<arma::Col<double>, arma::op_diagmat>, arma::glue_times_diag>; T2 = arma::Op<arma::Mat<double>, arma::op_htrans>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/Mat_meat.hpp:4989:19:   required from 'arma::Mat<eT>& arma::Mat<eT>::operator=(const arma::Glue<T1, T2, glue_type>&) [with T1 = arma::Glue<arma::Mat<double>, arma::Op<arma::Col<double>, arma::op_diagmat>, arma::glue_times_diag>; T2 = arma::Op<arma::Mat<double>, arma::op_htrans>; glue_type = arma::glue_times; eT = double]'
../inst/include/armadillo_bits/op_pinv_meat.hpp:128:11:   required from 'static bool arma::op_pinv::apply_direct(arma::Mat<typename T1::elem_type>&, const arma::Base<typename T1::elem_type, T1>&, typename T1::pod_type, bool) [with T1 = arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>; typename T1::elem_type = double; typename T1::pod_type = double]'
../inst/include/armadillo_bits/op_pinv_meat.hpp:36:44:   [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
../inst/include/armadillo_bits/Mat_meat.hpp:4593:17:   required from 'arma::Mat<eT>::Mat(const arma::Op<T1, op_type>&) [with T1 = arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>; op_type = arma::op_diagvec; eT = double]'
../inst/include/armadillo_bits/Proxy.hpp:1121:10:   required from 'arma::Proxy_diagvec_expr<arma::Op<T1, arma::op_diagvec> >::Proxy_diagvec_expr(const arma::Op<T1, arma::op_diagvec>&) [with T1 = arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>]'
../inst/include/armadillo_bits/Proxy.hpp:1168:22:   required from 'arma::Proxy<arma::Op<T1, arma::op_diagvec> >::Proxy(const arma::Op<T1, arma::op_diagvec>&) [with T1 = arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>]'
../inst/include/armadillo_bits/eOp_meat.hpp:36:15:   required from 'arma::eOp<T1, eop_type>::eOp(const T1&, typename T1::elem_type) [with T1 = arma::Op<arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>, arma::op_diagvec>; eop_type = arma::eop_scalar_times; typename T1::elem_type = double]'
../inst/include/armadillo_bits/operator_times.hpp:45:10:   required from 'typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::eOp<T1, arma::eop_scalar_times> >::result arma::operator*(typename T1::elem_type, const T1&) [with T1 = arma::Op<arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>, arma::op_diagvec>; typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::eOp<T1, arma::eop_scalar_times> >::result = const arma::eOp<arma::Op<arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>, arma::op_diagvec>, arma::eop_scalar_times>; typename T1::elem_type = double]'
fastLm.cpp:35:86:   required from here
../inst/include/armadillo_bits/glue_times_meat.hpp:39:14: warning: variable 'use_alpha' set but not used [-Wunused-but-set-variable]
../inst/include/armadillo_bits/glue_times_meat.hpp: In instantiation of 'static void arma::glue_times_redirect2_helper<do_inv_detect>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Op<arma::Mat<double>, arma::op_htrans>; T2 = arma::Mat<double>; bool do_inv_detect = false; typename T1::elem_type = double]':
../inst/include/armadillo_bits/glue_times_meat.hpp:112:44:   required from 'static void arma::glue_times_redirect2_helper<true>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Op<arma::Mat<double>, arma::op_htrans>; T2 = arma::Mat<double>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/glue_times_meat.hpp:347:74:   required from 'static void arma::glue_times_redirect<2>::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Op<arma::Mat<double>, arma::op_htrans>; T2 = arma::Mat<double>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/glue_times_meat.hpp:441:36:   required from 'static void arma::glue_times::apply(arma::Mat<typename T1::elem_type>&, const arma::Glue<T1, T2, arma::glue_times>&) [with T1 = arma::Op<arma::Mat<double>, arma::op_htrans>; T2 = arma::Mat<double>; typename T1::elem_type = double]'
../inst/include/armadillo_bits/Mat_meat.hpp:4972:19:   required from 'arma::Mat<eT>::Mat(const arma::Glue<T1, T2, glue_type>&) [with T1 = arma::Op<arma::Mat<double>, arma::op_htrans>; T2 = arma::Mat<double>; glue_type = arma::glue_times; eT = double]'
../inst/include/armadillo_bits/Proxy.hpp:607:10:   required from 'arma::Proxy<arma::Glue<T1, T2, glue_type> >::Proxy(const arma::Glue<T1, T2, glue_type>&) [with T1 = arma::Op<arma::Mat<double>, arma::op_htrans>; T2 = arma::Mat<double>; glue_type = arma::glue_times]'
../inst/include/armadillo_bits/op_pinv_meat.hpp:58:19:   [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
../inst/include/armadillo_bits/Mat_meat.hpp:4593:17:   required from 'arma::Mat<eT>::Mat(const arma::Op<T1, op_type>&) [with T1 = arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>; op_type = arma::op_diagvec; eT = double]'
../inst/include/armadillo_bits/Proxy.hpp:1121:10:   required from 'arma::Proxy_diagvec_expr<arma::Op<T1, arma::op_diagvec> >::Proxy_diagvec_expr(const arma::Op<T1, arma::op_diagvec>&) [with T1 = arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>]'
../inst/include/armadillo_bits/Proxy.hpp:1168:22:   required from 'arma::Proxy<arma::Op<T1, arma::op_diagvec> >::Proxy(const arma::Op<T1, arma::op_diagvec>&) [with T1 = arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>]'
../inst/include/armadillo_bits/eOp_meat.hpp:36:15:   required from 'arma::eOp<T1, eop_type>::eOp(const T1&, typename T1::elem_type) [with T1 = arma::Op<arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>, arma::op_diagvec>; eop_type = arma::eop_scalar_times; typename T1::elem_type = double]'
../inst/include/armadillo_bits/operator_times.hpp:45:10:   required from 'typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::eOp<T1, arma::eop_scalar_times> >::result arma::operator*(typename T1::elem_type, const T1&) [with T1 = arma::Op<arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>, arma::op_diagvec>; typename arma::enable_if2<arma::is_arma_type<T1>::value, const arma::eOp<T1, arma::eop_scalar_times> >::result = const arma::eOp<arma::Op<arma::Op<arma::Glue<arma::Op<arma::Mat<double>, arma::op_htrans>, arma::Mat<double>, arma::glue_times>, arma::op_pinv>, arma::op_diagvec>, arma::eop_scalar_times>; typename T1::elem_type = double]'
fastLm.cpp:35:86:   required from here
../inst/include/armadillo_bits/glue_times_meat.hpp:39:14: warning: variable 'use_alpha' set but not used [-Wunused-but-set-variable]
/usr/local/bin/g++-8 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -fopenmp -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error: package or namespace load failed for ‘RcppArmadillo’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo/libs/RcppArmadillo.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo/libs/RcppArmadillo.so, 6): Symbol not found: __ZNKSt13random_device13_M_getentropyEv
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo/libs/RcppArmadillo.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo/libs/RcppArmadillo.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/RcppArmadillo’```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions