Error with cpp

Hi all,

I submit a job to a super computer and recent days I got the following error:

Loading required package: ggplot2
Loading required package: StanHeaders
rstan (Version 2.16.2, packaged: 2017-07-03 09:24:58 UTC, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
rstan_options(auto_write = TRUE)
options(mc.cores = parallel::detectCores())
Error in compileCode(f, code, language = language, verbose = verbose) :
  Compilation ERROR, function(s)/method(s) not created! In file included from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/config.hpp:39:0,
                 from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86_64-pc-linux-gnu-library/3.4/BH/include/boost/math/tools/config.hpp:13,
                 from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/stan/math/rev/core/var.hpp:7,
                 from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/stan/math/rev/core/gevv_vvv_vari.hpp:5,
                 from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/stan/math/rev/core.hpp:12,
                 from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86_64-pc-linux-gnu-library/3.4/StanHeaders/include/stan/math/rev/mat.hpp:4,
                 from /vsc-hard-mounts/leuven-user/313/vsc31322/R/x86
Calls: stan ... stan_model -> cxxfunctionplus -> cxxfunction -> compileCode
In addition: Warning message:
running command '/apps/leuven/thinking/2015a/software/R/3.4.0-foss-2015a-tcl/lib64/R/bin/R CMD SHLIB file5e6edc890f6.cpp 2> file5e6edc890f6.cpp.err.txt' had status 1
Execution halted

and the execution is halted.

As you see that loading rstan works fine but the error starts from

Error in compileCode(f, code, language = language, verbose = verbose) :

Do you have any idea how can I fix this error?

Kind regards,
Tran.

Hi all,

Just give you more information. It is running properly in my laptop and I saw this

<command-line>:0:0: note: this is the location of the previous definition
cc1plus.exe: warning: unrecognized command line option "-Wno-ignored-attributes"

but in the output file in HPC I do not see something like cc1plus.exe

    <command-line>:0:0: note: this is the location of the previous definition
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s: Assembler messages:
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:9088: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:9141: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:35844: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:35876: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:35947: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:35979: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:57768: Error: no such instruction: `shlx %rdx,%rax,%rax'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:74436: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:74542: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:74648: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:74754: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:74860: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:74966: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:75064: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:75096: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:75227: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:75259: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:80646: Error: no such instruction: `shlx %rax,%rdx,%rax'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:80804: Error: no such instruction: `shlx %rax,%rdx,%rax'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:80925: Error: no such instruction: `shlx %rax,%rdx,%rax'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:85350: Error: no such instruction: `vinserti128 $0x1,%xmm0,%ymm3,%ymm0'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:120731: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:120836: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:120878: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:120879: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:122724: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:122845: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:123111: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:152947: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:164950: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:165160: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:178912: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:179060: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:185598: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:186272: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:187417: Error: no such instruction: `vpermpd $177,%ymm6,%ymm0'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:187437: Error: no such instruction: `vpermpd $177,%ymm5,%ymm5'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:187440: Error: no such instruction: `vpermpd $177,%ymm7,%ymm7'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:187457: Error: no such instruction: `vpermpd $177,%ymm0,%ymm0'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:187863: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:199834: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:199961: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:200021: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:200083: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:205084: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:208201: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:209280: Error: no such instruction: `vinserti128 $0x1,%xmm0,%ymm3,%ymm0'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:216109: Error: no such instruction: `vinserti128 $0x1,%xmm0,%ymm2,%ymm0'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:220939: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221207: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221213: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221221: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221227: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221362: Error: no such instruction: `vpermpd $177,%ymm2,%ymm1'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221369: Error: no such instruction: `vpermpd $177,%ymm1,%ymm1'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221395: Error: no such instruction: `vpermpd $177,%ymm12,%ymm12'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221407: Error: no such instruction: `vpermpd $177,%ymm4,%ymm4'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:221498: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:222001: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:226041: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:231896: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:231897: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:232594: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:232681: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:232682: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:232930: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:233190: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:238255: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:238591: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:238728: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:238900: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239521: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239523: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239524: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239527: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239669: Error: no such instruction: `vpermpd $177,%ymm2,%ymm1'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239676: Error: no such instruction: `vpermpd $177,%ymm1,%ymm1'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239702: Error: no such instruction: `vpermpd $177,%ymm12,%ymm12'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239714: Error: no such instruction: `vpermpd $177,%ymm4,%ymm4'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:239807: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:240041: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:248278: Error: no such instruction: `shlx %rax,%rdx,%rax'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:251418: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:251482: Error: suffix or operands invalid for `vbroadcastsd'
/node_scratch/20646756.moab.tier2.leuven.vsc/ccCHJwkc.s:251544: Error: suffix or operands invalid for `vbroadcastsd'
make: *** [file5e6edc890f6.o] Error 1

ERROR(s) during compilation: source code errors or compiler configuration errors!

I would remove mtune=native and march=native from the CXXFLAGS in ~/.R/Makevars or whatever configuration file is being read by the server. Also, it is better to first compile models on the login node with the auto_write = TRUE argument to stan_model and then the compute nodes should pick up the compiled version off the disk.

Hi,

I change auto_write = TRUE and it does not show the error about cpp as yesterday but I get a new error

Error in readRDS(file) :
ReadItem: unknown type 0, perhaps written by later version of R
Calls: stan -> stan_model -> readRDS
Execution halted

At this moment I have found in the system any file “Makevars” as you suggested below.

Kind regards
Tran.

Do you have different versions of R on the compute nodes that on the login node?

can you try to reinstall the Rcpp package?