Make on RHEL 9 fails as below. Specifying TARGET_ARCH=x86_64 as command line argument does not help.
# gcc --version
gcc (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# g++ --version
g++ (GCC) 11.4.1 20231218 (Red Hat 11.4.1-3)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# ls -la `which gcc`
-rwxr-xr-x. 3 root root 1088912 Dec 19 2023 /bin/gcc
# ls -la `which g++`
-rwxr-xr-x. 4 root root 1088960 Dec 19 2023 /bin/g++
#
# make
make[1]: Entering directory '/usr/local/cuda-12.6/cuda-samples/Samples/1_Utilities/bandwidthTest'
/usr/local/cuda/bin/nvcc -ccbin g++ -I../../../Common -m64 --threads 0 --std=c++11 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_89,code=sm_89 -gencode arch=compute_90,code=sm_90 -gencode arch=compute_90,code=compute_90 -o bandwidthTest.o -c bandwidthTest.cu
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
In file included from ../../../Common/helper_cuda.h:41,
from bandwidthTest.cu:42:
../../../Common/helper_string.h:34:10: fatal error: fstream: No such file or directory
34 | #include <fstream>
| ^~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:341: bandwidthTest.o] Error 255
make[1]: Leaving directory '/usr/local/cuda-12.6/cuda-samples/Samples/1_Utilities/bandwidthTest'
make: *** [Makefile:45: Samples/1_Utilities/bandwidthTest/Makefile.ph_build] Error 2
Make on RHEL 9 fails as below. Specifying TARGET_ARCH=x86_64 as command line argument does not help.