Compiling CmdStan 2.28.0 with OpenCL fails on Windows 10

I’m in the process of trying to update cmdstan to latest version (2.28.0) and I’m running into some issues getting it to compile with the opencl flags on Windows 10. I set the same flags in the make/local file that I had used under version 2.27.0

STAN_OPENCL=true
STAN_THREADS=true
OPENCL_DEVICE_ID=0
OPENCL_PLATFORM_ID=0
LDFLAGS_OPENCL=-L"${CUDA_PATH_V11_4}/lib/x64" -lOpenCL

When I run the following from the command line

# Run the following commands from the terminal
 cd E:/Users/Documents/.cmdstanr/
git clone https://github.com/stan-dev/cmdstan.git --recursive
cd cmdstan
mingw32-make clean-all
mingw32-make -j6 build

I get these compiler errors

E:\Users\Documents\.cmdstanr\cmdstan-2.28.0>mingw32-make -j6 build
INFO: Could not find files for the given pattern(s).
curl -L https://github.com/stan-dev/stanc3/releases/download/nightly/windows-stanc -o bin/stanc.exe --retry 5 --retry-delay 10
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++ -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/sundials/sundials_math.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_math.o
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/cvodes/cvodes_nls_stg1.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg1.o
  % Total    % Received % Xferd  Ag++ -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/cvodes/cvodes_nls_sim.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_sim.o
verage Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0g++ -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/cvodes/cvodes_ls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_ls.o
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/cvodes/cvodea_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea_io.o
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/cvodes/cvodes_spils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_spils.o
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/cvodes/cvodes.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes.o
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/cvodes/cvodes_bandpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bandpre.o
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/cvodes/cvodes_bbdpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_bbdpre.o
100   621  100   621    0     0   3059      0 --:--:-- --:--:-- --:--:--  3059
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/cvodes/cvodes_nls_stg.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls_stg.o
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/cvodes/cvodea.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodea.o
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/cvodes/cvodes_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_io.o
  0 20.8M    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0g++ -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/cvodes/cvodes_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_direct.o
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/cvodes/cvodes_diag.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_diag.o
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/cvodes/cvodes_nls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/cvodes/cvodes_nls.o
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/sundials/sundials_dense.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_dense.o
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/sundials/sundials_nvector_senswrapper.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector_senswrapper.o
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/sundials/sundials_nvector.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nvector.o
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/sundials/sundials_memory.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_memory.o
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/sundials/sundials_linearsolver.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_linearsolver.o
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/sundials/sundials_iterative.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_iterative.o
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/sundials/sundials_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_direct.o
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/sundials/sundials_band.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_band.o
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/sundials/sundials_version.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_version.o
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/sundials/sundials_nonlinearsolver.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_nonlinearsolver.o
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/sundials/sundials_futils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_futils.o
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/sundials/sundials_matrix.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sundials/sundials_matrix.o
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/sunmatrix/band/sunmatrix_band.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/band/sunmatrix_band.o
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/sunmatrix/dense/sunmatrix_dense.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunmatrix/dense/sunmatrix_dense.o
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/sunlinsol/band/sunlinsol_band.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/band/sunlinsol_band.o
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/sunlinsol/dense/sunlinsol_dense.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunlinsol/dense/sunlinsol_dense.o
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/sunnonlinsol/newton/sunnonlinsol_newton.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/newton/sunnonlinsol_newton.o
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/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/sunnonlinsol/fixedpoint/sunnonlinsol_fixedpoint.o
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/idas/idas_nls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls.o
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/idas/idas_nls_sim.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_sim.o
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/idas/idas_ls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ls.o
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/idas/idas.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas.o
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/idas/idas_bbdpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_bbdpre.o
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/idas/idas_nls_stg.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_nls_stg.o
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/idas/idaa_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa_io.o
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/idas/idas_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_direct.o
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/idas/idas_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_io.o
 46 20.8M   46 9904k    0     0  7595k      0  0:00:02  0:00:01  0:00:01 10.3Mg++ -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/idas/idaa.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idaa.o
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/idas/idas_ic.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_ic.o
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/idas/idas_spils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/idas/idas_spils.o
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/kinsol/kinsol_io.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_io.o
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/kinsol/kinsol_spils.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_spils.o
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/kinsol/kinsol_ls.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_ls.o
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/kinsol/kinsol.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol.o
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/kinsol/kinsol_bbdpre.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_bbdpre.o
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
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/kinsol/kinsol_direct.c -o stan/lib/stan_math/lib/sundials_5.7.0/src/kinsol/kinsol_direct.o
touch stan/lib/stan_math/lib/tbb/tbb-make-check

--- Compiling the main object file. This might take up to a minute. ---

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/opencl_2.0.15/include  -DSTAN_THREADS -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  -DSTAN_OPENCL -DOPENCL_DEVICE_ID=0 -DOPENCL_PLATFORM_ID=0 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -Wno-ignored-attributes        -c -o src/cmdstan/main_threads_opencl.o src/cmdstan/main.cpp
--- Compiling pre-compiled header. This might take a few seconds. ---
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/opencl_2.0.15/include  -DSTAN_THREADS -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  -DSTAN_OPENCL -DOPENCL_DEVICE_ID=0 -DOPENCL_PLATFORM_ID=0 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -Wno-ignored-attributes        -c stan/src/stan/model/model_header.hpp -o stan/src/stan/model/model_header_threads_opencl.hpp.gch
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/opencl_2.0.15/include  -DSTAN_THREADS -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  -DSTAN_OPENCL -DOPENCL_DEVICE_ID=0 -DOPENCL_PLATFORM_ID=0 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -Wno-ignored-attributes        -c -fvisibility=hidden -o bin/cmdstan/stansummary.o  -static-libgcc -static-libstdc++    -lOpenCL  -Wl,-L,"E:/Users/Documents/.cmdstanr/cmdstan-2.28.0/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"E:/Users/Documents/.cmdstanr/cmdstan-2.28.0/stan/lib/stan_math/lib/tbb"   src/cmdstan/stansummary.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/opencl_2.0.15/include  -DSTAN_THREADS -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  -DSTAN_OPENCL -DOPENCL_DEVICE_ID=0 -DOPENCL_PLATFORM_ID=0 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -Wno-ignored-attributes        -c -fvisibility=hidden -o bin/cmdstan/print.o  -static-libgcc -static-libstdc++    -lOpenCL  -Wl,-L,"E:/Users/Documents/.cmdstanr/cmdstan-2.28.0/stan/lib/stan_math/lib/tbb"
-Wl,-rpath,"E:/Users/Documents/.cmdstanr/cmdstan-2.28.0/stan/lib/stan_math/lib/tbb"   src/cmdstan/print.cpp
100 20.8M  100 20.8M    0     0  10.4M      0  0:00:01  0:00:01 --:--:-- 12.8M
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/opencl_2.0.15/include  -DSTAN_THREADS -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  -DSTAN_OPENCL -DOPENCL_DEVICE_ID=0 -DOPENCL_PLATFORM_ID=0 -DCL_HPP_TARGET_OPENCL_VERSION=120 -DCL_HPP_MINIMUM_OPENCL_VERSION=120 -DCL_HPP_ENABLE_EXCEPTIONS -Wno-ignored-attributes        -c -fvisibility=hidden -o bin/cmdstan/diagnose.o  -static-libgcc -static-libstdc++    -lOpenCL  -Wl,-L,"E:/Users/Documents/.cmdstanr/cmdstan-2.28.0/stan/lib/stan_math/lib/tbb" -Wl,-rpath,"E:/Users/Documents/.cmdstanr/cmdstan-2.28.0/stan/lib/stan_math/lib/tbb"   src/cmdstan/diagnose.cpp
In file included from stan/lib/stan_math/stan/math/opencl/err/check_opencl.hpp:7,
                 from stan/lib/stan_math/stan/math/opencl/matrix_cl.hpp:6,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator/operation_cl.hpp:10,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator.hpp:106,
                 from stan/lib/stan_math/stan/math/opencl/prim.hpp:82,
                 from stan/lib/stan_math/stan/math/opencl/rev.hpp:5,
                 from stan/lib/stan_math/stan/math/rev.hpp:6,
                 from stan/lib/stan_math/stan/math.hpp:19,
                 from stan/src/stan/model/model_header.hpp:4:
stan/lib/stan_math/lib/opencl_2.0.15/include/CL/opencl.hpp:530:10: fatal error: CL/opencl.h: No such file or directory
 #include <CL/opencl.h>
          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make: *** [make/program:27: stan/src/stan/model/model_header_threads_opencl.hpp.gch] Error 1
mingw32-make: *** Waiting for unfinished jobs....
In file included from stan/lib/stan_math/stan/math/opencl/err/check_opencl.hpp:7,
                 from stan/lib/stan_math/stan/math/opencl/matrix_cl.hpp:6,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator/operation_cl.hpp:10,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator.hpp:106In file included from ,
                 from stan/lib/stan_math/stan/math/opencl/err/check_opencl.hpp:7,
                 from stan/lib/stan_math/stan/math/opencl/prim.hpp:82,
                 from stan/lib/stan_math/stan/math/opencl/opencl_context.hpp:14,
                 from stan/lib/stan_math/stan/math/prim.hpp:7,
                 from src/cmdstan/write_opencl_device.hpp:6,
                 from stan/src/stan/io/stan_csv_reader.hpp:5src/cmdstan/command.hpp:19,
                 from ,
                 from stan/src/stan/mcmc/chains.hpp:4src/cmdstan/main.cpp:1,
                 from :
src/cmdstan/stansummary_helper.hpp:4,
                 from stan/lib/stan_math/lib/opencl_2.0.15/include/CL/opencl.hpp:530:10: src/cmdstan/stansummary.cpp:1:
fatal error: CL/opencl.h: No such file or directory
 #include stan/lib/stan_math/lib/opencl_2.0.15/include/CL/opencl.hpp:530:10: <CL/opencl.h>fatal error:
          CL/opencl.h: No such file or directory
 #include ^~~~~~~~~~~~~<CL/opencl.h>
c
          om i^~~~~~~~~~~~~la
ticoonm ptielramtiinoant etde.r
minated.
mingw32-make: *** [make/program:14: src/cmdstan/main_threads_opencl.o] Error 1
mingw32-make: *** [make/command:5: bin/cmdstan/stansummary.o] Error 1
In file included from stan/lib/stan_math/stan/math/opencl/err/check_opencl.hpp:7,
                 from stan/lib/stan_math/stan/math/opencl/matrix_cl.hpp:6,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator/operation_cl.hpp:10,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator.hpp:106,
                 from stan/lib/stan_math/stan/math/opencl/prim.hpp:82,
                 from stan/lib/stan_math/stan/math/prim.hpp:7,
                 from stan/src/stan/io/stan_csv_reader.hpp:5,
                 from stan/src/stan/mcmc/chains.hpp:4,
                 from src/cmdstan/stansummary_helper.hpp:4,
                 from src/cmdstan/print.cpp:2:
stan/lib/stan_math/lib/opencl_2.0.15/include/CL/opencl.hpp:530:10: fatal error: CL/opencl.h: No such file or directory
 #include <CL/opencl.h>
          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make: *** [make/command:5: bin/cmdstan/print.o] Error 1
In file included from stan/lib/stan_math/stan/math/opencl/err/check_opencl.hpp:7,
                 from stan/lib/stan_math/stan/math/opencl/matrix_cl.hpp:6,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator/operation_cl.hpp:10,
                 from stan/lib/stan_math/stan/math/opencl/kernel_generator.hpp:106,
                 from stan/lib/stan_math/stan/math/opencl/prim.hpp:82,
                 from stan/lib/stan_math/stan/math/prim.hpp:7,
                 from stan/src/stan/io/stan_csv_reader.hpp:5,
                 from stan/src/stan/mcmc/chains.hpp:4,
                 from src/cmdstan/stansummary_helper.hpp:4,
                 from src/cmdstan/diagnose.cpp:1:
stan/lib/stan_math/lib/opencl_2.0.15/include/CL/opencl.hpp:530:10: fatal error: CL/opencl.h: No such file or directory
 #include <CL/opencl.h>
          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make: *** [make/command:5: bin/cmdstan/diagnose.o] Error 1

I’ve tried restarting my computer, performing the installation via cmdstanr’s install_cmdstan and rebuild_cmdstan functions, reinstalling my CUDA drivers (including updating from 11.3 to 11.4) to no avail. It compiles fine without OpenCL enabled, but starts throwing errors if I try to build it with OpenCL headers so that definitely seems to be the issue. Tagging @rok_cesnovar and @stevebronder on this one because GPU stuff

1 Like

To make it easier to read, this seems to be the main compiler error

stan/lib/stan_math/lib/opencl_2.0.15/include/CL/opencl.hpp:530:10: fatal error: CL/opencl.h: No such file or directory
 #include <CL/opencl.h>
          ^~~~~~~~~~~~~
compilation terminated.
mingw32-make.exe: *** [make/program:14: src/cmdstan/main_opencl.o] Error 1

Can you check inside your cmddtan folder here:

stan/lib/stan_math/lib/opencl_2.0.15/include

And see if you have a folder CL with a file opencl.h?

I encountered the same situation, so I checked it .

Include/CL contained

  • cl2.hpp
  • opencl.hpp

Thanks for the report.

This seems to have been caused by Update the OpenCL Hpp header to version 2.0.15 by SteveBronder · Pull Request #2587 · stan-dev/math · GitHub

Before that PR this is how the folder looked: math/lib/opencl_2.2.0/CL at v4.1.0 · stan-dev/math · GitHub

We are doing a patch release for 2.28.1 in the next few days and it might be worth checking into the issue ASAP. Will get on it. For now if you are on Ubuntu, the solution is to run sudo apt-get install opencl-headers (should be similar on other Linux distros). I am not sure if there is a solution for this on Windows and we will have to do something on our end. I think we included the .h files precisely due to simpler use on Windows. This escaped me when reviewing.

Can anyone on Windows install a experimental version (develop branch + Update OpenCL headers by rok-cesnovar · Pull Request #2603 · stan-dev/math · GitHub):

cmdstanr::install_cmdstan(release_url = "https://github.com/rok-cesnovar/cmdstan/releases/download/opencl-v0.1/cmdstan-OpenCL-hpp-fixes.tar.gz", cores = 4)

and then try to compile a model with OpenCL. Thanks!

1 Like

This new version builds without compile errors for me, where the 2.28 release fails. Nice!

1 Like

I just got around to trying this under Windows. It compiles successfully and runs the OpenCL example from the cmdstanr vignette without any issues ( and in about 12% of the time it takes to run on CPU)

2 Likes

Thanks to both. This is good news.