Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

icpx and C++ standards

MarjanAsgari
Beginner
3,448 Views

Hi,

I'm trying to compile some C++ and C files using some makefiles and icpx compiler. The problem is that compiler throws errors from some libraries such s gdal library, which doesn't make senses to me. So, I am wondering maybe the problem is with C++ standards that i am trying to use. My question is which C++ standards are defined for Intel oneAPI base toolkit? or can someone help me with suggestions for solving the errors in the screenshot attached?

 

Thanks

Screenshot from 2021-06-25 11-40-32.png

0 Kudos
10 Replies
MRajesh_intel
Moderator
3,392 Views

Hi,

 

>>Which C++ standards are defined for Intel oneAPI base toolkit? 

The Intel® oneAPI DPC++/C++ Compiler conforms to the ANSI/ISO C++17 standard.

 

Please visit this link for more information:

https://software.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compatibility-and-portability/conformance-to-the-c-c-dpc-standards.html

 

Could you please provide the compiler version, OS version, and minimal reproducer along with build steps. So that we can check it on our end.

 

Regards

Rajesh.

 

 

0 Kudos
MarjanAsgari
Beginner
3,378 Views

Hi Rajesh, 

 

I appreciate your help!

 

I tried to go with C++17 standards, but it seems it doesn't work. 

" CFLAGS="-qopenmp -fPIC -O2 -std=c++17 -w -fp-model precise" "
 
Info:
Compiler version: oneAPI environemnt : BASH_VERSION: 5.0.17(1)
I installed --> l_BaseKit_p_2021.2.0.2883_offline.sh
OS Version:  Linux-Ubuntu version 20.04.2 LTS (Focal Fossa)
The steps I followed:

Then, I tried to compile GDAL C/C++ files. But lots of errors I face, especially for C programs.

Compiling any C program in the attached rar file throws many errors --> both using icpx /path/ and icx  /path/

 

I appreciate a lot any help, 

Marjan

 

0 Kudos
MRajesh_intel
Moderator
3,369 Views

Hi,


We have installed the GDAL package. Can you please share the build steps for compiling the C files, so that we can reproduce the issue on our end.


Regards

Rajesh.


0 Kudos
MarjanAsgari
Beginner
3,359 Views

Hi Rajesh, 

 

Thank you so much for your help. After all installations, I ran the "makefile" in the Model folder --> "make -f makefile mk_debug"

This is the way I try to compile them. I see most of the errors are related to C programmes (we have combinations of C and C++ programs), for example, the error of casting "void* to "uint8*", etc. So, I appreciate any help me how I can deal with this issue and combinations of C and C++

 

 

Thank you, 

Marjan

0 Kudos
MRajesh_intel
Moderator
3,313 Views

Hi,

 

I have replaced static_cast<uint8*> to (uint8*) in tif_getimage.c and tried ICC/ICX 2021.2 compiler and I was unable to reproduce your errors.

 

Results from the make and makefile are attached.

 

Regards

Rajesh.

 

 

0 Kudos
MarjanAsgari
Beginner
3,303 Views

Thank you, Rajesh,

Can I please ask you how did you use  ICC/ICX 2021.2 compiler? Is it in the Intel OneAPI toolkit? If yes, can you please what tag/syntax you have used?  if not can you please tell me how to install it? 

Because the only tag I am able to use without error is either icpx.... or icx ...., and both throw errors that I already had. 

 

Best, 

Marjan

0 Kudos
MRajesh_intel
Moderator
3,295 Views

Hi,

 

ICC compiler is present in Intel oneAPI HPC toolkit. You can download it from the below link:

 

https://software.intel.com/content/www/us/en/develop/tools/oneapi/hpc-toolkit/download.html?operatingsystem=linux&distributions=webdownload

 

From installing libgdal-dev: gdal-config --version is 2.2.3

I have set the CC=icx or icc in the makefile.

 

To start the oneAPI environment please source the oneAPI environment using this command:

source /opt/intel/oneapi/setvars.sh

 

I have made the above change in your project and it worked.

 

Please let us know if you face any issues.

 

Regards

Rajesh.

 

0 Kudos
MRajesh_intel
Moderator
3,273 Views

Hi,


Can you please provide an update on whether your issue has been resolved or not?


Regards

Rajesh.


0 Kudos
MarjanAsgari
Beginner
3,270 Views

Hi Rajesh, 

I was working on this issue yesterday and your solution worked well! I installed Intel OneAPI HPC toolkit on my ubuntu VM and I used classic C++ compiler (icc) and it worked great. I didn't receive any code-related errors from compiling the gdal library.

Many many thanks to you!

Marjan 

0 Kudos
MRajesh_intel
Moderator
3,255 Views

Hi,


Thanks for the confirmation!


As this issue has been resolved, we will no longer respond to this thread. If you require any additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only.


Have a Good day.


Regards

Rajesh.


0 Kudos
Reply