I have a stan file which compiles fine on my local laptop (Macbook, R 4.3.2, stan 2.32.2). But when I uploaded the stan file to server (I think it’s linux environment, R 4.3.1, stan 2.32.2), I couldn’t compile the file and got the following error message.
I noticed that the error message makes reference to this path: “/opt/apps/rhel8/R-4.3.1/lib64/R/lib”. However, this isn’t my R lib folder on the server. Rather it seems to be the admin’s R library folder. Instead, the other path that was also referenced is mine: “/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/RcppParallel/lib/”.
One other thing I noticed is … earelier I tried to remove rstan
and reinstall it. After I did remove.packages("rstan")
, and then if I use system.file("libs", package = "rstan")
to check, this other path “xxx/rhel8/xxx” would show up. It didn’t hinder me from re-installing rstan
and properly updated my stan version though …
I’m not sure whether this caused the problem, and if so how to resolve it. Any suggestions would be greatly appreciated. Thanks!
make cmd is
> make -f '/opt/apps/rhel8/R-4.3.1/lib64/R/etc/Makeconf' -f '/opt/apps/rhel8/R-4.3.1/lib64/R/share/make/shlib.mk' CXX='$(CXX17) $(CXX17STD)' CXXFLAGS='$(CXX17FLAGS)' CXXPICFLAGS='$(CXX17PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX17LDFLAGS)' SHLIB_LD='$(SHLIB_CXX17LD)' SHLIB='file27d1cb1e625e6c.so' OBJECTS='file27d1cb1e625e6c.o'
make would use
> g++ -std=gnu++17 -I"/opt/apps/rhel8/R-4.3.1/lib64/R/include" -DNDEBUG -I"/admin/apps/rhel8/R-4.3.1/lib64/R/library/Rcpp/include/" -I"/admin/apps/rhel8/R-4.3.1/lib64/R/library/RcppEigen/include/" -I"/admin/apps/rhel8/R-4.3.1/lib64/R/library/RcppEigen/include/unsupported" -I"/admin/apps/rhel8/R-4.3.1/lib64/R/library/BH/include" -I"/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/StanHeaders/include/src/" -I"/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/StanHeaders/include/" -I"/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/RcppParallel/include/" -I"/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -D_HAS_AUTO_PTR_ETC=0 -include '/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/StanHeaders/include/stan/math/prim/fun/Eigen.hpp' -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 -I/opt/apps/rhel8/bzip2-1.0.8/include -fpic -g -O2 -c file27d1cb1e625e6c.cpp -o file27d1cb1e625e6c.o
> if test "zfile27d1cb1e625e6c.o" != "z"; then \
> echo g++ -std=gnu++17 -shared -L"/opt/apps/rhel8/R-4.3.1/lib64/R/lib" -L/opt/apps/rhel8/bzip2-1.0.8/lib -o file27d1cb1e625e6c.so file27d1cb1e625e6c.o '/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/rstan/lib//libStanServices.a' -L'/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/StanHeaders/lib/' -lStanHeaders -L'/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/RcppParallel/lib/' -ltbb -L"/opt/apps/rhel8/R-4.3.1/lib64/R/lib" -lR; \
> g++ -std=gnu++17 -shared -L"/opt/apps/rhel8/R-4.3.1/lib64/R/lib" -L/opt/apps/rhel8/bzip2-1.0.8/lib -o file27d1cb1e625e6c.so file27d1cb1e625e6c.o '/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/rstan/lib//libStanServices.a' -L'/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/StanHeaders/lib/' -lStanHeaders -L'/hpc/home/ys288/R/x86_64-pc-linux-gnu-library/4.3/RcppParallel/lib/' -ltbb -L"/opt/apps/rhel8/R-4.3.1/lib64/R/lib" -lR; \
> fi
> Error in compileCode(f, code, language = language, verbose = verbose) :
> /admin/apps/rhel8/R-4.3.1/lib64/R/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:654:74: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits<double>::type’ {aka ‘__m128d’} [-Wignored-attributes] 654 | return internal::first_aligned<int(unpacket_traits<DefaultPacketType>::alignment),Derived>(m); | ^~~~~~~~~g++: fatal error: Killed signal terminated program cc1pluscompilation terminated.make: *** [/opt/apps/rhel8/R-4.3.1/lib64/R/etc/Makeconf:200: file27d1cb1e625e6c.o] Error 1
> Error in sink(type = "output") : invalid connection