R version 4.2.1 (2022-06-23 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
I’m trying to install stan following the instructions here.
I downloaded the RTools42 installer and ran it.
(At some point I also tried RTools40, but it didn’t work for me, so uninstalled it again.)
I added C:\rtools42\usr\bin to PATH, but found that c++.exe and g++.exe were located in C:\rtools42\x86_64-w64-mingw32.static.posix\bin , so I added this to PATH as well. My PATH is now pretty crowded:
Sys.getenv(“PATH”)
[1] “C:\rtools42/x86_64-w64-mingw32.static.posix/bin;C:\rtools42/usr/bin;\usr\bin;\usr\bin;C:\Program Files\R\R-4.2.1\bin\x64;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\Calibre2\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Users\janfl\AppData\Local\activestate\cache\bin;C:\Users\janfl\AppData\Local\ActiveState\StateTool\release\bin;C:\Users\janfl\AppData\Local\Microsoft\WindowsApps;C:\texlive\2021\bin\win32;C:\Program Files\JetBrains\PyCharm Community Edition 2021.3.1\bin;;C:\Users\janfl\AppData\Local\Programs\Microsoft VS Code\bin;C:\rtools42\x86_64-w64-mingw32.static.posix\bin;C:\rtools42\usr\bin;C:\rtools42;C:\MinGW\bin;;C:/Program Files/RStudio/resources/app/bin/quarto/bin”
I found that RTools42 did not contain mingw32-make.exe, so I installed MinGW from sourceforge.
When I now run mingw32-make build in the command line in the cmdstan-2.30.1 folder, I get the following error message. I suppose it might be related to this problem here. Would really appreciate help.
INFO: Could not find files for the given pattern(s).
if ! [[ mingw32-make =~ mingw32 ]]; then
echo “ERROR: Please use mingw32-make on Windows to build the Intel TBB library.”;
echo “This is packaged with RTools, for example.”;
exit 1;
fi
touch stan/lib/stan_math/lib/tbb/tbb-make-check
tbb_root=“…/tbb_2020.3” CXX=“g++” CC=“gcc” LDFLAGS='-Wl,-L,“C:/Users/janfl/Desktop/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb” -Wl,-rpath,“C:/Users/janfl/Desktop/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb” ’ ‘mingw32-make’ -C “stan/lib/stan_math/lib/tbb” -r -f “C:/Users/janfl/Desktop/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 "
mingw32-make[1]: Entering directory ‘C:/Users/janfl/Desktop/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb’
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
In file included from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\c++\stdlib.h:36,
from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\mm_malloc.h:27,
from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\xmmintrin.h:34,
from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\immintrin.h:29,
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\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\c++\cstdlib:137:11: error: ‘at_quick_exit’ has not been declared in ‘::’
137 | using ::at_quick_exit;
| ^~~~~~~~~~~~~
c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\c++\cstdlib:160:11: error: ‘quick_exit’ has not been declared in ‘::’
160 | using ::quick_exit;
| ^~~~~~~~~~
In file included from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\mm_malloc.h:27,
from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\xmmintrin.h:34,
from c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\immintrin.h:29,
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\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\c++\stdlib.h:43:14: error: ‘at_quick_exit’ has not been declared in ‘std’
43 | using std::at_quick_exit;
| ^~~~~~~~~~~~~
c:\rtools42\x86_64-w64-mingw32.static.posix\lib\gcc\x86_64-w64-mingw32.static.posix\10.4.0\include\c++\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
C:/Users/janfl/Desktop/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb_2020.3/build/Makefile.tbbmalloc:65: recipe for target ‘backend.o’ failed
mingw32-make[1]: *** [backend.o] Error 1
mingw32-make[1]: Leaving directory ‘C:/Users/janfl/Desktop/cmdstan-2.30.1/stan/lib/stan_math/lib/tbb’
stan/lib/stan_math/make/libraries:172: recipe for target ‘stan/lib/stan_math/lib/tbb/tbbmalloc.def’ failed
mingw32-make: *** [stan/lib/stan_math/lib/tbb/tbbmalloc.def] Error 2