Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
696 Discussions

issues to convert project to use DPC++ 2023

Daniel_D
Novice
4,793 Views

Hi,

 

I try to convert my project to use the Intel DPC++ 2023 compiler to benefit from its option to use GPUs. Unfortunately I use boost and that seems to be something the compiler does not support. I get houndres of:

 

 

\boost_1_81_0\boost/winapi/get_last_error.hpp(21,53): : warning : '__stdcall' calling convention is not supported for this target [-Wignored-attributes]

BOOST_WINAPI_IMPORT_EXCEPT_WM boost::winapi::DWORD_ BOOST_WINAPI_WINAPI_CC GetLastError(BOOST_WINAPI_DETAIL_VOID);
11:04:59:344 1> ^
11:04:59:344 1> \boost_1_81_0\boost/winapi/basic_types.hpp(51,32): note: expanded from macro 'BOOST_WINAPI_WINAPI_CC'
11:04:59:344 1> #define BOOST_WINAPI_WINAPI_CC WINAPI
11:04:59:344 1> ^
11:04:59:344 1> C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(128,21): note: expanded from macro 'WINAPI'
11:04:59:344 1> #define WINAPI __stdcall

 

for each call of a boost function. And I also get an error complaining the thgreading model:

 

\boost_1_81_0\boost/config/requires_threads.hpp(82,4): : error : "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"

 

Does anyone have had the same issues with DPC++ and boost in the past? Any way to solve this?

 

Using the same codebase and project/solution with the Intel C++ 2023 toolkit works without any warnings/error.

 

Thanks.

0 Kudos
1 Solution
SeshaP_Intel
Moderator
4,406 Views

Hi,

 

In this 2nd case, you can explicitly define the BOOST_HAS_THREADS macro in the source code to remove the errors while using the DPC++ compiler.

In the 3rd case, you can add the additional compiler option /Wno-ignored-attributes in the command line so that can be used to ignore the warnings.

Please find the below screenshot for more details.

SeshaP_Intel_0-1677227420341.png

Hope this resolves your issue.

 

Thanks and Regards,

Pendyala Sesha Srinivas

View solution in original post

0 Kudos
12 Replies
SeshaP_Intel
Moderator
4,763 Views

Hi,


Thank you for posting in Intel Communities.

Have you tried to add the compiler linker option /MT or /MD in the command line while running? 

Could you please provide the following details so that we can reproduce the issue on our end?

1. Full reproducer code with steps you have followed.

2. Boost version.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Daniel_D
Novice
4,717 Views

Hi,

 

/MDd for debug and /MD for release version is already in the command line:

section from the debug configuration.


//I"T:\3rdParty\rapidjson" //I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8/include" /Zi /D "BOOST_ALL_NO_LIB" /D "_DEBUG" /D "_CONSOLE" /D "_WINDLL" /WX- /MDd /std:c++17 /EHsc /W1 /nologo

 

please note that all include options starts with //

 

Boost version is 1.81.0 (boost_1_81_0) - I compiled the libraries with clang for use with the intel compiler; works with Intel C++ 2023.

 

 

0 Kudos
SeshaP_Intel
Moderator
4,689 Views

Hi,


Could you please provide the following details you were using so that we can investigate the issue on our end?

1. Visual Studio version details.

2. Hardware(CPU and GPU) details.

3. Full Steps followed to build the Boost library.

4. Project you were building.

5. Why you have included rapidjson and CUDA files in the command line?

6. What is the option present in the following path?

Open Visual Studio properties > Configuration properties > DPC++ > All Options > Runtime Library


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Daniel_D
Novice
4,680 Views

Hi,

 

please find below the information you requested:

1. VS

Microsoft Visual Studio Community 2022
Version 17.4.4
VisualStudio.17.Release/17.4.4+33213.308
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA776
Microsoft Visual C++ 2022

ASP.NET and Web Tools 17.4.326.54890
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.4.326.54890
Azure App Service Tools v3.0.0

C# Tools 4.4.0-6.22608.27+af1e46ad38d900023f8b1a2839484e471ece1502
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

File Differ 3.0.43
The easiest way to diff two files directly in Solution Explorer

Intel Libraries for oneAPI Package ID: w_oneAPI_2023.0.0.25839
Intel Libraries for oneAPI – toolkit version: 2023.0.0, extension version 23.0.0.17, Package ID: w_oneAPI_2023.0.0.25839, Copyright © 2019-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® C++ Compiler Package ID: w_oneAPI_2023.0.0.25839
Intel® C++ Compiler – toolkit version: 2023.0.0, extension version 23.0.17, Package ID: w_oneAPI_2023.0.0.25839, Copyright © 2002-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® DPC++ Compatibility Tool Package ID: w_oneAPI_2023.0.0.25547
Intel® DPC++ Compatibility Tool – toolkit version: 2023.0.0, extension version 2023.0.0.17, Package ID: w_oneAPI_2023.0.0.25547, Copyright © 2019-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® oneAPI DPC++ Compiler Package ID: w_oneAPI_2023.0.0.25839
Intel® oneAPI DPC++ Compiler – toolkit version: 2023.0.0, extension version 23.0.0.17, Package ID: w_oneAPI_2023.0.0.25839, Copyright © 2019-2022 Intel Corporation. All rights reserved.
* Other names and brands may be claimed as the property of others.

Intel® oneAPI Menu & Samples 10.10.392.9731
Intel® oneAPI Visual Studio Menu & Samples Extension

Intel® VTune™ Profiler 2023 1.3.3
Intel® VTune™ Profiler 2023, (build 1.3.3), Copyright © 2009-2022 Intel Corporation. All rights reserved.

Linux Core Dump Debugging 1.0.9.33020
Enables debugging of Linux core dumps.

Markdown Editor v2 2.0.132
A full featured Markdown editor with live preview and syntax highlighting. Supports GitHub flavored Markdown.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft SARIF Viewer 3.0.115.33558
Visual Studio Static Analysis Results Interchange Format (SARIF) log file viewer

NuGet Package Manager 6.4.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

NVIDIA CUDA 11.8 Wizards 11.8
Wizards to create new NVIDIA CUDA projects and source files.

NVIDIA CUDA 12.0 Wizards 12.0
Wizards to create new NVIDIA CUDA projects and source files.

NVIDIA Nsight Integration 2022.1.0.4
NVIDIA Nsight Developer Tools Integration for Visual Studio.

NVIDIA Nsight Visual Studio Edition 2022.4.1.23005
NVIDIA Nsight Visual Studio Edition provides tools for GPGPU and graphics development. Copyright © NVIDIA 2010 - 2023.
•Direct3D® and DirectX® are registered trademarks of Microsoft Corporation in the United States and/or other countries.
•Microsoft Detours is used under the Professional license (http://research.microsoft.com/en-us/projects/detours/).
•Gardens Point Parser Generator Copyright 2005 Queensland University of Technology (QUT). All rights reserved.
•Icons from Axialis Software used under the licensing terms found here: www.axialis.com
•NLog Copyright © 2004-2006 Jaroslaw Kowalski (jaak@jkowalski.net)
•zlib and libpng used under the zlib/libpnc license (http://opensource.org/licenses/Zlib)
•Breakpad Copyright ©2006, Google Inc. All rights reserved.
•The OpenGL Extension Wrangler Library
Copyright ©2008-2016, Nigel Stewart (nigels@users.sourceforge.net), Copyright ©2002-2008, Milan Ikits (milan.ikits@ieee.org), Copyright ©2002-2008, Marcelo E. Magallon (mmagallo@debian.org), Copyright ©2002, Lev Povalahev.
All rights reserved.
•LIBSSH2 Copyright ©2004-2007 Sara Golemon (sarag@libssh2.org), Copyright ©2005,2006 Mikhail Gusarov (dottedmag@dottedmag.net),Copyright ©2006-2007 The Written Word, Inc.,Copyright ©2007 Eli Fant (elifantu@mail.ru),Copyright ©2009-2014 Daniel Stenberg., Copyright ©2008, 2009 Simon Josefsson.
All rights reserved.
•Protobuf Copyright ©2014, Google Inc. All rights reserved.
•xxHASH Library Copyright ©2012-2014, Yann Collet. All rights reserved.
•FMT Copyright ©2012 - 2016, Victor Zverovich
•Font Awesome Copyright 2018 Fonticons, Inc.
•ELF Definitions Copyright (c) 2010 Joseph Koshy, All rights reserved.

Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.

NVIDIA Nsight Visual Studio Edition - CUDA support 2022.4.1.23005
NVIDIA Nsight Visual Studio Edition - CUDA support provides tools for CUDA development and debugging.

RunPowerShellCommand Extension 1.0
RunPowerShellCommand Visual Studio Extension Detailed Info

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

Tweaks 2022 1.1.143
A collection of minor fixes and tweaks for Visual Studio to reduce the paper cuts and make you a happier developer

TypeScript Tools 17.0.10921.2001
TypeScript Tools for Microsoft Visual Studio

Visual Assist 10.9.2476.0
For more information about Visual Assist, see the Whole Tomato Software website at http://www.WholeTomato.com. Copyright (c)1997-2022 Whole Tomato Software, LLC

Visual Basic Tools 4.4.0-6.22608.27+af1e46ad38d900023f8b1a2839484e471ece1502
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Linux Development 1.0.9.33020
Visual C++ for Linux Development

Visual Studio File Histories VSHistory
Maintains the history of all files saved in Visual Studio

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

VSColorOutput64 2022.2
Color output for build and debug windows - https://mike-ward.net/vscoloroutput

 

 

 

 

 

 

 

2. Hardware(CPU and GPU) details.

Processor Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz, 3600 Mhz, 8 Core(s), 16 Logical Processor(s)
Installed Physical Memory (RAM) 32,0 GB
Total Virtual Memory 67,8 GB
nVidia 1050 Ti
nVidia 1070
nVidia 3060





3. Full Steps followed to build the Boost library.

set boost_dir=T:\3rdParty\boost_1_81_0
set cores=%NUMBER_OF_PROCESSORS%
cd %boost_dir%
call bootstrap.bat --with-toolset=clang-win
b2 --cleanb2 toolset=clang-win address-model=64 architecture=x86 link=static runtime-link=shared threading=multi --without-graph_parallel --without-mpi --without-python --build-type=complete --stagedir=stage/x64 --prefix=T:\3rdParty\boost_1_81_0 install

 

 

5. Why you have included rapidjson and CUDA files in the command line?

The commandline is not complete - I just want to show you that /MDd is already one option - you suggested:
"Have you tried to add the compiler linker option /MT or /MD in the command line while running? "

 

I need rapidjson and cuda for the project. I want to keep some parts of the development as a cuda kernel - others I want to switch to a kernel that uses intel DPC on the internal intel gpu. If that all works well I want to switch more and more kernel from cuda to DPC. Since it is a lot I planend to switch step by step.

 

 

6. What is the option present in the following path?

for debug:

Daniel_D_0-1676015879879.png

 

for release:

Daniel_D_1-1676015915495.png

 

If you need I can give you access to my development computer so that you can see yourself?

 

Thanks.

0 Kudos
Daniel_D
Novice
4,647 Views

The easiest method to reproduce this problem is to create a default DPC++ project and add the coost include. Please floow these steps to reproduce the problem.

 

1. create a new sample DPC++ project in VS (I think the version op VS does not really matter)

- "File" -> "New" -> "Project"

- select on the right side "DPC++ Console Application"

- click "Next"

- click "Create"

2. Insert at at line 29 : #include <boost/thread/thread.hpp>

3. right click on your solution -> "Properties" to change the project properties

- select on the left "DPC++" and open the tree

- select "General"

- on the right side add the path to you boost include files to "Additional Include Directories"

- click on "Apply" and "OK" to close

4. build the project "Build" -> "Rebuild Solution"

 

That's all. You will then see all the warnings and errors I talk about. I guess these are from missing predefined macros.

 

Please let me know if you need more information.

 

Daniel

 

 

 

 

0 Kudos
SeshaP_Intel
Moderator
4,600 Views

Hi,


As per the system requirements, your GPU did not meet the prerequisite. Please refer to the below link for more details.

https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-dpcpp-system-requirements.html

We can only offer direct support for Intel hardware platforms that the Intel® oneAPI product supports. Intel provides instructions on how to compile oneAPI code for both CPU and a wide range of GPU accelerators. 

Please refer to the below link for more details.

https://intel.github.io/llvm-docs/GetStartedGuide.html


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Daniel_D
Novice
4,589 Views

Hi,

 

not sure which GPU you referring to that is not supported. I was hoping that I can use the GPU that is build into my Intel CPU. As already written I use a Processor Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz, 3600 Mhz, 8 Core(s), 16 Logical Processor(s) that have a GPU build into the chip. I do not want to use any of the nVidia GPUs. I use CUDA for them and it should stay that way for the foreseeable future.

 

The sample application works quite - and uses the GPU on the i9 - the same way I want to use it. I just cannot compile it if I add the line:

#include <boost/thread/thread.hpp>

This sample is completely free of any use of the nVidia GPU and I dop NOT include that is anyway related to CUDA. No cuda includes, no cuda libraries. The code should never execute on any of the nVidias. I want to use the i9 GPU only - nothing else.

 

Hope that is somehow possible - with the use of boost.

 

Thanks,

Daniel

0 Kudos
SeshaP_Intel
Moderator
4,548 Views

Hi,

 

>>That's all. You will then see all the warnings and errors I talk about. I guess these are from missing predefined macros.

 

We did not face any issues with the boost library while building. I have Intel(R) UHD Graphics in my system. You can try building boost using the Intel compiler if you have Intel GPU in your system. You can follow the procedure for building boost using the Intel compiler from the below link. 

https://www.intel.com/content/www/us/en/developer/articles/technical/building-boost-with-oneapi.html?wapkw=building%20boost%20with%20intel%20oneAPI?wapkw=building%20boost%20with%20intel%20oneAPI

 

>>\boost_1_81_0\boost/config/requires_threads.hpp(82,4): : error : "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"

 

You can include the macro before including the header file in your DPC++ code.

 

#define BOOST_HAS_THREADS
#include <boost/thread/thread.hpp>

 

 

Please let us know if you still face any issues.

 

Thanks and Regards,

Pendyala Sesha Srinivas

0 Kudos
Daniel_D
Novice
4,539 Views

Hi,

 

I will create the boost library again following your guidelines later today.

 

Please keep in mind that your own "Intel C++ Compiler 2023", all my installed version of the Microsoft compiler (v143..), Clang on windows and Linux and GCC on Linux can work with this version of boost that I use without any issue; without the define "BOOST_HAS_THREADS". So my first idea was that the boost lib seems to be OK - but that can also be wrong.

 

I added #define BOOST_HAS_THREADS as you recommend. Now I see some warnings that may need some attention since they are pointing to the calling convention:

 

06:38:41:122 1> T:\\3rdParty\\boost_1_81_0\boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp(48,43): : warning : '__thiscall' calling convention is not supported for this target [-Wignored-attributes]
06:38:41:122 1> struct is_member_function_pointer<Ret (BOOST_TT_DEF_CALL C::*)(Args...)BOOST_TT_NOEXCEPT_DECL> : public true_type {};

 

My suspect that a define is missing is because the printed error messages from boost comers from the fact that _MSC_VER is defines as 1934 when I use the Intel DPC++ 2023. This causes:

#ifdef _MSC_VER
#define BOOST_TT_DEF_CALL __thiscall     // <- compiler sees this
#else
#define BOOST_TT_DEF_CALL
#endif

 

that will led to this 

template <class Ret, class C, class...Args BOOST_TT_NOEXCEPT_PARAM>
struct is_member_function_pointer<Ret (BOOST_TT_DEF_CALL C::*)(Args...)BOOST_TT_NOEXCEPT_DECL> : public true_type {};

 

and finally to this:
06:38:41:122 1> T:\\3rdParty\\boost_1_81_0\boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp(48,43): : warning : '__thiscall' calling convention is not supported for this target [-Wignored-attributes]

 

without the define the compiles comes to this point in file "requires_threads.hpp" of boost at line 82 - which also indicates that boost assumes a MSC compiler is compiling:

 

#elif defined _MSC_VER
// Microsoft Visual C++
//
// Must remain the last #elif since some other vendors (Metrowerks, for
// example) also #define _MSC_VER
# error "Compiler threading support is not turned on. Please set the correct command line options for threading: either /MT /MTd /MD or /MDd"

 

In the same file at line 37 boost checks for an intel compiler:

#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)

 

but non of these are defines when using the DPC++ 2023.

 

 

 

 

 

 

0 Kudos
Daniel_D
Novice
4,487 Views

Hi,

 

I made a smaller project to demonstrate the problem.

 

#include <iostream>

int main()
{
std::cout << "Hello World!\n";
}

 

 

I can compile this without any error with all compilers I have: MSVC, clang, gcc, intel c++ and also intel dpc++.

 

 

If I modify this program to:

 

#include <iostream>

#define BOOST_ALL_NO_LIB // no auto link
#include <boost/thread/thread.hpp>

int main()
{
std::cout << "Hello World!\n";
}

 

I can compile it without any error with all compilers - except the Intel DPC++. If I add

 

#include <iostream>

#define BOOST_ALL_NO_LIB // no auto link
#define BOOST_HAS_THREADS
#include <boost/thread/thread.hpp>

int main()
{
std::cout << "Hello World!\n";
}

 

it compiles with all compilers. The Intel DPC++ issues lots of warnings about not supported calling conventions:

08:10:11:252 1> T:\\3rdParty\\boost_1_81_0\boost/type_traits/detail/is_member_function_pointer_cxx_11.hpp(399,42): : warning : '__thiscall' calling convention is not supported for this target [-Wignored-attributes]
08:10:11:252 1> struct is_member_function_pointer<Ret(BOOST_TT_DEF_CALL C::*)(Args...)const & BOOST_TT_NOEXCEPT_DECL> : public true_type {};

 

Is that expected? Is it save to ignore this warning?

 

Thanks,

Daniel

 

0 Kudos
SeshaP_Intel
Moderator
4,407 Views

Hi,

 

In this 2nd case, you can explicitly define the BOOST_HAS_THREADS macro in the source code to remove the errors while using the DPC++ compiler.

In the 3rd case, you can add the additional compiler option /Wno-ignored-attributes in the command line so that can be used to ignore the warnings.

Please find the below screenshot for more details.

SeshaP_Intel_0-1677227420341.png

Hope this resolves your issue.

 

Thanks and Regards,

Pendyala Sesha Srinivas

0 Kudos
SeshaP_Intel
Moderator
4,391 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Reply