<div dir="ltr">Ah, I see. I tried x86_64-pc-linux-gnu as well under 6.0 and ended up with an undefined reference to bodyBodyInteraction, but it sounds like that could be attributed to the lack of "declare target" codegen. I guess I'll wait a few releases and try this exercise again!</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 13, 2018 at 8:45 AM, Alexey Bataev <span dir="ltr"><<a href="mailto:a.bataev@outlook.com" target="_blank">a.bataev@outlook.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Hi Steven,</p>
    <p>clang does not fully support offloading yet because it is not
      ready. You cannot use it for NVPTX target, because it requires an
      additional codegen that is not implemented yet + requires custom
      runtime library, which is not ready yet (that's why you see those
      `Undefined refernce` messages from linker). You can try to use
      only for some generic targets, like X86, PowerPC, ARM etc. But
      still, codegen for `#pragma omp declare target` is not ready yet,
      you can use lambdas instead.</p>
    <p>The problem with the archives is known and we'll try to fix it,
      but I can't tell when it will happen.<br>
    </p>
    <pre class="m_-7948280028237373099moz-signature" cols="72">-------------
Best regards,
Alexey Bataev</pre>
    <div class="m_-7948280028237373099moz-cite-prefix">13.03.2018 11:33, Steven Noonan via
      Openmp-dev пишет:<br>
    </div>
    <blockquote type="cite"><div><div class="h5">
      
      <div dir="ltr">
        <div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi
            all,</span></div>
        <div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br>
          </span></div>
        <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">What's
          the best Linux distribution (or other build environment) to
          test the Clang/OpenMP offloading support? I've run into enough
          issues trying to get it working that I could probably file a
          half dozen bug reports, but I want to make sure I'm not doing
          something incredibly stupid before I go down that path...</span>
        <div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br>
        </div>
        <div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">I've
          tried both -fopenmp-targets=nvptx64-nvidi<wbr>a-cuda and
          -fopenmp-targets=x86_64-pc-lin<wbr>ux-gnu, and end up hitting
          similar problems with both.<br>
          <br>
          I've been using my own LLVM builds and can't seem to make it
          cooperate. First off, -fopenmp-targets=<sometarget>
          doesn't like seeing ar archives on the link line for some
          reason: clang-offload-bundler generates 0-byte .o files for
          the offload target types when pointed at ".a" files. So I have
          to point it to the object files that would have been contained
          inside the static libs. Doing that will at least make it
          compile and link, but that's still not using the target
          offload support. I haven't yet used offloading anywhere, but
          from what I understand, I need to wrap a bunch of places with
          "#pragma omp declare target" and add "#pragma omp target" to
          some "#pragma omp parallel" blocks, right?<br>
          <br>
          Adding "#pragma omp target" causes other problems. With LLVM
          6.0 (plus some<span> cherry-picked </span>commits[1] <wbr>for
          CUDA-9.1 support and other stuff) it has symbol-resolution
          issues at link time (I'm not sure where these symbols are
          supposed to come from, either):<br>
          <br>
          nvlink warning : Function '__omp_outlined___wrapper' has
          address taken but no possible call to it<br>
          nvlink error   : Undefined reference to '__kmpc_kernel_init'
          in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to
          '__kmpc_dispatch_init_8u' in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to
          '__kmpc_dispatch_next_8u' in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to 'bodyBodyInteraction'
          in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to
          '__kmpc_global_thread_num' in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to
          '__kmpc_kernel_prepare_paralle<wbr>l' in
          '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to '__kmpc_kernel_deinit'
          in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to
          '__kmpc_kernel_parallel' in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink error   : Undefined reference to
          '__kmpc_kernel_end_parallel' in '/tmp/nbody_CPU_SOA-d2d669.cub<wbr>in'<br>
          nvlink info    : 192 bytes gmem<br>
          nvlink info    : Function properties for
          '__omp_offloading_fe00_d0111c_<wbr>_ComputeGravitation_SOA_l63':<br>
          nvlink info    : used 94 registers, 112 stack, 0 bytes smem,
          360 bytes cmem[0], 0 bytes lmem
          <div><br>
          </div>
          <div>The "bodyBodyInteraction" one is probably my fault
            somehow, though I don't understand how. It's a static
            function defined in a header, but wrapping it with "#pragma
            omp declare target" doesn't seem to fix the undefined
            reference. So I don't know what's happening there.</div>
          <div><br>
          </div>
          <div>Given the above link problems I attempted using trunk as
            well, and ended up with a segmentation fault in clang when
            compiling the .c file with the "#pragma omp target"
            directive in it:</div>
          <div><br>
          </div>
          <div>
            <div> "/home/steven/.apps/llvm-trun<wbr>k/bin/clang-6.0"
              -cc1 -triple nvptx64-nvidia-cuda -aux-triple
              x86_64-unknown-linux-gnu -S -disable-free
              -disable-llvm-verifier -discard-value-names
              -main-file-name nbody_CPU_SOA.c -mrelocation-model pic
              -pic-level 2 -mthread-model posix -mdisable-fp-elim
              -relaxed-aliasing -menable-no-infs -menable-no-nans
              -menable-unsafe-fp-math -fno-signed-zeros -mreassociate
              -freciprocal-math -fno-trapping-math -ffp-contract=fast
              -ffast-math -ffinite-math-only -no-integrated-as
              -fuse-init-array -mlink-cuda-bitcode
              /opt/cuda/nvvm/libdevice/libde<wbr>vice.10.bc
              -target-feature +ptx60 -target-cpu sm_35
              -dwarf-column-info -debugger-tuning=gdb -v -resource-dir
              /home/steven/.apps/llvm-trunk/<wbr>lib/clang/7.0.0
              -dependency-file nbody_CPU_SOA.d -MT nbody_CPU_SOA.o
              -idirafter /usr/lib/gcc/x86_64-pc-linux-g<wbr>nu/7.3.1/include
              -D _GNU_SOURCE -D LIBTIME_STATIC -D USE_OPENMP -D
              HAVE_SIMD -D USE_LIBC11 -I ../subprojects/c11/include -I
              ../subprojects/time/include -I/opt/intel/composerxe/linux/<wbr>ipp/include
              -I/opt/intel/composerxe/linux/<wbr>mkl/include
              -internal-isystem /usr/local/include -internal-isystem
              /home/steven/.apps/llvm-trunk/<wbr>lib/clang/7.0.0/include
              -internal-externc-isystem /include
              -internal-externc-isystem /usr/include -internal-isystem
              /usr/local/include -internal-isystem
              /home/steven/.apps/llvm-trunk/<wbr>lib/clang/7.0.0/include
              -internal-externc-isystem /include
              -internal-externc-isystem /usr/include -O3 -Wall
              -Wdeclaration-after-statement -Wmissing-declarations
              -Wmissing-prototypes -Wno-declaration-after-stateme<wbr>nt
              -Wno-long-long -Wno-unknown-pragmas -Wold-style-definition
              -Wstrict-prototypes -std=gnu99 -fno-dwarf-directory-asm
              -fdebug-compilation-dir /home/steven/Development/nbody<wbr>/src
              -ferror-limit 19 -fmessage-length 190 -fopenmp -pthread
              -fobjc-runtime=gcc -fdiagnostics-show-option
              -fcolor-diagnostics -vectorize-loops -vectorize-slp -o
              /tmp/nbody_CPU_SOA-bcc597.s -x c nbody_CPU_SOA.c
              -fopenmp-is-device -fopenmp-host-ir-file-path
              /tmp/nbody_CPU_SOA-eb1725.bc</div>
            <div>clang -cc1 version 7.0.0 based upon LLVM 7.0.0svn
              default target x86_64-unknown-linux-gnu</div>
            <div>ignoring nonexistent directory "/include"</div>
            <div>ignoring nonexistent directory "/include"</div>
            <div>ignoring duplicate directory "/usr/local/include"</div>
            <div>ignoring duplicate directory "/home/steven/.apps/llvm-trunk<wbr>/lib/clang/7.0.0/include"</div>
            <div>ignoring duplicate directory "/usr/include"</div>
            <div>#include "..." search starts here:</div>
            <div>#include <...> search starts here:</div>
            <div> ../subprojects/c11/include</div>
            <div> ../subprojects/time/include</div>
            <div> /opt/intel/composerxe/linux/i<wbr>pp/include</div>
            <div> /opt/intel/composerxe/linux/m<wbr>kl/include</div>
            <div> /usr/local/include</div>
            <div> /home/steven/.apps/llvm-trunk<wbr>/lib/clang/7.0.0/include</div>
            <div> /usr/include</div>
            <div> /usr/lib/gcc/x86_64-pc-linux-<wbr>gnu/7.3.1/include</div>
            <div>End of search list.</div>
            <div>#0 0x00007f5659cae3ba llvm::sys::PrintStackTrace(llv<wbr>m::raw_ostream&)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x72f3ba)</div>
            <div>#1 0x00007f5659cabe36 llvm::sys::RunSignalHandlers()
              (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x72ce36)</div>
            <div>#2 0x00007f5659cac428 SignalHandler(int)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x72d428)</div>
            <div>#3 0x00007f565c39db90 __restore_rt
              (/usr/lib/libpthread.so.0+0x11<wbr>b90)</div>
            <div>#4 0x00007f565a9d9c3c (anonymous
              namespace)::CVPLatticeFunc::Co<wbr>mputeLatticeVal(llvm::PointerI<wbr>ntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >) (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x145ac3c)</div>
            <div>#5 0x00007f565a9dbb2e llvm::SparseSolver<llvm::Point<wbr>erIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal,
              llvm::LatticeKeyInfo<llvm::Poi<wbr>nterIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              > > >::getValueState(llvm::Pointer<wbr>IntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >) (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x145cb2e)</div>
            <div>#6 0x00007f565a9dcbfd (anonymous
              namespace)::CVPLatticeFunc::vi<wbr>sitCallSite(llvm::CallSite,
              llvm::DenseMap<llvm::PointerIn<wbr>tPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal,
              llvm::DenseMapInfo<llvm::Point<wbr>erIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              > >, llvm::detail::DenseMapPair<llv<wbr>m::PointerIntPair<llvm::Value*<wbr>,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal> >&,
              llvm::SparseSolver<llvm::Point<wbr>erIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal,
              llvm::LatticeKeyInfo<llvm::Poi<wbr>nterIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              > > >&) (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x145dbfd)</div>
            <div>#7 0x00007f565a9e138f (anonymous
              namespace)::CVPLatticeFunc::Co<wbr>mputeInstructionState(llvm::In<wbr>struction&,
              llvm::DenseMap<llvm::PointerIn<wbr>tPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal,
              llvm::DenseMapInfo<llvm::Point<wbr>erIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              > >, llvm::detail::DenseMapPair<llv<wbr>m::PointerIntPair<llvm::Value*<wbr>,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal> >&,
              llvm::SparseSolver<llvm::Point<wbr>erIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal,
              llvm::LatticeKeyInfo<llvm::Poi<wbr>nterIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              > > >&) (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x146238f)</div>
            <div>#8 0x00007f565a9e3584 llvm::SparseSolver<llvm::Point<wbr>erIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              >, (anonymous namespace)::CVPLatticeVal,
              llvm::LatticeKeyInfo<llvm::Poi<wbr>nterIntPair<llvm::Value*,
              2u, (anonymous namespace)::IPOGrouping,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*>,
              llvm::PointerIntPairInfo<llvm:<wbr>:Value*, 2u,
              llvm::PointerLikeTypeTraits<ll<wbr>vm::Value*> >
              > > >::visitInst(llvm::Instruction<wbr>&)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x1464584)</div>
            <div>#9 0x00007f565a9e46a3 runCVP(llvm::Module&)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x14656a3)</div>
            <div>#10 0x00007f5659d9b705 llvm::legacy::PassManagerImpl:<wbr>:run(llvm::Module&)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/../lib/<a href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flibllvm-7.0svn.so%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=lTCWPQHDOrCNBxO9CzUYjZy60m7XBEc%2BP3teiGy0h7U%3D&reserved=0" style="color:rgb(17,85,204)" target="_blank">libLLVM-7.0svn.so</a>+<wbr>0x81c705)</div>
            <div>#11 0x00000000007180f4 (anonymous namespace)::EmitAssemblyHelper<wbr>::EmitAssembly(clang::BackendA<wbr>ction,
              std::unique_ptr<llvm::raw_pwri<wbr>te_stream,
              std::default_delete<llvm::raw_<wbr>pwrite_stream>
              >) (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0x7180f4)</div>
            <div>#12 0x000000000071a718 clang::EmitBackendOutput(clang<wbr>::DiagnosticsEngine&,
              clang::HeaderSearchOptions const&,
              clang::CodeGenOptions const&, clang::TargetOptions
              const&, clang::LangOptions const&,
              llvm::DataLayout const&, llvm::Module*,
              clang::BackendAction, std::unique_ptr<llvm::raw_pwri<wbr>te_stream,
              std::default_delete<llvm::raw_<wbr>pwrite_stream>
              >) (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0x71a718)</div>
            <div>#13 0x0000000000d4961c clang::BackendConsumer::Handle<wbr>TranslationUnit(clang::ASTCont<wbr>ext&)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0xd4961c)</div>
            <div>#14 0x0000000001417b89
              clang::ParseAST(clang::Sema&, bool, bool)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0x1417b89)</div>
            <div>#15 0x0000000000d48377 clang::CodeGenAction::ExecuteA<wbr>ction()
              (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0xd48377)</div>
            <div>#16 0x0000000000b5f9e6 clang::FrontendAction::Execute<wbr>()
              (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0xb5f9e6)</div>
            <div>#17 0x0000000000b1fc1a clang::CompilerInstance::Execu<wbr>teAction(clang::FrontendAction<wbr>&)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0xb1fc1a)</div>
            <div>#18 0x0000000000c17871 clang::ExecuteCompilerInvocati<wbr>on(clang::CompilerInstance*)
              (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0xc17871)</div>
            <div>#19 0x00000000006b2c18 cc1_main(llvm::ArrayRef<char
              const*>, char const*, void*) (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0x6b2c18)</div>
            <div>#20 0x00000000006a07df main (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0x6a07df)</div>
            <div>#21 0x00007f56588b39a7 __libc_start_main
              (/usr/lib/libc.so.6+0x219a7)</div>
            <div>#22 0x00000000006aff1a _start (/home/steven/.apps/llvm-trunk<wbr>/bin/clang-6.0+0x6aff1a)</div>
            <div>Stack dump:</div>
            <div>0.      Program arguments:
              /home/steven/.apps/llvm-trunk/<wbr>bin/clang-6.0 -cc1
              -triple nvptx64-nvidia-cuda -aux-triple
              x86_64-unknown-linux-gnu -S -disable-free
              -disable-llvm-verifier -discard-value-names
              -main-file-name nbody_CPU_SOA.c -mrelocation-model pic
              -pic-level 2 -mthread-model posix -mdisable-fp-elim
              -relaxed-aliasing -menable-no-infs -menable-no-nans
              -menable-unsafe-fp-math -fno-signed-zeros -mreassociate
              -freciprocal-math -fno-trapping-math -ffp-contract=fast
              -ffast-math -ffinite-math-only -no-integrated-as
              -fuse-init-array -mlink-cuda-bitcode
              /opt/cuda/nvvm/libdevice/libde<wbr>vice.10.bc
              -target-feature +ptx60 -target-cpu sm_35
              -dwarf-column-info -debugger-tuning=gdb -v -resource-dir
              /home/steven/.apps/llvm-trunk/<wbr>lib/clang/7.0.0
              -dependency-file nbody_CPU_SOA.d -MT nbody_CPU_SOA.o
              -idirafter /usr/lib/gcc/x86_64-pc-linux-g<wbr>nu/7.3.1/include
              -D _GNU_SOURCE -D LIBTIME_STATIC -D USE_OPENMP -D
              HAVE_SIMD -D USE_LIBC11 -I ../subprojects/c11/include -I
              ../subprojects/time/include -I/opt/intel/composerxe/linux/<wbr>ipp/include
              -I/opt/intel/composerxe/linux/<wbr>mkl/include
              -internal-isystem /usr/local/include -internal-isystem
              /home/steven/.apps/llvm-trunk/<wbr>lib/clang/7.0.0/include
              -internal-externc-isystem /include
              -internal-externc-isystem /usr/include -internal-isystem
              /usr/local/include -internal-isystem
              /home/steven/.apps/llvm-trunk/<wbr>lib/clang/7.0.0/include
              -internal-externc-isystem /include
              -internal-externc-isystem /usr/include -O3 -Wall
              -Wdeclaration-after-statement -Wmissing-declarations
              -Wmissing-prototypes -Wno-declaration-after-stateme<wbr>nt
              -Wno-long-long -Wno-unknown-pragmas -Wold-style-definition
              -Wstrict-prototypes -std=gnu99 -fno-dwarf-directory-asm
              -fdebug-compilation-dir /home/steven/Development/nbody<wbr>/src
              -ferror-limit 19 -fmessage-length 190 -fopenmp -pthread
              -fobjc-runtime=gcc -fdiagnostics-show-option
              -fcolor-diagnostics -vectorize-loops -vectorize-slp -o
              /tmp/nbody_CPU_SOA-bcc597.s -x c nbody_CPU_SOA.c
              -fopenmp-is-device -fopenmp-host-ir-file-path
              /tmp/nbody_CPU_SOA-eb1725.bc </div>
            <div>1.      <eof> parser at end of file</div>
            <div>2.      Per-module optimization passes</div>
            <div>3.      Running pass 'Called Value Propagation' on
              module 'nbody_CPU_SOA.c'.</div>
            <div>clang-6.0: error: unable to execute command:
              Segmentation fault (core dumped)</div>
          </div>
          <div><br>
          </div>
          <div>If someone wants to repro this, you can build my version
            of n-body from here (branch "clang-openmp-offload-testing"<wbr>):</div>
          <div><br>
          </div>
          <div><a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftycho%2F&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=P70LhXiUDSPob%2BQxP7futTaVc5VDsvKC6FSLCNrOOqw%3D&reserved=0" target="_blank">https://github.com/tycho/</a>nbody<wbr>/tree/clang-openmp-offload-<wbr>testing<br>
          </div>
          <div><br>
          </div>
          <div>I'm building with:</div>
          <div><br>
          </div>
          <div>$ make V=1 CC="clang -fopenmp=libomp
            -fopenmp-targets=nvptx64-nvidi<wbr>a-cuda -v"</div>
          <div><br>
          </div>
          <div>- Steven</div>
        </div>
        <br>
        <div>[1] <a href="https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.uplinklabs.net%2Fsteven%2Fprojects%2Fllvm%2Fclang.git%2Flog%2F%3Fh%3Drelease_60&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=eWobBhVL7ZnfCC6LUngPVQHpW%2FzWrj0463H0zEhcZ8M%3D&reserved=0" target="_blank">https://git.uplinklabs.<wbr>net/steven/projects/llvm/<wbr>clang.git/log/?h=release_60</a></div>
      </div>
      <br>
      <fieldset class="m_-7948280028237373099mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><pre>______________________________<wbr>_________________
Openmp-dev mailing list
<a class="m_-7948280028237373099moz-txt-link-abbreviated" href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a>
<a class="m_-7948280028237373099moz-txt-link-freetext" href="https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.llvm.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fopenmp-dev&data=02%7C01%7C%7C1edae8c5df6c444ce9d808d588f7cdaf%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636565520239667730&sdata=jAK5wS%2FRC4EnFzviZL4lGwlNqT9QJgglmk1ahN%2FnJ90%3D&reserved=0" target="_blank">https://nam04.safelinks.<wbr>protection.outlook.com/?url=<wbr>http%3A%2F%2Flists.llvm.org%<wbr>2Fcgi-bin%2Fmailman%<wbr>2Flistinfo%2Fopenmp-dev&data=<wbr>02%7C01%7C%<wbr>7C1edae8c5df6c444ce9d808d588f7<wbr>cdaf%<wbr>7C84df9e7fe9f640afb435aaaaaaaa<wbr>aaaa%7C1%7C0%<wbr>7C636565520239667730&sdata=<wbr>jAK5wS%<wbr>2FRC4EnFzviZL4lGwlNqT9QJgglmk1<wbr>ahN%2FnJ90%3D&reserved=0</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div><br></div>