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.

svrng compilation fails

SGold21
Beginner
2,309 Views

I am trying to compile a project on Linux with oneAPI using Eclipse.

The include to svrng.h fails because:

/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:28: error: expected parameter declarator
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_uint16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))

 

What might be the problem?

Thank you

 

0 Kudos
1 Solution
Alex_Y_Intel
Moderator
2,100 Views

From the pictures and log you've supplied, you're using Intel oneAPI DPC++ compiler. Since you mentioned that it's a pure C++ application, you should use icx compiler instead and this problem should go away.


View solution in original post

0 Kudos
10 Replies
Alex_Y_Intel
Moderator
2,276 Views

Can you please supply reproducer?


0 Kudos
SGold21
Beginner
2,256 Views

just include "svrng.h" 

I included it (just #include "svrng.h" line)  to a working project - and it fails.

0 Kudos
Alex_Y_Intel
Moderator
2,194 Views

Can you please tell me which compiler you tried to use? Is it a DPC++ or C++ application?


0 Kudos
SGold21
Beginner
2,173 Views

It's a pure C++ application that compiles fine with the OneAPI compiler up to the point where I include "svrng.h"

0 Kudos
Alex_Y_Intel
Moderator
2,154 Views

Can you please provide a screen shot of project settings/compiler settings in Eclipse, and a copy of your verbose build log?


0 Kudos
SGold21
Beginner
2,128 Views

These are the settings I change:

 

SGold21_0-1631450558694.png

 

SGold21_1-1631450632530.png

SGold21_2-1631450764306.png

 

 

 

 

 

The log:

 

Building file: ../JustTimeDelay.cpp
Invoking: Intel(R) oneAPI DPC++ Compiler
dpcpp -Wall -O2 -ipp=common -I/home/user/eclipse-workspace/TimeDelay -fPIC -mavx2 -MMD -MP -c -o "JustTimeDelay.o" "../JustTimeDelay.cpp"
In file included from ../JustTimeDelay.cpp:7:
In file included from /home/user/eclipse-workspace/TimeDelay/TimeDelay.h:5:
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:28: error: expected parameter declarator
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_uint16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:28: error: expected ')'
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:28: note: to match this '('
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:50: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:37: error: function definition declared 'typedef'
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_uint16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:28: error: incomplete result type 'struct __declspec' in function definition
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_uint16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:45: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:28: note: forward declaration of '__declspec'
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:34: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:350:65: error: C++ requires a type specifier for all declarations
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_uint16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:351:28: error: expected parameter declarator
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; } svrng_uint32_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:351:28: error: expected ')'
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:351:28: note: to match this '('
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:50: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:351:37: error: function definition declared 'typedef'
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; } svrng_uint32_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:351:89: error: C++ requires a type specifier for all declarations
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; } svrng_uint32_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:363:28: error: expected parameter declarator
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_ulong8_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:363:28: error: expected ')'
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:363:28: note: to match this '('
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:50: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:363:37: error: function definition declared 'typedef'
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_ulong8_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:363:65: error: C++ requires a type specifier for all declarations
typedef struct _ALIGN_ { __m256i r1; __m256i r2; } svrng_ulong8_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:364:28: error: expected parameter declarator
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; } svrng_ulong16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:364:28: error: expected ')'
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:364:28: note: to match this '('
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:50: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:364:37: error: function definition declared 'typedef'
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; } svrng_ulong16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:364:89: error: C++ requires a type specifier for all declarations
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; } svrng_ulong16_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:365:28: error: expected parameter declarator
typedef struct _ALIGN_ { __m256i r1; __m256i r2; __m256i r3; __m256i r4; __m256i r5; __m256i r6; __m256i r7; __m256i r8; } svrng_ulong32_t;
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:365:28: error: expected ')'
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:51: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:365:28: note: to match this '('
/opt/intel/oneapi/compiler/2021.1.1/linux/bin/../compiler/include/svrng.h:338:50: note: expanded from macro '_ALIGN_'
#define _ALIGN_ __declspec(align(32))
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [subdir.mk:23: JustTimeDelay.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

0 Kudos
Alex_Y_Intel
Moderator
2,101 Views

From the pictures and log you've supplied, you're using Intel oneAPI DPC++ compiler. Since you mentioned that it's a pure C++ application, you should use icx compiler instead and this problem should go away.


0 Kudos
SGold21
Beginner
2,090 Views

I have the option of Intel Compiler Classic.

Is it the one you refer to?

If not,  which one is it?

Thanks.

0 Kudos
Alex_Y_Intel
Moderator
2,072 Views

An Intel Classic compiler should be able to compile your application. You can also use new Intel oneAPI C++ compiler. Please refer to this article:

https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compiler-setup/using-eclipse/adding-the-compiler-to-eclipse.html


Adding the Compiler to Eclipse*

This step is needed only if you are manually installing the Intel® oneAPI DPC++/C++ Compiler plug-in for Eclipse*.

To add the Intel oneAPI DPC++/C++ Compiler product extension to your Eclipse configuration:

  1. Start Eclipse.
  2. Select Help > Install New Software.
  3. Next to the Work with field, click the Add button. The Add Repository dialog box opens.
  4. Click the Archive button and browse to the <install_dir>/compiler/<version>/linux/ide_support directory. Select the .zip file that starts with com.intel.compiler for C++ or com.intel.dpcpp.compiler for DPC++, then click OK.
  5. Select Intel® Software Development ToolsIntel® C++ Compiler for C++ or Intel® oneAPI DPC++ CompilerIntel® oneAPI DPC++ Compiler for DPC++, then click OK.
  6. Follow the installation instructions.
  7. When asked if you want to restart Eclipse, select Yes.

When Eclipse restarts, you can create and work with CDT projects that use the Intel oneAPI DPC++/C++ Compiler.


0 Kudos
Alex_Y_Intel
Moderator
2,027 Views

I am going to close this case for now as a solution has been provided.


0 Kudos
Reply