- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile a project using CLion and Intel compilers but I can't seem to make it work.
As this figure I am pointing at the intel compiler but I get the following errors when CLion tries to compile a test program:
Building CXX object CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o
/usr/local/bin/icc-2021.4.0 -MD -MT CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o -c /Users/saeid/CLionProjects/oorbs/cmake-build-oa_release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
Linking CXX executable cmTC_cacd3
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E cmake_link_script CMakeFiles/cmTC_cacd3.dir/link.txt --verbose=1
/usr/local/bin/icc-2021.4.0 -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o -o cmTC_cacd3
ld: library not found for -lc++
make[1]: *** [cmTC_cacd3] Error 1
make: *** [cmTC_cacd3/fast] Error 2
I know that OneAPI does not officially support CLion but what I want to do is quite simple and universal. I appreciate if someone could give me some hint.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following solution suggested by Lev will resolve the toolchain problem:
can you please run sudo xcode-select -p
and see which XCode is used by your terminal?
If that's CommandLineTools then please run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
(with this path or path to xcode you have installed) and then reset Cache and reload your cmake project, this should resolve your issue...
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
>> OneAPI does not officially support CLion but what I want to do is quite simple and universal
We will check with the internal team and get back to you soon.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Noorjahan,
Thank you very much, I forgot to mention that I am using MacOS.
regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry for the inconvenience. As Intel oneAPI does not officially support CLion we could not provide further support to this thread.
Could you please let us know whether you have any other issues? If not, could you please confirm whether to close this issue from our end?
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I think CLion is simply running this compilation command on terminal and returning the response from Intel compiler.
/usr/local/bin/icc-2021.4.0 -MD -MT CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_cacd3.dir/testCXXCompiler.cxx.o -c /Users/saeid/CLionProjects/oorbs/cmake-build-oa_release/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
The error occurs when linking libraries: "Linking CXX executable cmTC_cacd3" because "lc++" library is not found.
I suppose if I copy and past it in the terminal I will get same error. (I can confirm this when I have access to my Mac station).
A similar command works fine with GCC and Clang compilers.
I appreciate it if you could correct me if there is anything wrong with this command to compile a program. e.g. whether it is using the right compiler (/usr/local/bin/icc-2021.4.0) and flags.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>> compilation command on terminal and returning the response from Intel compiler
Could you please provide a sample reproducer(steps if any to reproduce the issue)? so that it will help us to investigate more on your issue.
Also please provide the MacOS version that you are using.
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Could you please provide the above-requested details? so that it will help us to investigate more on your issue.
Thanks & Regards
Noorjahan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Noorjahan,
I could not recreate this issue with Xcode, so I contacted CLion developers.
I leave the link here for the reference of the other OpenAPI users who are having same problem as me:
https://youtrack.jetbrains.com/issue/CPP-27488
According to the response, I need to provide "environment script" that is provided by Intel.
If you know about this script and whether it comes with OneAPI it can be a great help.
Best,
S. Mehr
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
>>I need to provide "environment script" that is provided by Intel.
Intel provides " setvars.sh " script file that comes with oneAPI which helps to set the environment variables for use with the oneAPI toolkits.
you can find the script in below path:
opt/intel/oneapi/setvars.sh
You can refer to the below link for more details:
Thanks & Regards,
Noorjahan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Has the information provided above helped? If yes, 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,
I couldn't resolve the issue yet, but we also have compiler ABI info detection issue with CMake and it seems that it's an intel compiler issue that will be resolved in 2021.5 release version of the intel compiler. So we are waiting for the next release before continuing to work on this problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following solution suggested by Lev will resolve the toolchain problem:
can you please run sudo xcode-select -p
and see which XCode is used by your terminal?
If that's CommandLineTools then please run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
(with this path or path to xcode you have installed) and then reset Cache and reload your cmake project, this should resolve your issue...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Glad to know that your issue is resolved.
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