- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello!
my scenario: I want to add some sycl files to an existing c++ project that uses g++ as the compiler. In order to reduce the cost of replacing compiler, I want to use dpc++ only as the sycl device compiler.
This link provides a way to use g++ as host compiler, but only for a simple demo.
Is there a cmake file example that can achieve mixed compilation (g++ and dpc++)?
Looking forward to your reply!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>One thing I want to make sure is that the host compilation option `-fPIC` in makfile is required ?
Thank you for your patience.
-fPIC option is required if the object files are eventually linked to output a shared library. It is not necessary to use -fPIC option while doing host-side compilation using a third party compiler.
Please refer to below link for more details:
Hope we answered all your queries, Could you please confirm whether we can close this thread from our end?
Thanks & Regards,
Noorjahan.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for posting in Intel Communities.
We are working on your issue. We will get back to you soon.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
CMake only keeps one set of compiler properties which is shared by all targets in a CMakeLists.txt file. If you want to use two compilers, you need to run CMake twice
I have tried with Makefile using some sample programs with oneAPI compiler 2023.2 and g++ 11.4 on Ubuntu 20.04
Please find the attached zip file for the Makefile and code samples.
Please try building the Makefile using the following commands:
1. make
2 ./my_program
If this does not match your use-case, Could you please share a sample reproducer and CMake file if you have tried any at your end?
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your excellent work, this solved my problem very well !
One thing I want to make sure is that the host compilation option `-fPIC` in makfile is required ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We haven't heard back from you. Could you please provide an update on your issue?
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>this solved my problem very well
Thank you for trying our solution.
>>One thing I want to make sure is that the host compilation option `-fPIC` in makfile is required ?
We are working on it and we will get back to you soon.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>One thing I want to make sure is that the host compilation option `-fPIC` in makfile is required ?
Thank you for your patience.
-fPIC option is required if the object files are eventually linked to output a shared library. It is not necessary to use -fPIC option while doing host-side compilation using a third party compiler.
Please refer to below link for more details:
Hope we answered all your queries, Could you please confirm whether we can close this thread from our end?
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.
Thanks & Regards,
Noorjahan.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page