Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

Intercept-build does not work with Makefile

FARSHAD_A_Intel
Employee
2,182 Views

Hello,

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[1]: *** [Makefile:1179: campaign/libcampaign_euclideansquared_1.0_la-hierarchicalGPU.euclideansquared.cu.lo] Error 1
make[1]: 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
emtpy-fileemtpy-file

 

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

Farshad. 

0 Kudos
4 Replies
AbhishekD_Intel
Moderator
2,166 Views

Hi Farshad,


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.



Warm Regards,

Abhishek


0 Kudos
PrasanthD_intel
Moderator
1,942 Views

Hi Farshad,


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.


0 Kudos
PrasanthD_intel
Moderator
1,923 Views

Hi Farshad,


We haven't heard back from you. Please let us know your feedback after testing the latest version.


Regards

Prasanth


0 Kudos
PrasanthD_intel
Moderator
1,915 Views

Hi Farshad


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


Regards

Prasanth


0 Kudos
Reply