<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>[+Doru]</p>
    <p>Can you please file a bug report (at <a class="moz-txt-link-freetext" href="https://bugs.llvm.org/">https://bugs.llvm.org/</a>)?</p>
    <p>Thanks again,</p>
    <p>Hal<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 08/02/2017 05:18 AM, Siegmar Gross
      via llvm-dev wrote:<br>
    </div>
    <blockquote
      cite="mid:e57884a6-5963-beb5-3229-6e6419191286@informatik.hs-fulda.de"
      type="cite">Hi,
      <br>
      <br>
      I have installed llvm-trunk to use OpenMP target pragmas.
      Unfortunately, I get
      <br>
      a segmentation fault compiling a small program.
      <br>
      <br>
      <br>
      loki introduction 722 clang -v                    clang version
      5.0.0 (trunk 308176) (llvm/trunk 308177)
      <br>
      Target: x86_64-unknown-linux-gnu
      <br>
      Thread model: posix
      <br>
      InstalledDir: /usr/local/llvm-trunk/bin
      <br>
      Found candidate GCC installation:
      /usr/lib64/gcc/x86_64-suse-linux/4.8
      <br>
      Selected GCC installation: /usr/lib64/gcc/x86_64-suse-linux/4.8
      <br>
      Candidate multilib: .;@m64
      <br>
      Candidate multilib: 32;@m32
      <br>
      Selected multilib: .;@m64
      <br>
      Found CUDA installation: /usr/local/cuda, version 8.0
      <br>
      <br>
      <br>
      loki introduction 723 clang -fopenmp
      -fopenmp-targets=nvptx64-nvidia-cuda dot_prod_accelerator_OpenMP.c
      -lomptarget
      <br>
      clang-5.0: error: cannot find libdevice for . Provide path to
      different CUDA installation via --cuda-path, or pass -nocudalib to
      build without linking with libdevice.
      <br>
      #0 0x00007f6e7b1a11ea
      llvm::sys::PrintStackTrace(llvm::raw_ostream&)
      (/usr/local/llvm-trunk/lib64/libLLVMSupport.so.5+0xfc1ea)
      <br>
      #1 0x00007f6e7b19f32e llvm::sys::RunSignalHandlers()
      (/usr/local/llvm-trunk/lib64/libLLVMSupport.so.5+0xfa32e)
      <br>
      #2 0x00007f6e7b19f468 SignalHandler(int)
      (/usr/local/llvm-trunk/lib64/libLLVMSupport.so.5+0xfa468)
      <br>
      #3 0x00007f6e7e2d1b10 __restore_rt
      (/lib64/libpthread.so.0+0x10b10)
      <br>
      #4 0x00007f6e7d5b8dd0
clang::driver::tools::NVPTX::Linker::ConstructJob(clang::driver::Compilation&,
      clang::driver::JobAction const&, clang::driver::InputInfo
      const&, llvm::SmallVector<clang::driver::InputInfo, 4u>
      const&, llvm::opt::ArgList const&, char const*) const
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0xc5dd0)
      <br>
      #5 0x00007f6e7d5591ac
clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&,
      clang::driver::Action const*, clang::driver::ToolChain const*,
      llvm::StringRef, bool, bool, char const*,
      std::map<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > >, clang::driver::InputInfo,
      std::less<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > > >,
      std::allocator<std::pair<std::pair<clang::driver::Action
      const*, std::__cxx11::basic_string<char,
      std::char_traits<char>, std::allocator<char> > >
      const, clang::driver::InputInfo> > >&,
      clang::driver::Action::OffloadKind) const
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x661ac)
      <br>
      #6 0x00007f6e7d55ab69
clang::driver::Driver::BuildJobsForAction(clang::driver::Compilation&,
      clang::driver::Action const*, clang::driver::ToolChain const*,
      llvm::StringRef, bool, bool, char const*,
      std::map<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > >, clang::driver::InputInfo,
      std::less<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > > >,
      std::allocator<std::pair<std::pair<clang::driver::Action
      const*, std::__cxx11::basic_string<char,
      std::char_traits<char>, std::allocator<char> > >
      const, clang::driver::InputInfo> > >&,
      clang::driver::Action::OffloadKind) const
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x67b69)
      <br>
      #7 0x00007f6e7d55c9b2 void llvm::function_ref<void
      (clang::driver::Action*, clang::driver::ToolChain const*, char
const*)>::callback_fn<clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&,
      clang::driver::Action const*, clang::driver::ToolChain const*,
      llvm::StringRef, bool, bool, char const*,
      std::map<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > >, clang::driver::InputInfo,
      std::less<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > > >,
      std::allocator<std::pair<std::pair<clang::driver::Action
      const*, std::__cxx11::basic_string<char,
      std::char_traits<char>, std::allocator<char> > >
      const, clang::driver::InputInfo> > >&,
      clang::driver::Action::OffloadKind)
      const::{lambda(clang::driver::Action*, clang::driver::ToolChain
      const*, char const*)#2}>(long, clang::driver::Action*,
      clang::driver::ToolChain const*, char const*)
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x699b2)
      <br>
      #8 0x00007f6e7d53e97c
clang::driver::OffloadAction::doOnEachDeviceDependence(llvm::function_ref<void
      (clang::driver::Action*, clang::driver::ToolChain const*, char
      const*)> const&) const
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x4b97c)
      <br>
      #9 0x00007f6e7d5584e9
clang::driver::Driver::BuildJobsForActionNoCache(clang::driver::Compilation&,
      clang::driver::Action const*, clang::driver::ToolChain const*,
      llvm::StringRef, bool, bool, char const*,
      std::map<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > >, clang::driver::InputInfo,
      std::less<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > > >,
      std::allocator<std::pair<std::pair<clang::driver::Action
      const*, std::__cxx11::basic_string<char,
      std::char_traits<char>, std::allocator<char> > >
      const, clang::driver::InputInfo> > >&,
      clang::driver::Action::OffloadKind) const
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x654e9)
      <br>
      #10 0x00007f6e7d55ab69
clang::driver::Driver::BuildJobsForAction(clang::driver::Compilation&,
      clang::driver::Action const*, clang::driver::ToolChain const*,
      llvm::StringRef, bool, bool, char const*,
      std::map<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > >, clang::driver::InputInfo,
      std::less<std::pair<clang::driver::Action const*,
      std::__cxx11::basic_string<char, std::char_traits<char>,
      std::allocator<char> > > >,
      std::allocator<std::pair<std::pair<clang::driver::Action
      const*, std::__cxx11::basic_string<char,
      std::char_traits<char>, std::allocator<char> > >
      const, clang::driver::InputInfo> > >&,
      clang::driver::Action::OffloadKind) const
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x67b69)
      <br>
      #11 0x00007f6e7d55b7fb
      clang::driver::Driver::BuildJobs(clang::driver::Compilation&)
      const (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x687fb)
      <br>
      #12 0x00007f6e7d55c7a9
      clang::driver::Driver::BuildCompilation(llvm::ArrayRef<char
      const*>)
      (/usr/local/llvm-trunk/lib64/libclangDriver.so.5+0x697a9)
      <br>
      #13 0x000000000040e733 (clang+0x40e733)
      <br>
      #14 0x00007f6e78e456e5 __libc_start_main
      /usr/src/debug/glibc-2.22/csu/libc-start.c:323:0
      <br>
      #15 0x0000000000410759 (clang+0x410759)
      <br>
      Stack dump:
      <br>
      0.    Program arguments: clang -m64 -O2 -g -Weverything
      -Wno-unused-command-line-argument -DLinux -Dx86_64
      -I/usr/local/valgrind-3.12.0/include
      -I/usr/local/intel/opencl-1.2-sdk-6.3.0.1904/include
      -I/usr/local/include -I/usr/include -I/usr/local/cuda-8.0/include
      -I/usr/local/hwloc-1.11.5/include
      -I/home/fd1026/Linux/x86_64/include
      -L/home/fd1026/Linux/x86_64/lib64 -L/usr/local/valgrind-3.12.0/lib
      -L/usr/local/jdk1.8.0_66/jre/lib/amd64
      -L/usr/local/intel/opencl-1.2-sdk-6.3.0.1904/lib64
      -L/usr/local/llvm-trunk/lib64
      -L/usr/local/pgi/linux86-64/16.10/lib
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/compiler/lib/intel64
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/compiler/lib/intel64_lin
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/mpi/intel64/lib
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/mpi/mic/lib
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/ipp/lib/intel64
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/compiler/lib/intel64_lin
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/mkl/lib/intel64_lin
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/tbb/lib/intel64/gcc4.7
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/tbb/lib/intel64/gcc4.7
      -L/usr/local/intel_xe_2018_beta/debugger_2018//libipt/intel64/lib
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/daal/lib/intel64_lin
-L/usr/local/intel_xe_2018_beta/compilers_and_libraries_2018.0.082/linux/daal/../tbb/lib/intel64_lin/gcc4.4
      -L/usr/local/gcc-7.1.0/lib64
      -L/usr/local/gcc-7.1.0/libexec/gcc/x86_64-pc-linux-gnu/7.1.0
      -L/usr/local/gcc-7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0
      -L/usr/local/lib64 -L/usr/X11R6/lib64 -L/lib64 -L/usr/lib64
      -L/usr/lib64/tls -L/usr/local/lib -L/usr/X11R6/lib -L/lib
      -L/usr/lib -L/usr/lib/tls -L/usr/local/gcc-7.1.0/lib
      -L/usr/local/gcc-7.1.0/libexec/gcc/x86_64-pc-linux-gnu/7.1.0/32
      -L/usr/local/gcc-7.1.0/lib/gcc/x86_64-pc-linux-gnu/7.1.0/32
      -L/usr/local/cuda-8.0/lib64 -L/usr/local/hwloc-1.11.5/lib
      -L/usr/local/swipl-7.2.3/lib/x86_64-linux
      -L/home/fd1026/Linux/x86_64/lib -fopenmp
      -fopenmp-targets=nvptx64-nvidia-cuda dot_prod_accelerator_OpenMP.c
      -lomptarget
      <br>
      1.    Compilation construction
      <br>
      2.    Building compilation jobs
      <br>
      3.    Building compilation jobs
      <br>
      4.    Building compilation jobs
      <br>
      Segmentation fault (core dumped)
      <br>
      loki introduction 724
      <br>
      <br>
      <br>
      <br>
      My program works with gcc-7.1.0.
      <br>
      <br>
      loki introduction 727 gcc -fopenmp dot_prod_accelerator_OpenMP.c
      <br>
      loki introduction 728 setenv OMP_DEFAULT_DEVICE 0
      <br>
      loki introduction 729 /usr/bin/time -p a.out
      <br>
      Number of processors:     24
      <br>
      Number of devices:        1
      <br>
      Default device:           0
      <br>
      sum = 6.000000e+08
      <br>
      real 4.80
      <br>
      user 0.00
      <br>
      sys 0.00
      <br>
      loki introduction 730 setenv OMP_DEFAULT_DEVICE 1
      <br>
      loki introduction 731 /usr/bin/time -p a.out
      <br>
      Number of processors:     24
      <br>
      Number of devices:        1
      <br>
      Default device:           1
      <br>
      sum = 6.000000e+08
      <br>
      real 0.43
      <br>
      user 0.00
      <br>
      sys 0.00
      <br>
      loki introduction 732
      <br>
      <br>
      <br>
      I would be grateful if somebody can fix the problem. Please let me
      know
      <br>
      if you need anything else. Thank you very much for any help in
      advance.
      <br>
      <br>
      <br>
      Kind regards
      <br>
      <br>
      Siegmar
      <br>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
  </body>
</html>