<?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: clang++: error: linker command failed with exit code 1 in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598667#M3763</link>
    <description>&lt;P&gt;Maybe give this a try?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;python3 ../buildbot/configure.py&amp;nbsp; --llvm-external-projects=openmp&lt;/P&gt;
&lt;P&gt;python3 ../buildbot/compile.py&lt;/P&gt;
&lt;P&gt;python3 ../buildbot/compile.py -t omp&lt;/P&gt;</description>
    <pubDate>Fri, 17 May 2024 19:30:59 GMT</pubDate>
    <dc:creator>Alex_Y_Intel</dc:creator>
    <dc:date>2024-05-17T19:30:59Z</dc:date>
    <item>
      <title>clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1597865#M3739</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I compile a program using clang++, an error appeared like below:&lt;/P&gt;&lt;P&gt;/opt/software/intel/llvm/build/bin/clang++ -O3 -L/opt/software/intel/llvm/build/lib -fopenmp -lstdc++ -fsycl-early-optimizations -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_80 -I/opt/intel/oneapi/compiler/2024.1/include CMakeFiles/cmTC_4c21c.dir/testCXXCompiler.cxx.o -o cmTC_4c21c&lt;BR /&gt;/usr/bin/ld: cannot find -lomp&lt;BR /&gt;clang++: error: linker command failed with exit code 1 (use -v to see invocation)&lt;BR /&gt;gmake[1]: *** [CMakeFiles/cmTC_4c21c.dir/build.make:100: cmTC_4c21c] Error 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed that there is no libruaries like "libiomp*" or "libomp*" under&amp;nbsp;/opt/software/intel/llvm/build/lib. what should I do if I need to link openmp when using clang++?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, I installed LLVM following&amp;nbsp;&lt;A href="https://intel.github.io/llvm-docs/GetStartedGuide.html" target="_blank"&gt;Getting Started with oneAPI DPC++ — oneAPI DPC++ Compiler documentation (intel.github.io)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 08:31:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1597865#M3739</guid>
      <dc:creator>Jervie</dc:creator>
      <dc:date>2024-05-15T08:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1597968#M3742</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the dpc++ compiler shipped in Intel oneapi base toolkit, there're openmp libraries:&lt;/P&gt;&lt;P&gt;For example for compiler 2024.1, you can find the following files,&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;intel/oneapi/compiler/2024.1/lib/libiomp5.a
intel/oneapi/compiler/2024.1/lib32/libiomp5.a&lt;/LI-CODE&gt;&lt;P&gt;You're using the open source version, maybe there're special options to build the openmp libraries ?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 17:41:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1597968#M3742</guid>
      <dc:creator>yzh_intel</dc:creator>
      <dc:date>2024-05-15T17:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598093#M3749</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I linked the libraries following your suggestions, and then I got errors sa below:&lt;/P&gt;&lt;P&gt;-- The CXX compiler identification is Clang 18.0.0&lt;BR /&gt;-- Detecting CXX compiler ABI info&lt;BR /&gt;-- Detecting CXX compiler ABI info - failed&lt;BR /&gt;-- Check for working CXX compiler: /opt/software/intel/llvm/build/bin/clang++&lt;BR /&gt;-- Check for working CXX compiler: /opt/software/intel/llvm/build/bin/clang++ - broken&lt;BR /&gt;CMake Error at /opt/cloudsc/cmake-3.29.0-linux-x86_64/share/cmake-3.29/Modules/CMakeTestCXXCompiler.cmake:60 (message):&lt;BR /&gt;The C++ compiler&lt;/P&gt;&lt;P&gt;"/opt/software/intel/llvm/build/bin/clang++"&lt;/P&gt;&lt;P&gt;is not able to compile a simple test program.&lt;/P&gt;&lt;P&gt;It fails with the following output:&lt;/P&gt;&lt;P&gt;Change Dir: '/opt/cloudsc_sycl_clang/test2/build-sycl/CMakeFiles/CMakeScratch/TryCompile-eVfOoL'&lt;/P&gt;&lt;P&gt;Run Build Command(s): /opt/cloudsc/cmake-3.29.0-linux-x86_64/bin/cmake -E env VERBOSE=1 /usr/bin/gmake -f Makefile cmTC_ef72f/fast&lt;BR /&gt;/usr/bin/gmake -f CMakeFiles/cmTC_ef72f.dir/build.make CMakeFiles/cmTC_ef72f.dir/build&lt;BR /&gt;gmake[1]: Entering directory '/opt/cloudsc_sycl_clang/test2/build-sycl/CMakeFiles/CMakeScratch/TryCompile-eVfOoL'&lt;BR /&gt;Building CXX object CMakeFiles/cmTC_ef72f.dir/testCXXCompiler.cxx.o&lt;BR /&gt;&lt;STRONG&gt;/opt/software/intel/llvm/build/bin/clang++ -O3 -L/opt/software/gcc122/lib64 -lstdc++ -L/opt/intel/oneapi/compiler/2024.1/lib -fopenmp -fsycl-early-optimizations -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_80 -I/opt/intel/oneapi/compiler/2024.1/include -I/opt/software/gcc122/include/c++/12.2.0&lt;/STRONG&gt; -MD -MT CMakeFiles/cmTC_ef72f.dir/testCXXCompiler.cxx.o -MF CMakeFiles/cmTC_ef72f.dir/testCXXCompiler.cxx.o.d -o CMakeFiles/cmTC_ef72f.dir/testCXXCompiler.cxx.o -c /opt/cloudsc_sycl_clang/test2/build-sycl/CMakeFiles/CMakeScratch/TryCompile-eVfOoL/testCXXCompiler.cxx&lt;BR /&gt;clang++: warning: -Z-reserved-lib-stdc++: 'linker' input unused [-Wunused-command-line-argument]&lt;BR /&gt;Linking CXX executable cmTC_ef72f&lt;BR /&gt;/opt/cloudsc/cmake-3.29.0-linux-x86_64/bin/cmake -E cmake_link_script CMakeFiles/cmTC_ef72f.dir/link.txt --verbose=1&lt;BR /&gt;/opt/software/intel/llvm/build/bin/clang++ -O3 -L/opt/software/gcc122/lib64 -lstdc++ -L/opt/intel/oneapi/compiler/2024.1/lib -fopenmp -fsycl-early-optimizations -fsycl -fsycl-targets=nvptx64-nvidia-cuda -Xsycl-target-backend --cuda-gpu-arch=sm_80 -I/opt/intel/oneapi/compiler/2024.1/include -I/opt/software/gcc122/include/c++/12.2.0 CMakeFiles/cmTC_ef72f.dir/testCXXCompiler.cxx.o -o cmTC_ef72f&lt;BR /&gt;/usr/bin/ld: cannot find -lomp&lt;BR /&gt;clang++: error: linker command failed with exit code 1 (use -v to see invocation)&lt;BR /&gt;gmake[1]: *** [CMakeFiles/cmTC_ef72f.dir/build.make:100: cmTC_ef72f] Error 1&lt;BR /&gt;gmake[1]: Leaving directory '/opt/cloudsc_sycl_clang/test2/build-sycl/CMakeFiles/CMakeScratch/TryCompile-eVfOoL'&lt;BR /&gt;gmake: *** [Makefile:127: cmTC_ef72f/fast] Error 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a few questions:&lt;/P&gt;&lt;P&gt;(1) I have no idea why clang++ broken. Before I compiled the program above, I compiled an exapmle program, which is oneAPI-samples-master/DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp, and it went well. And I compiled and ran it using the following commands:&lt;/P&gt;&lt;P&gt;$clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda vector-add-buffers.cpp -o vector-add-buffers -L /opt/software/gcc122/lib64 -lstdc++&lt;/P&gt;&lt;P&gt;$ONEAPI_DEVICE_SELECTOR=cuda:7 ./vector-add-buffers&lt;/P&gt;&lt;P&gt;(2) About the&amp;nbsp;'linker' input unused and /usr/bin/ld: cannot find -lomp. I think I have linked the right libraries?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 02:17:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598093#M3749</guid>
      <dc:creator>Jervie</dc:creator>
      <dc:date>2024-05-16T02:17:44Z</dc:date>
    </item>
    <item>
      <title>Re: clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598298#M3757</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the 1st question, is the error due to the added library path ?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the 2nd question, can you try the option "-liomp5" ? With&lt;SPAN&gt;&amp;nbsp;option "-lomp", the linker is looking for libomp.a.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2024 15:42:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598298#M3757</guid>
      <dc:creator>yzh_intel</dc:creator>
      <dc:date>2024-05-16T15:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598667#M3763</link>
      <description>&lt;P&gt;Maybe give this a try?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;python3 ../buildbot/configure.py&amp;nbsp; --llvm-external-projects=openmp&lt;/P&gt;
&lt;P&gt;python3 ../buildbot/compile.py&lt;/P&gt;
&lt;P&gt;python3 ../buildbot/compile.py -t omp&lt;/P&gt;</description>
      <pubDate>Fri, 17 May 2024 19:30:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1598667#M3763</guid>
      <dc:creator>Alex_Y_Intel</dc:creator>
      <dc:date>2024-05-17T19:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1599013#M3766</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;By changing the option from "-fopenmp" to&amp;nbsp;&lt;SPAN&gt;"-liomp5", the errors disappeared.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 09:34:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1599013#M3766</guid>
      <dc:creator>Jervie</dc:creator>
      <dc:date>2024-05-20T09:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: clang++: error: linker command failed with exit code 1</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1599015#M3767</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your suggestions. As changing the option solved my problem, I'll write your suggestions down and try it later.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2024 09:39:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/clang-error-linker-command-failed-with-exit-code-1/m-p/1599015#M3767</guid>
      <dc:creator>Jervie</dc:creator>
      <dc:date>2024-05-20T09:39:27Z</dc:date>
    </item>
  </channel>
</rss>

