Cmdstanr "2.30.1", not working on Win10

Hi everyone,

i just upgraded to 2.30.1 and as a result, i am not able to run any model. Setting the path back to “2.30.0” works.

file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan")

# compile model
mod <- cmdstan_model(file) # this works fine!

# sampling
data_list <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1))
fit <- mod$sample( # this does not!
  data = data_list, 
  seed = 123, 
  chains = 4, 
  parallel_chains = 4,
  refresh = 500
)

gives me under 2.30.1

Compiling Stan program…
INFO: Could not find files for the given pattern(s).

In file included from C:/rtools42/ucrt64/include/c++/12.1.0/stdlib.h:36,
from C:/rtools42/ucrt64/lib/gcc/x86_64-w64-mingw32/12.1.0/include/mm_malloc.h:27,
from C:/rtools42/ucrt64/lib/gcc/x86_64-w64-mingw32/12.1.0/include/xmmintrin.h:34,
from C:/rtools42/ucrt64/lib/gcc/x86_64-w64-mingw32/12.1.0/include/immintrin.h:31,
from …/tbb_2020.3/include/tbb/machine/gcc_itsx.h:57,
from …/tbb_2020.3/include/tbb/machine/gcc_ia32_common.h:107,
from …/tbb_2020.3/include/tbb/machine/gcc_generic.h:232,
from …/tbb_2020.3/include/tbb/tbb_machine.h:197,
from …/tbb_2020.3/src/tbbmalloc/Synchronize.h:20,
from …/tbb_2020.3/src/tbbmalloc/Customize.h:29,
from …/tbb_2020.3/src/tbbmalloc/TypeDefinitions.h:54,
from …/tbb_2020.3/src/tbbmalloc/tbbmalloc_internal.h:21,
from …/tbb_2020.3/src/tbbmalloc/backend.cpp:19:
C:/rtools42/ucrt64/include/c++/12.1.0/cstdlib:137:11: error: ‘at_quick_exit’ has not been declared in ‘::’
137 | using ::at_quick_exit;
| ^~~~~~~~~~~~~

C:/rtools42/ucrt64/include/c++/12.1.0/cstdlib:160:11: error: ‘quick_exit’ has not been declared in ‘::’
160 | using ::quick_exit;
| ^~~~~~~~~~
C:/rtools42/ucrt64/include/c++/12.1.0/stdlib.h:43:14: error: ‘at_quick_exit’ has not been declared in ‘std’
43 | using std::at_quick_exit;
| ^~~~~~~~~~~~~
C:/rtools42/ucrt64/include/c++/12.1.0/stdlib.h:46:14: error: ‘quick_exit’ has not been declared in ‘std’
46 | using std::quick_exit;
| ^~~~~~~~~~

cc1plus.exe: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics

mingw32-make[1]: *** [C:/Users/George/Documents/.cmdstan/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbbmalloc:65: backend.o] Error 1

mingw32-make: *** [stan/lib/stan_math/make/libraries:173: stan/lib/stan_math/lib/tbb/tbbmalloc.def] Error 2

Error: An error occured during compilation! See the message above for more information.

What am I missing?
G.

1 Like

Can you make sure your cmdstanr version is updated. You can do that by running

remove.packages("cmdstanr")
install.packages("cmdstanr", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

then run

cmdstanr::rebuild_cmdstan(cores = 4)

I ran the lines, and no. Same behavior as before.
Thanks, nonetheless!
G.

Can you paste what is the output of:

cmdstanr::cmdstan_make_local()

Here it is:

cmdstanr::cmdstan_make_local()
character(0)

Aha that will do it.

Can you reinstall cmdstan with

cmdstanr::install_cmdstan(cores =4, overwrite = TRUE)

1 Like

That did it. I am not quite sure what went wrong, but no matter! Thank you so much!
G.

1 Like

I’m also running into virtually identical error message during my attempt to fresh install of cmdstan with install_cmdstan on linux environment.

For some reason, immintrin.h keeps being included from the library of another version of gcc installed on the remote environment even after explicitly setting LD_LIBRARY_PATH.

Any ideas?

Thanks.

Can you post the compilation output that you see when running install_cmdstan? That will let us see what include arguments are being used when the error occurs

I think R installed by conda is being problematic for other packages as well since it’s showing the same problem. I’ve only installed digest R package through conda due to compilation error if I did it within R, but I didn’t pay much attention to the following compilation output:

x86_64-conda-linux-gnu-cc -I"/storage/home/remote/djga/data/local/miniconda3/envs/stan-env/lib/R/include" -DNDEBUG -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /storage/home/remote/djga/data/local/miniconda3/envs/stan-env/include -I/storage/home/remote/djga/data/local/miniconda3/envs/stan-env/include -Wl,-rpath-link,/storage/home/remote/djga/data/local/miniconda3/envs/stan-env/lib -fpic -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /storage/home/remote/djga/data/local/miniconda3/envs/stan-env/include -fdebug-prefix-map=/home/conda/feedstock_root/build_artifacts/r-base-split_1660164656008/work=/usr/local/src/conda/r-base-4.0.5 -fdebug-prefix-map=/storage/home/remote/djga/data/local/miniconda3/envs/stan-env=/usr/local/src/conda-prefix -c blake3.c -o blake3.o

In file included from /usr/local/remote-apps/spack/packages/0.12/linux-rhel7-x86_64/gcc-4.8.5/gcc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/immintrin.h:45,
from blake3_impl.h:53,
from blake3.c:14:
/usr/local/remote-apps/spack/packages/0.12/linux-rhel7-x86_64/gcc-4.8.5/gcc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/avx512fintrin.h: In function ‘_mm512_mask_cvtepi64_storeu_epi8’:/usr/local/remote-apps/spack/packages/0.12/linux-rhel7-x86_64/gcc-4.8.5/gcc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/86_64-pc-linux-gnu/8.3.0/include/avx512fintrin.h:5545:37: warning: passing argument 1 of ‘__builtin_ia32_pmovqb512mem_mask’ from incompatible pointer type [-Wincompatible-pointer-types]

This seems to be linked to the following output from an attempt to install cmdstanr (using the command install_cmdstan(dir="/storage/home/remote/djga/data/local", cpp_options=list("CXX"="g++", "TBB_CXX_TYPE"="gcc"), overwrite=T)):

tbb_root=“…/tbb_2020.3” CXX=“g++” CC=“gcc” LDFLAGS='-Wl,-L,“/storage/home/remote/djga/data/local/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb” -Wl,-rpath,“storage/home/remote/djga/data/local/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb” ’ ‘make’ -C “stan/lib/stan_math/lib/tbb” -r -f “/storage/home/remote/djga/data/local/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbbmalloc” compiler=gcc cfg=release stdver=c++1y malloc CXXFLAGS="-Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation "make[1]: Entering directory ‘/storage/home/remote/djga/data/local/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb’
g++ -c -MMD -O2 -g -DDO_ITT_NOTIFY -DUSE_PTHREAD -pthread -m64 -mrtm -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -fno-rtti -fno-exceptions -D__TBBMALLOC_BUILD=1 -Wno-parentheses -Wno-sized-deallocation -fPIC -flifetime-dse=1 -I…/tbb_2020.3/src -I…/tbb_2020.3/src/rml/include -I…/tbb_2020.3/include -I…/tbb_2020.3/src/tbbmalloc -I…/tbb_2020.3/src/tbbmalloc …/tbb_2020.3/src/tbbmalloc/backend.cpp
In file included from /usr/local/remote-apps/spack/packages/0.12/linux-rhel7-x86_64/gcc-4.8.5/gcc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/immintrin.h:45,
from …/tbb_2020.3/include/tbb/machine/gcc_itsx.h:57,
from …/tbb_2020.3/include/tbb/machine/gcc_ia32_common.h:107,
from …/tbb_2020.3/include/tbb/machine/gcc_generic.h:232,
from …/tbb_2020.3/include/tbb/tbb_machine.h:229,
from …/tbb_2020.3/src/tbbmalloc/Synchronize.h:20,
from …/tbb_2020.3/src/tbbmalloc/Customize.h:29,
from …/tbb_2020.3/src/tbbmalloc/TypeDefinitions.h:54,
from …/tbb_2020.3/src/tbbmalloc/tbbmalloc_internal.h:21,
from …/tbb_2020.3/src/tbbmalloc/backend.cpp:19:
/usr/local/remote-apps/spack/packages/0.12/linux-rhel7-x86_64/gcc-4.8.5/gcc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/avx512fintrin.h: In function ‘void _mm512_mask_cvtepi64_storeu_epi8(void*, __mmask8, __m512i)’:/usr/local/remote-apps/spack/packages/0.12/linux-rhel7-x86_64/gcc-4.8.5/cc-8.3.0-opnwtdjumg2hxo4ljvnx77ugb6afmvj3/lib/gcc/x86_64-pc-linux-gnu/8.3.0/include/avx512fintrin.h:5545:37: error: cannot convert ‘__v16qi*’ {aka ‘__vector(16) char*’} to ‘long long unsigned int*’

I’m not sure if the paths indicated g++ was problematic since they seem to be pointing to the correct directories or R during runtime somehow resets some of the paths. Maybe sharing the `Makeconf’ would be helpful as well?

Thanks.