Error installing rstanarm and compiling stan code on cluster with Intel compiler

I’m trying to install rstanarm 2.18.2 on supercomputer system and I’m encountering errors when installing.

/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/rev/scal/meta/operands_and_partials.hpp(64): error: more than one partial specialization matches thetemplate argument list of class "stan::math::internal::ops_partials_edge<double, Eigen::Matrix<stan::math::var, -1, 1, 0, -1, 1>>"
            "stan::math::internal::ops_partials_edge<double, Eigen::Matrix<stan::math::var, R, C, <expression>, R, C>>"
            "stan::math::internal::ops_partials_edge<ViewElt, Eigen::Matrix<Op, R, C, <expression>, R,C>>"
    internal::ops_partials_edge<double, Op2> edge2_;
                                            ^

Does anyone have an idea of what might be causing this? I’ve read elsewhere on this board that the Intel compiler can cause some challenges. The cluster defaults to icpc, and while switching to gcc is possible, it disables the R installation.

I was able to install rstan and shinystan without much difficulty (though I haven’t tried running anything with them yet).

  • Operating System: SuSE 11 (Cray Linux Environment 6)
  • rstanarm Version: 2.18.2

Full installation log:

* installing *source* package ‘rstanarm’ ...
** package ‘rstanarm’ successfully unpacked and MD5 sums checked
** libs
"/opt/apps/intel18/cray_mpich_7_7/Rstats/3.5.1/lib64/R/bin/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/jm.stan
Wrote C++ file "stan_files/jm.cc"


icpc  -I"/opt/apps/intel18/cray_mpich_7_7/Rstats/3.5.1/lib64/R/include" -DNDEBUG -I"../inst/include" -I"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=errno_on_error -I"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include" -I"/opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include" -I"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/BH/include" -I"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/Rcpp/include" -I"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include" -fPIC -qopenmp -mkl=parallel -O3 -xAVX -axCORE-AVX2  -L/opt/intel/compilers_and_libraries_2018.2.199/linux/mkl/lib/intel64 -lmkl_rt -I/include     -O3 -march=native -mtune=native -fPIC -c stan_files/jm.cc -o stan_files/jm.o
icpc: command line warning #10121: overriding '-xAVX' with '-march=native'
In file included from /opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/src/stan/services/optimize/bfgs.hpp(11),
                 from /opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp(35),
                 from /opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/rstaninc.hpp(3),
                 from stan_files/jm.hpp(18),
                 from stan_files/jm.cc(3):
/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/src/stan/optimization/bfgs.hpp(113): warning #858: type qualifier on return type is meaningless
        const size_t iter_num() const { return _itNum; }
        ^

In file included from /opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp(56),
                 from /opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/rstaninc.hpp(3),
                 from stan_files/jm.hpp(18),
                 from stan_files/jm.cc(3):
/opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/sum_values.hpp(41): warning #858: type qualifier on return type is meaningless
      const size_t called() const {
      ^

In file included from /opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp(56),
                 from /opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/rstaninc.hpp(3),
                 from stan_files/jm.hpp(18),
                 from stan_files/jm.cc(3):
/opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/sum_values.hpp(45): warning #858: type qualifier on return type is meaningless
      const size_t recorded() const {
      ^

/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/products/GeneralMatrixMatrix.h(230): warning #2196: routine is both "inline" and "noinline"
                m_actualAlpha, m_blocking, info);
                                                ^
          detected during:
            instantiation of "void Eigen::internal::gemm_functor<Scalar, Index, Gemm, Lhs, Rhs, Dest, BlockingType>::operator()(Index, Index, Index, Index, Eigen::internal::GemmParallelInfo<Index> *) const[with Scalar=stan::math::var, Index=Eigen::Index={std::ptrdiff_t={long}}, Gemm=Eigen::internal::general_matrix_matrix_product<Eigen::Index={std::ptrdiff_t={long}}, stan::math::var, 0, false, stan::math::var, 0, false, 0>, Lhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>,
                      Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Dest=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, BlockingType=Eigen::internal::gemm_blocking_space<0, stan::math::var, stan::math::var, -1, -1, -1, 1, false>]" at line 124 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/products/Parallelizer.h"
            instantiation of "void Eigen::internal::parallelize_gemm<Condition,Functor,Index>(const Functor &, Index, Index, Index, bool) [with Condition=true, Functor=Eigen::internal::gemm_functor<stan::math::var, Eigen::Index={std::ptrdiff_t={long}}, Eigen::internal::general_matrix_matrix_product<Eigen::Index={std::ptrdiff_t={long}}, stan::math::var, 0, false, stan::math::var, 0, false, 0>, Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>,
                      Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, stan::math::var, stan::math::var, -1, -1, -1, 1, false>>, Index=Eigen::Index={std::ptrdiff_t={long}}]" at line 484
            instantiation of "void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 8>::scaleAndAddTo(Dest &, const Lhs &, const Rhs &, const Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 8>::Scalar &) [with Lhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Dest=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 435
            instantiation of "void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 8>::evalTo(Dst &, const Lhs &, const Rhs &) [with Lhs=Eigen::Matrix<stan::math::var,-1, -1, 0, -1, -1>, Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Dst=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 148 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h"
            instantiation of "void Eigen::internal::Assignment<DstXprType, Eigen::Product<Lhs, Rhs, Options>, Eigen::internal::assign_op<Scalar, Scalar>, Eigen::internal::Dense2Dense, Eigen::internal::enable_if<<expression>, void>::type>::run(DstXprType &, const Eigen::internal::Assignment<DstXprType, Eigen::Product<Lhs, Rhs, Options>, Eigen::internal::assign_op<Scalar, Scalar>, Eigen::internal::Dense2Dense,Eigen::internal::enable_if<<expression>, void>::type>::SrcXprType &, const
                      Eigen::internal::assign_op<Scalar, Scalar> &) [with DstXprType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Lhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Options=0, Scalar=stan::math::var]" at line 836 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/AssignEvaluator.h"
            [ 3 instantiation contexts not shown ]
            instantiation of "Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const Eigen::EigenBase<OtherDerived> &) [with _Scalar=stan::math::var, _Rows=-1, _Cols=-1, _Options=0, _MaxRows=-1, _MaxCols=-1, OtherDerived=Eigen::Product<Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, 0>]" at line 69 of
                      "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/MatrixExponential.h"
            instantiation of "void Eigen::matrix_exp_pade3(const MatrixType &, MatrixType &, MatrixType &) [with MatrixType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 190 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/MatrixExponential.h"
            instantiation of "void Eigen::matrix_exp_computeUV<MatrixType, Eigen::NumTraits<Eigen::internal::traits<MatrixType>::Scalar>::Real>::run(const MatrixType &, MatrixType &, MatrixType &, int &, T) [with MatrixType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, T=stan::math::var]" at line 23 of"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp_pade.hpp"
            instantiation of "MatrixType stan::math::matrix_exp_pade(const MatrixType &) [with MatrixType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 30 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp.hpp"
            instantiation of "Eigen::Matrix<T, -1, -1, 0, -1, -1> stan::math::matrix_exp(const Eigen::Matrix<T, -1, -1, 0, -1, -1> &) [with T=stan::math::var]" at line 71 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/rev/mat/fun/matrix_exp_multiply.hpp"

/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/rev/mat/fun/Eigen_NumTraits.hpp(223): warning #2196: routine is both "inline" and "noinline"
                               &res[i * resStride], 1, alpha);
                                                             ^
          detected during:
            instantiation of "void Eigen::internal::general_matrix_matrix_product<Index, stan::math::var, LhsStorageOrder, ConjugateLhs, stan::math::var, RhsStorageOrder, ConjugateRhs, 0>::run(Index, Index, Index, const Eigen::internal::general_matrix_matrix_product<Index, stan::math::var, LhsStorageOrder, ConjugateLhs, stan::math::var, RhsStorageOrder, ConjugateRhs, 0>::LhsScalar *, Index, const Eigen::internal::general_matrix_matrix_product<Index, stan::math::var, LhsStorageOrder,
                      ConjugateLhs, stan::math::var, RhsStorageOrder, ConjugateRhs, 0>::RhsScalar *, Index, Eigen::internal::general_matrix_matrix_product<Index, stan::math::var, LhsStorageOrder, ConjugateLhs, stan::math::var, RhsStorageOrder, ConjugateRhs, 0>::ResScalar *, Index, const Eigen::internal::general_matrix_matrix_product<Index, stan::math::var, LhsStorageOrder, ConjugateLhs, stan::math::var, RhsStorageOrder, ConjugateRhs, 0>::ResScalar &,
                      Eigen::internal::level3_blocking<stan::math::var, stan::math::var> &, Eigen::internal::GemmParallelInfo<Index> *) [with Index=Eigen::Index={std::ptrdiff_t={long}}, LhsStorageOrder=0, ConjugateLhs=false, RhsStorageOrder=0, ConjugateRhs=false]" at line 230 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/products/GeneralMatrixMatrix.h"
            instantiation of "void Eigen::internal::gemm_functor<Scalar, Index, Gemm, Lhs, Rhs, Dest, BlockingType>::operator()(Index, Index, Index, Index, Eigen::internal::GemmParallelInfo<Index> *) const[with Scalar=stan::math::var, Index=Eigen::Index={std::ptrdiff_t={long}}, Gemm=Eigen::internal::general_matrix_matrix_product<Eigen::Index={std::ptrdiff_t={long}}, stan::math::var, 0, false, stan::math::var, 0, false, 0>, Lhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>,
                      Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Dest=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, BlockingType=Eigen::internal::gemm_blocking_space<0, stan::math::var, stan::math::var, -1, -1, -1, 1, false>]" at line 124 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/products/Parallelizer.h"
            instantiation of "void Eigen::internal::parallelize_gemm<Condition,Functor,Index>(const Functor &, Index, Index, Index, bool) [with Condition=true, Functor=Eigen::internal::gemm_functor<stan::math::var, Eigen::Index={std::ptrdiff_t={long}}, Eigen::internal::general_matrix_matrix_product<Eigen::Index={std::ptrdiff_t={long}}, stan::math::var, 0, false, stan::math::var, 0, false, 0>, Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>,
                      Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Eigen::internal::gemm_blocking_space<0, stan::math::var, stan::math::var, -1, -1, -1, 1, false>>, Index=Eigen::Index={std::ptrdiff_t={long}}]" at line 484 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/products/GeneralMatrixMatrix.h"
            instantiation of "void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 8>::scaleAndAddTo(Dest &, const Lhs &, const Rhs &, const Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 8>::Scalar &) [with Lhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Dest=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 435 of
                      "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/products/GeneralMatrixMatrix.h"
            instantiation of "void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 8>::evalTo(Dst &, const Lhs &, const Rhs &) [with Lhs=Eigen::Matrix<stan::math::var,-1, -1, 0, -1, -1>, Rhs=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Dst=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 148 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h"
            [ 4 instantiation contexts not shown ]
            instantiation of "Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const Eigen::EigenBase<OtherDerived> &) [with _Scalar=stan::math::var, _Rows=-1, _Cols=-1, _Options=0, _MaxRows=-1, _MaxCols=-1, OtherDerived=Eigen::Product<Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, 0>]" at line 69 of
                      "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/MatrixExponential.h"
            instantiation of "void Eigen::matrix_exp_pade3(const MatrixType &, MatrixType &, MatrixType &) [with MatrixType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 190 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/MatrixExponential.h"
            instantiation of "void Eigen::matrix_exp_computeUV<MatrixType, Eigen::NumTraits<Eigen::internal::traits<MatrixType>::Scalar>::Real>::run(const MatrixType &, MatrixType &, MatrixType &, int &, T) [with MatrixType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>, T=stan::math::var]" at line 23 of"/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp_pade.hpp"
            instantiation of "MatrixType stan::math::matrix_exp_pade(const MatrixType &) [with MatrixType=Eigen::Matrix<stan::math::var, -1, -1, 0, -1, -1>]" at line 30 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/mat/fun/matrix_exp.hpp"
            instantiation of "Eigen::Matrix<T, -1, -1, 0, -1, -1> stan::math::matrix_exp(const Eigen::Matrix<T, -1, -1, 0, -1, -1> &) [with T=stan::math::var]" at line 71 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/rev/mat/fun/matrix_exp_multiply.hpp"

/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/rev/scal/meta/operands_and_partials.hpp(64): error: more than one partial specialization matches thetemplate argument list of class "stan::math::internal::ops_partials_edge<double, Eigen::Matrix<stan::math::var, -1, 1, 0, -1, 1>>"
            "stan::math::internal::ops_partials_edge<double, Eigen::Matrix<stan::math::var, R, C, <expression>, R, C>>"
            "stan::math::internal::ops_partials_edge<ViewElt, Eigen::Matrix<Op, R, C, <expression>, R,C>>"
    internal::ops_partials_edge<double, Op2> edge2_;
                                             ^
          detected during:
            instantiation of class "stan::math::operands_and_partials<Op1, Op2, Op3, Op4, Op5, stan::math::var> [with Op1=Eigen::Matrix<double, -1, 1, 0, -1, 1>, Op2=Eigen::Matrix<stan::math::var, -1, 1, 0, -1, 1>, Op3=stan::math::var, Op4=double, Op5=double]" at line 68 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/scal/prob/normal_lpdf.hpp"
            instantiation of "stan::return_type<T_y, T_loc, T_scale, double, double, double>::type stan::math::normal_lpdf<propto,T_y,T_loc,T_scale>(const T_y &, const T_loc &, const T_scale &) [with propto=false, T_y=Eigen::Matrix<double, -1, 1, 0, -1, 1>, T_loc=Eigen::Matrix<stan::math::var, -1, 1, 0, -1,1>, T_scale=stan::math::var]" at line 118 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/scal/prob/normal_lpdf.hpp"
            instantiation of "stan::return_type<T_y, T_loc, T_scale, double, double, double>::type stan::math::normal_lpdf(const T_y &, const T_loc &, const T_scale &) [with T_y=Eigen::Matrix<double, -1, 1, 0, -1, 1>, T_loc=Eigen::Matrix<stan::math::var, -1, 1, 0, -1, 1>, T_scale=stan::math::var]" at line 43 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/stan/math/prim/scal/prob/normal_log.hpp"
            instantiation of "stan::return_type<T_y, T_loc, T_scale, double, double, double>::type stan::math::normal_log(const T_y &, const T_loc &, const T_scale &) [with T_y=Eigen::Matrix<double, -1, 1,0, -1, 1>, T_loc=Eigen::Matrix<stan::math::var, -1, 1, 0, -1, 1>, T_scale=stan::math::var]" at line 3489 of "stan_files/jm.hpp"
            instantiation of "void model_jm_namespace::glm_lp(const Eigen::Matrix<T0__, -1, 1, 0, -1, 1> &, const std::vector<int, std::allocator<int>> &, const Eigen::Matrix<T2__, -1, 1, 0, -1, 1> &, const std::vector<T3__, std::allocator<T3__>> &, const int &, const int &, const T6__ &, const Eigen::Matrix<T7__, -1, 1, 0, -1, 1> &, const Eigen::Matrix<T8__, -1, 1, 0, -1, 1> &, T_lp__ &, T_lp_accum__ &, std::ostream *) [with T0__=double, T2__=stan::math::var, T3__=stan::math::var, T6__=double,
                      T7__=double, T8__=double, T_lp__=stan::math::var, T_lp_accum__=stan::math::accumulator<stan::math::var>]" at line 9498 of "stan_files/jm.hpp"
            instantiation of "T__ model_jm_namespace::model_jm::log_prob<propto__,jacobian__,T__>(std::vector<T__, std::allocator<T__>> &, std::vector<int, std::allocator<int>> &, std::ostream *) const [with propto__=true, jacobian__=true, T__=stan::math::var]" at line 46 of "/opt/tacc_mounts/apps/intel18/cray_mpich_7_7/RstatsPackages/3.5.1/packages/StanHeaders/include/src/stan/model/log_prob_propto.hpp"
            instantiation of "double stan::model::log_prob_propto<jacobian_adjust_transform,M>(const M&, std::vector<double, std::allocator<double>> &, std::vector<int, std::allocator<int>> &, std::ostream *) [with jacobian_adjust_transform=true, M=stan_model]" at line 1121 of "/opt/tacc_mounts/home1/04386/crpeters/R/x86_64-pc-linux-gnu-library/3.5/rstan/include/rstan/stan_fit.hpp"
            instantiation of "SEXP rstan::stan_fit<Model, RNG_t>::log_prob(SEXP, SEXP, SEXP) [with Model=stan_model, RNG_t=boost::random::ecuyer1988]" at line 22 of "stan_files/jm.cc"
compilation aborted for stan_files/jm.cc (code 2)
/opt/apps/intel18/cray_mpich_7_7/Rstats/3.5.1/lib64/R/etc/Makeconf:166: recipe for target 'stan_files/jm.o' failed
make: *** [stan_files/jm.o] Error 2

Can you try setting the necessary flags in your ~/.R/Makefile to make icpc go into gcc compatibility mode? I forget what they are but they exist.

The compiler appears to be in comparability mode already; icpc -v returns icpc version 18.0.2 (gcc version 6.3.0 compatibility)
I don’t know much about compiler flags, but I believe the Intel documentation suggests that this is what I should get with gcc support enabled.

My Makevars file looks like:

CXXFLAGS=-03
CXX_STD=CXX14
CXX=icpc
CXX14=icpc
CXX14FLAGS=-03 -march=native -mtune=native
CXX14FLAGS += -fPIC

Does example("stan_model", package = "rstan", run_dontrun = TRUE) work?

It appears that compiling the model fails.

> example("stan_model", package = "rstan", run.dontrun = TRUE)

stn_md> stancode <- 'data {real y_mean;} parameters {real y;} model {y ~ normal(y_mean,1);}'

stn_md> mod <- stan_model(model_code = stancode)

Wed Dec 26 12:39:30 2018: [unset]:_pmi_alps_init:alps_get_placement_info returned with error -1
Wed Dec 26 12:39:30 2018: [unset]:_pmi_init:_pmi_alps_init returned -1

stn_md> fit <- sampling(mod, data = list(y_mean = 0))

*** caught segfault ***
  address 0x20, cause 'memory not mapped'

Traceback:
  1: Module(module, mustStart = TRUE)
2: .getModulePointer(x)
3: new("Module", .xData = <environment>)$stan_fit4modelb1d47b3b8dfc_16a540c6086086816528e4524def24d9
4: new("Module", .xData = <environment>)$stan_fit4modelb1d47b3b8dfc_16a540c6086086816528e4524def24d9
5: eval(call("$", mod, paste("stan_fit4", model_cppname, sep = "")))
6: eval(call("$", mod, paste("stan_fit4", model_cppname, sep = "")))
7: object@mk_cppmodule(object)
8: .local(object, ...)
9: sampling(mod, data = list(y_mean = 0))
10: sampling(mod, data = list(y_mean = 0))
11: eval(ei, envir)
12: eval(ei, envir)
13: withVisible(eval(ei, envir))
14: source(tf, local, echo = echo, prompt.echo = paste0(prompt.prefix,     getOption("prompt")), continue.echo = paste0(prompt.prefix,     getOption("continue")), verbose = verbose, max.deparse.length = Inf,     encoding = "UTF-8", skip.echo = skips, keep.source = TRUE)
15: example("stan_model", package = "rstan", run.dontrun = TRUE)

Possible actions:
  1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace

It looks like you need to (re)compile Rcpp with the same compiler settings.

Recompiling Rcpp (and RcppEigen) didn’t seem to change anything. Do you know if there are any other packages that may need to be compiled with the same options? A lot of the commonly used packages (e.g., Rcpp, tidyverse) came pre-installed with they system.

Also, thank you for the help you’ve provided so far.

Any chance threading is involved? I only had this error when trying to use threading:

https://github.com/stan-dev/cmdstan/issues/625