I have a Makefile which runs just fine, compiling CUDA files to cpp. When I run it with intercept-build to create compile_commands.json, the cpp file created have only one entry in it: "empty-fileemtpy-file". However, if I extract the command that Makefile attempts to execute and run it with intercept-build, a correct cpp file is generated. Any idea why intercept-build is having issue with the Makefile and not with the actual NVCC compile command?
Here is the sequence of commands showing the issue:
$ intercept-build make
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I/usr/local/cuda-11.0/lib64/../include -I/home/farshad/NVIDIA_GPU_Computing_SDK/C/common/inc/ -DCAMPAIGN_DISTANCE_EUCLIDEAN_SQUARED -g -O2 -MT campaign/libcampaign_euclideansquared_1.0_la-hierarchicalGPU.euclideansquared.cu.lo -MD -MP -MF campaign/.deps/libcampaign_euclideansquared_1.0_la-hierarchicalGPU.euclideansquared.cu.Tpo -c campaign/hierarchicalGPU.euclideansquared.cu.cpp -fPIC -DPIC -o campaign/.libs/libcampaign_euclideansquared_1.0_la-hierarchicalGPU.euclideansquared.cu.o
campaign/hierarchicalGPU.euclideansquared.cu.cpp:1:1: error: ‘emtpy’ does not name a type
1 | emtpy-fileemtpy-file
make: *** [Makefile:1179: campaign/libcampaign_euclideansquared_1.0_la-hierarchicalGPU.euclideansquared.cu.lo] Error 1
make: Leaving directory '/home/farshad/proj/cudamigration/apps/cuda/campaign/campaign-1.0/build'
make: *** [Makefile:486: all] Error 2
Content of the hierarchicalGPU.euclideansquared.cu.cpp:
$ more campaign/hierarchicalGPU.euclideansquared.cu.cpp
I then remove this file and execute make again to extract the exact command intended to create this file:
$ rm campaign/hierarchicalGPU.euclideansquared.cu.cpp
$ make -n campaign/hierarchicalGPU.euclideansquared.cu.cpp
nvcc -cuda -g -I. -I/home/farshad/NVIDIA_GPU_Computing_SDK/C/common/inc/ -I.. ../campaign/hierarchicalGPU.cu -o campaign/hierarchicalGPU.euclideansquared.cu.cpp -DCAMPAIGN_DISTANCE_EUCLIDEAN_SQUARED -DHAVE_CONFIG_H -DNVCC_COMPILE
Then, instead of executing make, I execute intercept-build using above expanded command:
$ intercept-build --append nvcc -cuda -g -I. -I/home/farshad/NVIDIA_GPU_Computing_SDK/C/common/inc/ -I.. ../campaign/hierarchicalGPU.cu -o campaign/hierarchicalGPU.euclideansquared.cu.cpp -DCAMPAIGN_DISTANCE_EUCLIDEAN_SQUARED -DHAVE_CONFIG_H -DNVCC_COMPILE
I can see the size of the file and proper content:
$ ll campaign/hierarchicalGPU.euclideansquared.cu.cpp
-rw-rw-r-- 1 farshad farshad 3397028 Sep 29 09:31 campaign/hierarchicalGPU.euclideansquared.cu.cpp
I am including the Makefile and all dependencies you may need to reproduce this issue if you need to. Unfortunately doing this for all 18 kernels is quite cumbersome and not scalable, since this will go to customer. any help is appreciated.
Thanks for reporting this issue to us.
We are also getting the same issue on our side, and also tried with the workaround and it is generating the correct .cpp file, so are forwarding this issue to the concerned team.
Thanks for your patience. The issue raised by you has been fixed in the latest OneAPI version 2021.2. Please download and let us know your experience with it.
We are closing this thread as the issue has been resolved in the latest version.
We will no longer respond to this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only