<?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:dpcpp gives &amp;quot;InvalidModule: Invalid SPIR-V...&amp;quot; on linking in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316676#M1578</link>
    <description>&lt;P&gt;We've identified the bug. We'll work on this issue internally and get back to you with update. &lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 23 Sep 2021 09:13:07 GMT</pubDate>
    <dc:creator>Alex_Y_Intel</dc:creator>
    <dc:date>2021-09-23T09:13:07Z</dc:date>
    <item>
      <title>dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1313290#M1544</link>
      <description>&lt;P&gt;I'm getting a linking error with dpcpp 2021.3.0:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;InvalidModule: Invalid SPIR-V module: Casts from private/local/global address space are allowed only to generic&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when trying to link in an external library with DPCPP. This appears to be an identical issue to&amp;nbsp;&lt;A href="https://community.intel.com/t5/Intel-oneAPI-Base-Toolkit/Dpcpp-link-error-after-upgrade-from-2021-1-to-2021-2," target="_blank" rel="noopener"&gt;https://community.intel.com/t5/Intel-oneAPI-Base-Toolkit/Dpcpp-link-error-after-upgrade-from-2021-1-to-2021-2, &lt;/A&gt;but not with upgrading, with the difference in versions, being an old thread and the note about closing it I thought it would be better to start a new thread.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can reproduce with this minimal example. Cloning the external dependency:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;$ git clone https://github.com/fmtlib/fmt.git -b 8.0.1&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and with CMakeLists.txt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;cmake_minimum_required(VERSION 3.20 FATAL_ERROR)

set(CMAKE_CXX_COMPILER dpcpp)
set(CMAKE_CXX_STANDARD 17)
project(dpcpp CXX)

add_subdirectory(fmt)

add_executable(try try.cc)
target_link_libraries(try fmt::fmt)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And try.cc:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;#include &amp;lt;fmt/core.h&amp;gt;

int main(int argc, char** argv) {
    fmt::print("{:35}", "Result from kernel:");
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I get (&lt;FONT face="courier new,courier"&gt;mkdir _build &amp;amp;&amp;amp; cd _build &amp;amp;&amp;amp; cmake .. &amp;amp;&amp;amp; ninja&lt;/FONT&gt;&lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[5/5] Linking CXX executable try
FAILED: try
: &amp;amp;&amp;amp; /opt/intel/oneapi/compiler/2021.3.0/linux/bin/dpcpp   CMakeFiles/try.dir/try.cc.o -o try  fmt/libfmt.a &amp;amp;&amp;amp; :
InvalidModule: Invalid SPIR-V module: Casts from private/local/global address space are allowed only to generic

llvm-foreach:
dpcpp: error: llvm-spirv command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Interestingly enough, if I add the &lt;FONT face="courier new,courier"&gt;-fintelfpga&lt;/FONT&gt; flag to the linker, this actually completes (apparently) successfully. I'm guessing this is something to do with what dpcpp assumes the standard targets are?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Am I not supposed to be compiling other libraries with dpcpp and trying to isolate it (in which case, CMake becomes tricker, as multiple compilers for the same language isn't so easy, and care needs to be taken to sync up ABI versions, etc.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, is there some way I can work around or understand what is causing this issue, preferably without abandoning other libraries?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 12:30:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1313290#M1544</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-09-09T12:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1313295#M1545</link>
      <description>&lt;P&gt;Possibly (dpcpp-specific) related:&amp;nbsp;&lt;A href="https://github.com/intel/llvm/issues/3172" target="_blank"&gt;https://github.com/intel/llvm/issues/3172&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;It looks like I can bypass the specific issue by using the header-only version of the library here, but it'd be good to understand if it's me or the compiler being dumb here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 13:02:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1313295#M1545</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-09-09T13:02:16Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1314127#M1547</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for reaching out to us.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks for providing the details. We are able to reproduce the issue. We are working on it and will get back to you soon.&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;Shivani&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 13 Sep 2021 12:05:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1314127#M1547</guid>
      <dc:creator>ShivaniK_Intel</dc:creator>
      <dc:date>2021-09-13T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1315591#M1564</link>
      <description>&lt;P&gt;Please help me clarify these questions: &lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Does the problem occur when you try to compile the files in "source" directory first to be static libraries and link them later? &lt;/LI&gt;&lt;LI&gt;For the content of CMakeList.txt you've provided, are those supposed to be additional to the original CMakeList.txt or as a new CMakeList.txt consists of only these lines? &lt;/LI&gt;&lt;LI&gt;Can I suppose that it has nothing to do with cmake version? &lt;/LI&gt;&lt;LI&gt;When you mentioned about adding &lt;SPAN style="font-family: &amp;quot;courier new&amp;quot;, courier;"&gt;-fintelfpga&lt;/SPAN&gt;flag to the linker, can you demonstrate how you add it? &lt;/LI&gt;&lt;LI&gt;Can you provide a smaller reproducer to show the problem? (trim off the unnecessary files and compilation from the original package)&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Sep 2021 09:44:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1315591#M1564</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-09-18T09:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1315596#M1565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;5) I'm not sure how to reduce the example further&amp;nbsp;since it's 10 lines of CMake and 5 lines of C++, beyond removing the external library. I'm not sure how to further narrow down the source of the issue since the external library successfully compiles, just fails to link it in. I have split out the demonstration into a standalone repository:&amp;nbsp;&lt;A href="https://github.com/ndevenish/demonstrate_invalid_module" target="_blank"&gt;https://github.com/ndevenish/demonstrate_invalid_module&lt;/A&gt;&amp;nbsp;. Starting from a devcloud login node:&lt;/P&gt;
&lt;LI-CODE lang="none"&gt;$ qsub -I
$ git clone --recursive https://github.com/ndevenish/demonstrate_invalid_module.git
$ cd demonstrate_invalid_module/
$ mkdir _build &amp;amp;&amp;amp; cd _build
$ cmake ..
$ make -i
[ 11%] Building CXX object fmt/CMakeFiles/fmt.dir/src/format.cc.o
[ 22%] Building CXX object fmt/CMakeFiles/fmt.dir/src/os.cc.o
[ 33%] Linking CXX static library libfmt.a
[ 33%] Built target fmt
[ 44%] Building CXX object CMakeFiles/try.dir/try.cc.o
[ 55%] Linking CXX executable try
InvalidModule: Invalid SPIR-V module: Casts from private/local/global address space are allowed only to generic

llvm-foreach:
dpcpp: error: llvm-spirv command failed with exit code 1 (use -v to see invocation)
[ 55%] Built target try
[ 66%] Building CXX object CMakeFiles/try_intelfpga.dir/try.cc.o
[ 77%] Linking CXX executable try_intelfpga
[ 77%] Built target try_intelfpga
[ 88%] Building CXX object CMakeFiles/try_header_only.dir/try.cc.o
[100%] Linking CXX executable try_header_only
[100%] Built target try_header_only&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) To try what I think you are asking, I tried separating out the call to `fmt::print` into a `call_fmt.a` static library, that privately linked `libfmt.a`. To avoid making the simple example messy, I made these changes in a separate branch: &lt;A href="https://github.com/ndevenish/demonstrate_invalid_module/tree/try_separate_lib" target="_blank"&gt;https://github.com/ndevenish/demonstrate_invalid_module/tree/try_separate_lib&lt;/A&gt; . The issue still happened on the linking of this intermediate library into the target executable.&lt;/P&gt;
&lt;P&gt;2) This CMakeLists.txt was an entirely new standalone CMakeList.txt to demonstrate this issue.&lt;/P&gt;
&lt;P&gt;3)&amp;nbsp;The only possible way I can think this would affect things was in the choice of the C++ standard, as it chooses &lt;FONT face="courier new,courier"&gt;-std=gnu++17&lt;/FONT&gt;. I checked the build with &lt;FONT face="courier new,courier"&gt;-std=c++17&lt;/FONT&gt; and the same error occurs. Otherwise, the actual compile/link instructions emitted look perfectly normal. Setting C++20 as the minimum also has this issue.&lt;/P&gt;
&lt;P&gt;4) I added a second target to the &lt;FONT face="courier new,courier"&gt;CMakeLists.txt&lt;/FONT&gt; in the example repository that adds the &lt;FONT face="courier new,courier"&gt;-fintelfpga&lt;/FONT&gt; flag. This applies the flag to the link stage, and successfully compiles and runs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Sep 2021 11:18:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1315596#M1565</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-09-18T11:18:29Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316144#M1568</link>
      <description>&lt;P&gt;Does the problem occur when you change the CMakeLists.txt to the new shorter version you provided, or does it also exist with the original CMakeLists.txt? &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I've tried your new shorter version of CMakeLists.txt but it shows error as there's no fmt subdirectory. Are you trying to add the subdirectory "include/fmt" instead? &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If I just run with the original CMakeLists.txt, but instead of using "ninja," I use "make," the project actually builds successfully with unicode-test created under the _build/bin directory. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Sep 2021 09:35:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316144#M1568</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-09-21T09:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316169#M1569</link>
      <description>&lt;P class="sub_section_element_selectors"&gt;Hi Ayu1,&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/171094"&gt;@Alex_Y_Intel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Does the problem occur when you change the CMakeLists.txt to the new shorter version you provided, or does it also exist with the original CMakeLists.txt?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P class="sub_section_element_selectors"&gt;The second version in the repo is actually longer, because it includes a demonstration of the &lt;TT&gt;-fintelfpga&lt;/TT&gt; flag. And yes, the issue happens with both.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P class="sub_section_element_selectors"&gt;I've tried your new shorter version of CMakeLists.txt but it shows error as there's no fmt subdirectory. Are you trying to add the subdirectory "include/fmt" instead?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P class="sub_section_element_selectors"&gt;This sounds like you didn't &lt;TT&gt;git clone --recursive&lt;/TT&gt;. I included &lt;TT&gt;fmt&lt;/TT&gt; as a git &lt;A href="https://git-scm.com/docs/gitsubmodules" target="_self"&gt;submodule&lt;/A&gt; in the example so that it would be easier to get an identical environment, but you need to either tell git to clone recursively or &lt;TT&gt;git submodule init[update]&lt;/TT&gt; if you just cloned normally. Otherwise, just cloning the repository into the &lt;TT&gt;fmt/&lt;/TT&gt; subdirectory should be good enough.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
If I just run with the original CMakeLists.txt, but instead of using "ninja," I use "make," the project actually builds successfully with unicode-test created under the _build/bin directory.&lt;/BLOCKQUOTE&gt;
&lt;P class="sub_section_element_selectors"&gt;&lt;BR /&gt;Apologies for the confusion, I used "Ninja" in the original example, because I have that set as my CMake default generator.&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;However, using Make gives identical results for me on devcloud;&amp;nbsp;&lt;TT&gt;unicode-test&lt;/TT&gt; isn't actually the output from this build, and isn't built by fmt unless you explicitly enable testing for fmt (with &lt;TT&gt;-DFMT_TEST=on&lt;/TT&gt;), or possibly build fmt separately. Did you accidentally run your build from within the &lt;TT&gt;fmt/&lt;/TT&gt; subfolder? That would pass the build if you don't tell it to use dpcpp explicitly (e.g. with &lt;TT&gt;mkdir _build_fmt &amp;amp;&amp;amp; cd _build_fmt &amp;amp;&amp;amp;&amp;nbsp;CXX=dpcpp cmake ../fmt&lt;/TT&gt;). If there isn't a failure or a &lt;TT&gt;try&lt;/TT&gt;&amp;nbsp;executable in the root of the build folder then it hasn't built the correct CMakeLists.txt. Additionally, the start of the CMake configure should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;-- The CXX compiler identification is IntelLLVM 2021.3.0&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;if you are properly configured to use dpcpp.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To avoid all uncertainty, here is a Dockerfile that replicates the issue cleanly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FROM intel/oneapi-basekit

RUN apt-get update &amp;amp;&amp;amp; apt-get install -y git

RUN cd /opt &amp;amp;&amp;amp; git clone --recursive https://github.com/ndevenish/demonstrate_invalid_module
RUN mkdir /opt/demonstrate_invalid_module/build
WORKDIR /opt/demonstrate_invalid_module/build

RUN cmake ..
RUN make&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;And running "&lt;TT&gt;docker build ."&lt;/TT&gt; gives:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#10 31.33 [ 55%] Linking CXX executable try
#10 32.68 InvalidModule: Invalid SPIR-V module: Casts from private/local/global address space are allowed only to generic
#10 32.68
#10 32.69 llvm-foreach:
#10 32.69 dpcpp: error: llvm-spirv command failed with exit code 1 (use -v to see invocation)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 11:38:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316169#M1569</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-09-21T11:38:02Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316404#M1570</link>
      <description>&lt;P&gt;I've tried your new source code but with cmake version 3.16: &lt;/P&gt;&lt;P&gt;I can reproduce your problem now but with intelfpga option, I still see the error: &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;cmake_minimum_required(VERSION 3.10 FATAL_ERROR)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;set(CMAKE_CXX_COMPILER dpcpp)&lt;/P&gt;&lt;P&gt;set(CMAKE_CXX_STANDARD 17)&lt;/P&gt;&lt;P&gt;project(dpcpp CXX)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;add_subdirectory(fmt)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;# Standard executable, linking external library&lt;/P&gt;&lt;P&gt;#add_executable(try try.cc)&lt;/P&gt;&lt;P&gt;#target_link_libraries(try fmt::fmt)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;# Linking to the header-only version of this library works&lt;/P&gt;&lt;P&gt;#add_executable(try_header_only try.cc)&lt;/P&gt;&lt;P&gt;#target_link_libraries(try_header_only fmt::fmt-header-only)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;# As does adding the -fintelfpga flag&lt;/P&gt;&lt;P&gt;add_executable(try_intelfpga try.cc)&lt;/P&gt;&lt;P&gt;target_link_options(try_intelfpga PRIVATE -fintelfpga)&lt;/P&gt;&lt;P&gt;target_link_libraries(try_intelfpga fmt::fmt)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Scanning dependencies of target fmt&lt;/P&gt;&lt;P&gt;[ 20%] Building CXX object fmt/CMakeFiles/fmt.dir/src/format.cc.o&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1783:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1989:20: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, float, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return detail::write(out, value, specs, locale);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:2653:10: note: in instantiation of member function 'fmt::detail::vformat_to(buffer&amp;lt;char&amp;gt; &amp;amp;, basic_string_view&amp;lt;char&amp;gt;, basic_format_args&amp;lt;basic_format_context&amp;lt;detail::buffer_appender&amp;lt;type_identity_t&amp;lt;char&amp;gt;&amp;gt;, type_identity_t&amp;lt;char&amp;gt;&amp;gt;&amp;gt;, fmt::detail::locale_ref)::format_handler::on_format_specs' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;struct format_handler : error_handler {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:53:31: note: in instantiation of function template specialization 'fmt::detail::vformat_to&amp;lt;char&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;template FMT_API void detail::vformat_to(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1783:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1989:20: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, double, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return detail::write(out, value, specs, locale);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:2653:10: note: in instantiation of member function 'fmt::detail::vformat_to(buffer&amp;lt;char&amp;gt; &amp;amp;, basic_string_view&amp;lt;char&amp;gt;, basic_format_args&amp;lt;basic_format_context&amp;lt;detail::buffer_appender&amp;lt;type_identity_t&amp;lt;char&amp;gt;&amp;gt;, type_identity_t&amp;lt;char&amp;gt;&amp;gt;&amp;gt;, fmt::detail::locale_ref)::format_handler::on_format_specs' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;struct format_handler : error_handler {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:53:31: note: in instantiation of function template specialization 'fmt::detail::vformat_to&amp;lt;char&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;template FMT_API void detail::vformat_to(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1783:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1989:20: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, long double, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return detail::write(out, value, specs, locale);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:2653:10: note: in instantiation of member function 'fmt::detail::vformat_to(buffer&amp;lt;char&amp;gt; &amp;amp;, basic_string_view&amp;lt;char&amp;gt;, basic_format_args&amp;lt;basic_format_context&amp;lt;detail::buffer_appender&amp;lt;type_identity_t&amp;lt;char&amp;gt;&amp;gt;, type_identity_t&amp;lt;char&amp;gt;&amp;gt;&amp;gt;, fmt::detail::locale_ref)::format_handler::on_format_specs' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;struct format_handler : error_handler {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:53:31: note: in instantiation of function template specialization 'fmt::detail::vformat_to&amp;lt;char&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;template FMT_API void detail::vformat_to(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1836:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1969:12: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, float, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write&amp;lt;Char&amp;gt;(out, value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/core.h:1469:12: note: in instantiation of function template specialization 'fmt::detail::default_arg_formatter&amp;lt;char&amp;gt;::operator()&amp;lt;float&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return vis(arg.value_.float_value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1836:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1969:12: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, double, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write&amp;lt;Char&amp;gt;(out, value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/core.h:1471:12: note: in instantiation of function template specialization 'fmt::detail::default_arg_formatter&amp;lt;char&amp;gt;::operator()&amp;lt;double&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return vis(arg.value_.double_value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;5 warnings generated.&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1783:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1989:20: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, float, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return detail::write(out, value, specs, locale);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:2653:10: note: in instantiation of member function 'fmt::detail::vformat_to(buffer&amp;lt;char&amp;gt; &amp;amp;, basic_string_view&amp;lt;char&amp;gt;, basic_format_args&amp;lt;basic_format_context&amp;lt;detail::buffer_appender&amp;lt;type_identity_t&amp;lt;char&amp;gt;&amp;gt;, type_identity_t&amp;lt;char&amp;gt;&amp;gt;&amp;gt;, fmt::detail::locale_ref)::format_handler::on_format_specs' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;struct format_handler : error_handler {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:53:31: note: in instantiation of function template specialization 'fmt::detail::vformat_to&amp;lt;char&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;template FMT_API void detail::vformat_to(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1783:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1989:20: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, double, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return detail::write(out, value, specs, locale);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:2653:10: note: in instantiation of member function 'fmt::detail::vformat_to(buffer&amp;lt;char&amp;gt; &amp;amp;, basic_string_view&amp;lt;char&amp;gt;, basic_format_args&amp;lt;basic_format_context&amp;lt;detail::buffer_appender&amp;lt;type_identity_t&amp;lt;char&amp;gt;&amp;gt;, type_identity_t&amp;lt;char&amp;gt;&amp;gt;&amp;gt;, fmt::detail::locale_ref)::format_handler::on_format_specs' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;struct format_handler : error_handler {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:53:31: note: in instantiation of function template specialization 'fmt::detail::vformat_to&amp;lt;char&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;template FMT_API void detail::vformat_to(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1783:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1989:20: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, long double, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return detail::write(out, value, specs, locale);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:2653:10: note: in instantiation of member function 'fmt::detail::vformat_to(buffer&amp;lt;char&amp;gt; &amp;amp;, basic_string_view&amp;lt;char&amp;gt;, basic_format_args&amp;lt;basic_format_context&amp;lt;detail::buffer_appender&amp;lt;type_identity_t&amp;lt;char&amp;gt;&amp;gt;, type_identity_t&amp;lt;char&amp;gt;&amp;gt;&amp;gt;, fmt::detail::locale_ref)::format_handler::on_format_specs' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;struct format_handler : error_handler {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:53:31: note: in instantiation of function template specialization 'fmt::detail::vformat_to&amp;lt;char&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;template FMT_API void detail::vformat_to(&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1836:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1969:12: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, float, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write&amp;lt;Char&amp;gt;(out, value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/core.h:1469:12: note: in instantiation of function template specialization 'fmt::detail::default_arg_formatter&amp;lt;char&amp;gt;::operator()&amp;lt;float&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return vis(arg.value_.float_value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/src/format.cc:8:&lt;/P&gt;&lt;P&gt;In file included from /nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format-inl.h:29:&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1836:33: warning: comparison with infinity always evaluates to false in fast floating point modes [-Wtautological-constant-compare]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write_nonfinite(out, std::isinf(value), specs, fspecs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^~~~~~~~~~~~~~~~~&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/format.h:1969:12: note: in instantiation of function template specialization 'fmt::detail::write&amp;lt;char, fmt::appender, double, 0&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return write&amp;lt;Char&amp;gt;(out, value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;/nfs/pdx/home/ayu1/demonstrate_invalid_module/fmt/include/fmt/core.h:1471:12: note: in instantiation of function template specialization 'fmt::detail::default_arg_formatter&amp;lt;char&amp;gt;::operator()&amp;lt;double&amp;gt;' requested here&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;return vis(arg.value_.double_value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;^&lt;/P&gt;&lt;P&gt;5 warnings generated.&lt;/P&gt;&lt;P&gt;[ 40%] Building CXX object fmt/CMakeFiles/fmt.dir/src/os.cc.o&lt;/P&gt;&lt;P&gt;[ 60%] Linking CXX static library libfmt.a&lt;/P&gt;&lt;P&gt;[ 60%] Built target fmt&lt;/P&gt;&lt;P&gt;Scanning dependencies of target try_intelfpga&lt;/P&gt;&lt;P&gt;[ 80%] Building CXX object CMakeFiles/try_intelfpga.dir/try.cc.o&lt;/P&gt;&lt;P&gt;[100%] Linking CXX executable try_intelfpga&lt;/P&gt;&lt;P&gt;InvalidModule: Invalid SPIR-V module: Casts from private/local/global address space are allowed only to generic&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;llvm-foreach:&lt;/P&gt;&lt;P&gt;dpcpp: error: llvm-spirv command failed with exit code 9 (use -v to see invocation)&lt;/P&gt;&lt;P&gt;make[2]: *** [CMakeFiles/try_intelfpga.dir/build.make:85: try_intelfpga] Error 9&lt;/P&gt;&lt;P&gt;make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/try_intelfpga.dir/all] Error 2&lt;/P&gt;&lt;P&gt;make: *** [Makefile:84: all] Error 2&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I understand that your original CMakeLists.txt states to use cmake version 3.20, is it a must? If you use an older version, will the last case with intelfpga option build successfully? &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Sep 2021 07:42:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316404#M1570</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-09-22T07:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316419#M1571</link>
      <description>&lt;P&gt;Hi Ayu1,&lt;/P&gt;
&lt;P&gt;No, it doesn't require CMake 3.20, but I haven't been building or testing on lower versions. However, using 3.16 it still exhibits the same behaviour for me, and those warnings aren't emitted - so you must have some other settings differently. This Dockerfile reproduces the same failure with CMake 3.16, and demonstrates that try_intelfpga also compiles successfully:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FROM intel/oneapi-basekit

RUN apt-get update &amp;amp;&amp;amp; apt-get install -y git wget

RUN cd /opt &amp;amp;&amp;amp; git clone --recursive https://github.com/ndevenish/demonstrate_invalid_module
RUN mkdir /opt/demonstrate_invalid_module/build

# Get CMake 3.16
RUN cd /opt &amp;amp;&amp;amp; \
    wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0-linux-x86_64.tar.gz &amp;amp;&amp;amp; \
    mkdir cmake &amp;amp;&amp;amp; \
    tar -xC cmake --strip-components=1 -f cmake-*
ENV PATH=/opt/cmake/bin:$PATH

# Rewrite the CMakeList to Match Ayu1's (note: &amp;lt;3.13 will not work due to target_link_options)
RUN sed -i s/3.20/3.10/ /opt/demonstrate_invalid_module/CMakeLists.txt

WORKDIR /opt/demonstrate_invalid_module/build
RUN cmake --version &amp;amp;&amp;amp; cmake ..

# Explicitly build try_intelfpga first
RUN make try_intelfpga &amp;amp;&amp;amp;\
    echo &amp;amp;&amp;amp;\
    make&lt;/LI-CODE&gt;
&lt;P&gt;And the output from the last stage:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Scanning dependencies of target try_intelfpga
[ 80%] Building CXX object CMakeFiles/try_intelfpga.dir/try.cc.o
[100%] Linking CXX executable try_intelfpga
[100%] Built target try_intelfpga

[ 33%] Built target fmt
Scanning dependencies of target try
[ 44%] Building CXX object CMakeFiles/try.dir/try.cc.o
[ 55%] Linking CXX executable try
InvalidModule: Invalid SPIR-V module: Casts from private/local/global address space are allowed only to generic&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's puzzling that you get both more warnings and an extra failure - are you sure you are using the same compiler? However, I feel that focussing on CMake is probably chasing a red herring.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 08:48:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316419#M1571</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-09-22T08:48:45Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316421#M1572</link>
      <description>&lt;P&gt;I've done another ​experiment, please let me know what you think--&lt;/P&gt;&lt;P&gt;I've used the CMakeLists.txt in fmt directory of your original source code to build libfmt.a. Now just for convenience, I put try.cc and newly built libfmt.a both under fmt/include, and I did this: &lt;/P&gt;&lt;P&gt;dpcpp try.cc libfmt.a&lt;/P&gt;&lt;P&gt;which created a.out, and then I ran a.out which gave me the proper result: Output. &lt;/P&gt;&lt;P&gt;By the way, I also modified the try.cc a little bit: I changed &amp;lt;fmt/core.h&amp;gt; to "fmt/core.h"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So, it seems dpcpp compiler has no problem linking the library. &lt;/P&gt;&lt;P&gt;Another thing you can help me clarify is that, since the project itself is small, can you arrange the files to be compiled and linked with dpcpp commands instead of using CMake? &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Sep 2021 09:12:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316421#M1572</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-09-22T09:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316463#M1574</link>
      <description>&lt;P&gt;Hi Ayu1,&lt;/P&gt;
&lt;P&gt;Did you use dpcpp to build libfmt.a, or used a separate compiler? Yes, it works if you don't use dpcpp, but that's besides the point - as far as I am aware, dpcpp is supposed to act like a normal C++ compiler (and cross-linking between compilers potentially raises ABI issues, in any case). Here's a Dockerfile that replicates the issue, but with a separate compilation of libfmt.a. When compiling separately, you have to explicitly request only libfmt be built, because the linking fails with the same SPIR-V error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;FROM intel/oneapi-basekit

RUN apt-get update &amp;amp;&amp;amp; apt-get install -y git wget

RUN cd /opt &amp;amp;&amp;amp; git clone --recursive https://github.com/ndevenish/demonstrate_invalid_module
RUN mkdir /opt/demonstrate_invalid_module/build

WORKDIR /opt/demonstrate_invalid_module/build
RUN cmake --version &amp;amp;&amp;amp; cmake ..

# Build libfmt separately
RUN mkdir /opt/build_fmt &amp;amp;&amp;amp;\
    cd /opt/build_fmt &amp;amp;&amp;amp;\
    CXX=dpcpp cmake /opt/demonstrate_invalid_module/fmt &amp;amp;&amp;amp;\
    make fmt VERBOSE=1

RUN dpcpp ../try.cc -I../fmt/include /opt/build_fmt/libfmt.a&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure what you are trying to achieve here?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Sep 2021 12:42:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316463#M1574</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-09-22T12:42:21Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316676#M1578</link>
      <description>&lt;P&gt;We've identified the bug. We'll work on this issue internally and get back to you with update. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Sep 2021 09:13:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1316676#M1578</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-09-23T09:13:07Z</dc:date>
    </item>
    <item>
      <title>Re:dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1319590#M1613</link>
      <description>&lt;P&gt;The problem has been resolved and will be rolled out in future release. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 06 Oct 2021 07:24:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1319590#M1613</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2021-10-06T07:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1328732#M1693</link>
      <description>&lt;P&gt;Hi ayu1,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Was this supposed to be addressed in 2021.4, or was that too early for this to be fixed? Do you have any information on a public link to a ticket or repo fix for this? Or a suggested workaround? I've tried switching to the 2021.4 docker image and am finding that it's now happening more often, even sometimes with the header-only variants or -fintelfpga (it seems somewhat intermittent and I haven't managed to duplicate it on a reduced example yet).&lt;/P&gt;</description>
      <pubDate>Wed, 10 Nov 2021 12:01:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1328732#M1693</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2021-11-10T12:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: dpcpp gives "InvalidModule: Invalid SPIR-V..." on linking</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1404175#M2399</link>
      <description>&lt;P&gt;This appears to be solved sometime between 2021.4 and 2022.1. On 2022.1 this now compiles.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 11:49:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/dpcpp-gives-quot-InvalidModule-Invalid-SPIR-V-quot-on-linking/m-p/1404175#M2399</guid>
      <dc:creator>ndevenish</dc:creator>
      <dc:date>2022-07-28T11:49:58Z</dc:date>
    </item>
  </channel>
</rss>

