I was facing the same issue in windows 11 and it seemed like a problem with admin privileges, so running R as administrator
solved the problem it seems (complete run below):
R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> cmdstanr::install_cmdstan()
Error:
RTools installation found but PATH was not properly set.
Run check_cmdstan_toolchain(fix = TRUE) to fix the issue.
> cmdstanr::check_cmdstan_toolchain(fix = TRUE)
Installing mingw32-make and writing RTools path to ~/.Renviron ...
The C++ toolchain required for CmdStan is setup properly!
> cmdstanr::install_cmdstan()
The C++ toolchain required for CmdStan is setup properly!
* Latest CmdStan release is v2.28.2
* Installing CmdStan v2.28.2 in C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2
* Downloading cmdstan-2.28.2.tar.gz from GitHub...
* Download complete
* Unpacking archive...
* Building CmdStan binaries...
INFO: Could not find files for the given pattern(s).
cp bin/windows-stanc bin/stanc.exe
g++ -pipe -m64 -D_REENTRANT -O3 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DNO_FPRINTF_OUTPUT -D_USE_MATH_DEFINES -O3 -c -x c -include stan/lib/stan_math/lib/sundials_5.7.0/include/stan_sundials_printf_override.hpp stan/lib/stan_math/lib/sundials_5.7.0/src/nvector/serial/nvector_serial.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/nvector/serial/nvector_serial.o
...
...
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -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-uninitialized -Wno-non-virtual-dtor -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
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -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-uninitialized -Wno-non-virtual-dtor -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/large_objects.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -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-uninitialized -Wno-non-virtual-dtor -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/backref.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -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-uninitialized -Wno-non-virtual-dtor -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/tbbmalloc.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" bin/cmdstan/stansummary.o -static-libgcc -static-libstdc++ -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -o bin/stansummary.exe
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -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-uninitialized -Wno-non-virtual-dtor -flifetime-dse=1 -o itt_notify_malloc.o -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/itt_notify.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" bin/cmdstan/print.o -static-libgcc -static-libstdc++ -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -o bin/print.exe
cmd /C cscript /nologo /E:jscript ../tbb_2020.3/build/version_info_windows.js gcc intel64 "g++ -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -Wall -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include" > version_string.ver
g++ -E -x c++ ../tbb_2020.3/src/tbbmalloc/win64-gcc-tbbmalloc-export.def -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -Wall -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-uninitialized -Wno-non-virtual-dtor -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include > tbbmalloc.def
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -Wall -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -flifetime-dse=1 -D__TBBMALLOC_BUILD=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/proxy.cpp
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -Wall -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -flifetime-dse=1 -D__TBBMALLOC_BUILD=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/tbb_function_replacement.cpp
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" bin/cmdstan/diagnose.o -static-libgcc -static-libstdc++ -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -o bin/diagnose.exe
g++ -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -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-uninitialized -Wno-non-virtual-dtor -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 -I. ../tbb_2020.3/src/tbbmalloc/frontend.cpp
gcc -o tbbmalloc.dll backend.o large_objects.o backref.o tbbmalloc.o itt_notify_malloc.o frontend.o -lpsapi -shared -m64 -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,--version-script,tbbmalloc.def
g++ -o tbbmalloc_proxy.dll proxy.o tbb_function_replacement.o -lpsapi tbbmalloc.dll -shared -m64 -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb"
mingw32-make[1]: Leaving directory 'C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb'
touch stan/lib/stan_math/lib/tbb/version_tbb_2020.3
tbb_root="../tbb_2020.3" CXX="g++" CC="gcc" LDFLAGS='-Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" ' 'mingw32-make.exe' -C "stan/lib/stan_math/lib/tbb" -r -f "C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb" compiler=gcc cfg=release stdver=c++1y CXXFLAGS="-Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation "
mingw32-make[1]: Entering directory 'C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb'
C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbb:28: CONFIG: cfg=release arch=intel64 compiler=gcc target=windows runtime=mingw8.3.0
g++ -o concurrent_hash_map.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_hash_map.cpp
g++ -o concurrent_queue.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_queue.cpp
g++ -o concurrent_vector.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_vector.cpp
g++ -o dynamic_link.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/dynamic_link.cpp
g++ -o itt_notify.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/itt_notify.cpp
g++ -o cache_aligned_allocator.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/cache_aligned_allocator.cpp
g++ -o pipeline.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/pipeline.cpp
g++ -o queuing_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/queuing_mutex.cpp
g++ -o queuing_rw_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/queuing_rw_mutex.cpp
g++ -o reader_writer_lock.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/reader_writer_lock.cpp
g++ -o spin_rw_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/spin_rw_mutex.cpp
g++ -o x86_rtm_rw_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/x86_rtm_rw_mutex.cpp
g++ -o spin_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/spin_mutex.cpp
g++ -o critical_section.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/critical_section.cpp
g++ -o mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/mutex.cpp
g++ -o recursive_mutex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/recursive_mutex.cpp
g++ -o condition_variable.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/condition_variable.cpp
g++ -o tbb_thread.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/tbb_thread.cpp
g++ -o concurrent_monitor.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/concurrent_monitor.cpp
g++ -o semaphore.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/semaphore.cpp
g++ -o private_server.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/private_server.cpp
g++ -o rml_tbb.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/rml/client/rml_tbb.cpp
g++ -o tbb_misc.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include -I. ../tbb_2020.3/src/tbb/tbb_misc.cpp
g++ -o tbb_misc_ex.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/tbb_misc_ex.cpp
g++ -o task.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/task.cpp
g++ -o task_group_context.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/task_group_context.cpp
g++ -o governor.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/governor.cpp
g++ -o market.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/market.cpp
g++ -o arena.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/arena.cpp
g++ -o scheduler.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/scheduler.cpp
g++ -o observer_proxy.o -c -MMD -O2 -DUSE_WINTHREAD -D_WIN32_WINNT=0x0502 -DMINGW_HAS_SECURE_API=1 -D__MSVCRT_VERSION__=0x0700 -msse -mthreads -m64 -mrtm -flifetime-dse=1 -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-uninitialized -Wno-non-virtual-dtor -Wno-unknown-warning-option -Wno-deprecated-copy -Wno-missing-attributes -Wno-class-memaccess -Wno-sized-deallocation -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -
...
g++ -std=c++1y -m64 -D_REENTRANT -Wall -Wno-unused-function -Wno-uninitialized -Wno-unused-but-set-variable -Wno-unused-variable -Wno-sign-compare -Wno-unused-local-typedefs -Wno-int-in-bool-context -Wno-attributes -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -D_USE_MATH_DEFINES -DBOOST_DISABLE_ASSERTS -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" examples/bernoulli/bernoulli.o src/cmdstan/main.o -static-libgcc -static-libstdc++ -Wl,-L,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2/stan/lib/stan_math/lib/tbb" stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_cvodes.a stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_idas.a stan/lib/stan_math/lib/sundials_5.7.0/lib/libsundials_kinsol.a stan/lib/stan_math/lib/tbb/tbb.dll -o examples/bernoulli/bernoulli.exe
rm -f examples/bernoulli/bernoulli.o
Intel TBB is not in PATH.
Consider calling
mingw32-make install-tbb
to avoid copying Intel TBB library files.
'stan/lib/stan_math/lib/tbb/tbb.dll' -> 'examples/bernoulli/tbb.dll'
* Finished installing CmdStan to C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2
CmdStan path set to: C:/Users/animeshs/.cmdstanr/cmdstan-2.28.2
>