Nowadays, I purchased Intel Parallel Studio XE in order to use Intel compiler, icc with TBB.
However, I faced with compile error when switched from gcc into icc as the below,
/TO_USER_DIRECTORY/intel/tbb/include/tbb/machine/linux_common.h(47): internal error: bad pointer
#if defined(__linux__) || __TBB_has_include(<linux/futex.h>)
Curiously, some environment succeeded in compilation but some failed though they were the same Linux OS, Ubuntu 18.04.
(Thought as irrelevant, succeeded machine is Xeon, and failed one is Core i7)
If you know how to resolve, I would appreciate it if you could tell me.
Could you, please, share the versions of the products that you use. You can add "-V" to the compiler command line to obtain the compiler version. What TBB version do you use? Is it shipped together with Intel Parallel Studio XE or have you downloaded it from github?
Thank you so much for your comment.
I checked the version as you told me and the results of both environments was the below
> Intel(R) C++ Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.104.22.168 Build 20190206
The failed environment was tried in the TBB versions of github (tbb-2019_U5) and shipped with Intel Parallel Studio XE., and both failed.
After you told me your question, I have tried to switch TBB of an old TBB into TBB shipped with XE in the succeeded environment,
and I reproduced the same error there.
In the succeeded environment, I confirmed I used TBB version of github is as the below (I merely confirmed CHANGE file in the top directory)
Intel TBB 2019 Update 2
TBB_INTERFACE_VERSION == 11002
I hope it helps.
Now I checked. In the failed environment, I switched TBB of github of U5 into U2, and then I succeeded the compilation.
At least in my machine, the recent TBB code seems to be incompatible with Intel compiler.
I wish it leads to improvement of Intel TBB.
We failed to reproduce the issue. Could you, please, provide more details about your environments: compiler command line, CPU detailed version, used TBB algorithms and any other information that looks different on problematic and non-problematic environments. Is it possible to share your test application?
Thank you for your consideration.
I strongly believe Intel's test procedures are done in a correct manner, so that there must be my mistake in setting.
Now my previous problematic and non-problematic environments encountered the same errors(TBB 2019 U2 succeeded, but U5 and the shipped with XE failed by icc), I told you my doubtful setting compared to official usage.
I used cmake build system with clion 2017.3. I set CMakeLists.txt not as official guideline, but direct reference to include directory and library directory with -ltbb compile option.
Though this is my hypothesis, in my setting, reference to required dependent file's directories is set incorrectly.
(Compile error occurs in compile step where a cpp file includes tbb.h, not linking step)
Unfortunately, I cannot share my test application code immediately. Now I purchase XE and so obtains customer support rights. Is it possible to share my codes as confidential information between you and us?
I hope this makes a contribution to improvement of TBB.
CMakeLists.txt is written as the below.
Paths to the tbb directories were switched between github versions and XE.
Dear TBB engineers
I encountered the same problem in oneTBB 2019 & 2020 as the below,
and, I found a solution.
> toTBBInclude/tbb/machine/linux_common.h(47): internal error: bad pointer
> #if defined(__linux__) || __TBB_has_include(<linux/futex.h>)
When #include <tbb/tbb.h> is written in the top of source file,
this error has vanished.
Therefore, I thought that this problem is rooted in the position of #include <linux/futex.h>.
I hope this post leads to some growth of TBB.
The customer support engineer has recommended to submit a ticket through a support page (https://supporttickets.intel.com) where you can attach the confidential code. Is it convenient for you?
I deeply appreciate your kindness.
I am going to consider whether or not to submit a ticket,
but at present, I can run my code with TBB U2, so that I will decide it as I compare with some technical alternative options.
Lastly, thank you so much for your helps as always.
I am really sorry that we cannot reproduce the issue and enable you using TBB 2019 U5. Unfortunately, the internal compiler errors are weird and heavily depend on neighboring code and usage model. Surely, it is up to you to submit the code or not.
I have exactly the same problem, getting the same error message as given in the first posting of this thread. My configuration (via modules on the HPC cluster I am using): Intel/2019.3.199-GCC-8.3.0 with tbb/2019.4.199. With the previous version (Intel/2019.0.117-GCC-7.3.0 with tbb/2019.0.117) the same code compiles just fine. I therefore believe this is a real regression in the compiler and would like to ask if there have been any new developments to resolve the issue.
Thank you all for participating in this discussion. The issue seems to be the compiler regression. We consulted with our compiler support group and the recommendation is to move this discussion into Compiler related Forum. The Compiler support engineer is aware of the issue.
This issue persists in parallel studio 2020 intel compiler (icc (ICC) 22.214.171.124 20191121)
Another workaround (rather than editing tbb headers) would be to define __has_include macro to return 1 somewhere before including tbb.h