<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:Intel oneAPI dpcpp compiler with google test in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1381687#M2104</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 04 May 2022 09:39:33 GMT</pubDate>
    <dc:creator>HemanthCH_Intel</dc:creator>
    <dc:date>2022-05-04T09:39:33Z</dc:date>
    <item>
      <title>Intel oneAPI dpcpp compiler with google test</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1377863#M2054</link>
      <description>&lt;P&gt;I'm kind a new to the world of Intel's HPC toolchain and I'm facing some troubles making even simple DPC++ application to work when gtest is used as a testing framework&lt;/P&gt;
&lt;P&gt;This is the CMakeLists "structure" I'm following&lt;/P&gt;
&lt;PRE&gt;cmake_minimum_required(VERSION 3.14)
project(foo)

set(CMAKE_CXX_COMPILER "dpcpp")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -fsycl")

# add executables 
# target linked libraries 
# ...

option(ENABLE_TESTS ON)
if(ENABLE_TESTS)
  FetchContent_Declare(
    googletest
    GIT_REPOSITORY https://github.com/google/googletest.git
    GIT_TAG release-1.11.0
  )
  set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
  FetchContent_MakeAvailable(googletest)

  add_subdirectory(tests)
endif()
&lt;/PRE&gt;
&lt;P&gt;If I remove the last block.&lt;A href="https://bit.ly/37mH7En" target="_self"&gt;&amp;nbsp;&lt;/A&gt;it compiles and runs as expected, otherwise I get the following error:&lt;/P&gt;
&lt;PRE&gt;CMake Error at build/_deps/googletest-src/CMakeLists.txt:10 (project):
  The CMAKE_CXX_COMPILER:

    dpcpp

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.


-- Configuring incomplete, errors occurred!
See also "/home/u141905/foo/build/CMakeFiles/CMakeOutput.log".
See also "/home/u141905/foo/build/CMakeFiles/CMakeError.log".
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/c++

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
make: *** [Makefile:2: all] Error 1
&lt;/PRE&gt;
&lt;P&gt;Please notice that dpcpp is correctly set, in fact I'm using Intel's devcloud platform. Setting&amp;nbsp;CXXto the output of&amp;nbsp;whereis dpcpp&amp;nbsp;produces the same error. The only "workaround" (I doubt it is one though) I found is using clang++ instead (the version from Intel's llvm). Any help or suggestion is much appreciated, thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2022 17:13:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1377863#M2054</guid>
      <dc:creator>noorpari76</dc:creator>
      <dc:date>2022-04-18T17:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Intel oneAPI dpcpp compiler with google test</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1378113#M2055</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for posting in Intel Communities.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please use the path for dpcpp binary for setting the CMAKE_CXX_COMPILER instead of using"set(CMAKE_CXX_COMPILER "dpcpp")". After adding the path("/opt/intel/oneapi/compiler/2022.0.1/linux/bin/dpcpp") to the CMAKE_CXX_COMPILER, we are able to run the program successfully.&lt;/P&gt;
&lt;P&gt;Please find the below CMakeLists.txt for setting the CMAKE_CXX_COMPILER:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;cmake_minimum_required(VERSION 3.14)
project(foo)
set(CMAKE_CXX_COMPILER "/opt/intel/oneapi/compiler/2022.0.1/linux/bin/dpcpp")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -fsycl")
# add executables
# target linked libraries
# ...
set(ENABLE_TESTS ON)
include(FetchContent)
if(ENABLE_TESTS)
 FetchContent_Declare(
  googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG release-1.11.0
 )
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
add_subdirectory(tests)
endif()

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The output of the above code:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="HemanthCH_Intel_0-1650370877824.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/28697i3E93A431AAEAF9B2/image-size/medium?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="HemanthCH_Intel_0-1650370877824.png" alt="HemanthCH_Intel_0-1650370877824.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;
&lt;P&gt;Hemanth&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 12:23:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1378113#M2055</guid>
      <dc:creator>HemanthCH_Intel</dc:creator>
      <dc:date>2022-04-19T12:23:05Z</dc:date>
    </item>
    <item>
      <title>Re:Intel oneAPI dpcpp compiler with google test</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1379764#M2077</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We haven't heard back from you. Could you please provide any updates on your issue?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 26 Apr 2022 10:00:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1379764#M2077</guid>
      <dc:creator>HemanthCH_Intel</dc:creator>
      <dc:date>2022-04-26T10:00:55Z</dc:date>
    </item>
    <item>
      <title>Re:Intel oneAPI dpcpp compiler with google test</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1381687#M2104</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Hemanth&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 May 2022 09:39:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/Intel-oneAPI-dpcpp-compiler-with-google-test/m-p/1381687#M2104</guid>
      <dc:creator>HemanthCH_Intel</dc:creator>
      <dc:date>2022-05-04T09:39:33Z</dc:date>
    </item>
  </channel>
</rss>

