Errors when compiling c code with tbb headers

Errors when compiling c code with tbb headers

Аватар пользователя Erez Zilber

Hi,

My project contains only C code on Linux. I've added the following line to a C file:

#include "tbb/atomic.h"
Then, I got the following error during compilation:

/opt/intel/tbb/include/tbb/atomic.h(24): catastrophic error: cannot open source file "cstddef"

  #include 
I switched to icpc and recompiled, but now I get this:

/opt/intel/tbb/include/tbb/tbb_stddef.h(95): error #193: zero used for undefined preprocessing identifier "_WIN32"

  #if _WIN32||_WIN64

      ^
/opt/intel/tbb/include/tbb/tbb_stddef.h(95): error #193: zero used for undefined preprocessing identifier "_WIN64"

  #if _WIN32||_WIN64

              ^
/opt/intel/tbb/include/tbb/tbb_config.h(33): error #193: zero used for undefined preprocessing identifier "__clang__"

  #if __clang__

      ^
/opt/intel/tbb/include/tbb/tbb_config.h(79): error #193: zero used for undefined preprocessing identifier "__MINGW32__"

  #if __MINGW32__ && __TBB_EXCEPTION_PTR_PRESENT && !defined(_GLIBCXX_ATOMIC_BUILTINS_4)

      ^
/opt/intel/tbb/include/tbb/tbb_config.h(134): error #193: zero used for undefined preprocessing identifier "__MIC__"

  #if __MIC__ || __MIC2__

      ^
/opt/intel/tbb/include/tbb/tbb_config.h(134): error #193: zero used for undefined preprocessing identifier "__MIC2__"

  #if __MIC__ || __MIC2__

                 ^
/opt/intel/tbb/include/tbb/tbb_config.h(145): error #193: zero used for undefined preprocessing identifier "__TBB_DEFINE_MIC"

      #if __TBB_DEFINE_MIC

          ^

Can anyone help with this?

BTW - before compiling, I ran the following commands in order to set the environment:

source /opt/intel/bin/compilervars.sh intel64

source /opt/intel/tbb/bin/tbbvars.sh intel64

Thanks,
Erez

2 posts / 0 новое
Последнее сообщение
Пожалуйста, обратитесь к странице Уведомление об оптимизации для более подробной информации относительно производительности и оптимизации в программных продуктах компании Intel.
Аватар пользователя Anton Malakhov (Intel)

TBB is C++ library. It does not support plain C excepting TBB allocator which has such a support.

Зарегистрируйтесь, чтобы оставить комментарий.