<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Unable to compile code using openmp"
   href="https://bugs.llvm.org/show_bug.cgi?id=37322">37322</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unable to compile code using openmp
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>OpenMP
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>HP
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Clang Compiler Support
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>gmishx@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I am currently using Ubuntu Trusty (14.04) for testing an Open Source software
FOSSology (<a href="https://github.com/fossology/fossology.git">https://github.com/fossology/fossology.git</a>).

I have also added following repositories to apt:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo add-apt-repository 'deb <a href="http://apt.llvm.org/trusty/">http://apt.llvm.org/trusty/</a> llvm-toolchain-trusty
main'
sudo add-apt-repository 'deb <a href="http://apt.llvm.org/trusty/">http://apt.llvm.org/trusty/</a>
llvm-toolchain-trusty-5.0 main'
sudo add-apt-repository 'deb <a href="http://apt.llvm.org/trusty/">http://apt.llvm.org/trusty/</a>
llvm-toolchain-trusty-6.0 main'
wget -O - <a href="https://apt.llvm.org/llvm-snapshot.gpg.key|sudo">https://apt.llvm.org/llvm-snapshot.gpg.key|sudo</a> apt-key add -

Then I set 3 environment variables
export CC=clang-6.0
export CXX=clang++-6.0
export CFLAGS='-Wall -Werror -Wno-deprecated-register -fopenmp=libgomp -v'

Then I compiled it using make and got following error:

clang version 6.0.1-svn330209-1~exp1~20180426064219.71 (branches/release_60)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8.0.1
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/7.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8.0.1
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/usr/lib/llvm-6.0/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name buckets.c -mrelocation-model pic -pic-level 2 -mthread-model
posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-6.0/lib/clang/6.0.1 -D
"PROJECTSTATEDIR=\"/var/local/lib/fossology\"" -D "DATADIR=\"\"" -I
/usr/include/postgresql -I /usr/include/glib-2.0 -I
/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ../../../src/lib/c -D
"VERSION_S=\"3.2.0-35-g84322ef\"" -D "COMMIT_HASH_S=\"84322e\""
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-6.0/lib/clang/6.0.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -Werror -Wno-deprecated-register
-fdebug-compilation-dir /home/fossyback/development/fossology/src/buckets/agent
-ferror-limit 19 -fmessage-length 205 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/buckets-71d083.o -x c
buckets.c
clang -cc1 version 6.0.1 based upon LLVM 6.0.1 default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/postgresql
 /usr/include/glib-2.0
 /usr/lib/x86_64-linux-gnu/glib-2.0/include
 ../../../src/lib/c
 /usr/local/include
 /usr/lib/llvm-6.0/lib/clang/6.0.1/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/usr/lib/llvm-6.0/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj
-mrelax-all -disable-free -disable-llvm-verifier -discard-value-names
-main-file-name write.c -mrelocation-model pic -pic-level 2 -mthread-model
posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases
-munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info
-debugger-tuning=gdb -v -resource-dir /usr/lib/llvm-6.0/lib/clang/6.0.1 -D
"PROJECTSTATEDIR=\"/var/local/lib/fossology\"" -D "DATADIR=\"\"" -I
/usr/include/postgresql -I /usr/include/glib-2.0 -I
/usr/lib/x86_64-linux-gnu/glib-2.0/include -I ../../../src/lib/c -D
"VERSION_S=\"3.2.0-35-g84322ef\"" -D "COMMIT_HASH_S=\"84322e\""
-internal-isystem /usr/local/include -internal-isystem
/usr/lib/llvm-6.0/lib/clang/6.0.1/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -Wall -Werror -Wno-deprecated-register
-fdebug-compilation-dir /home/fossyback/development/fossology/src/buckets/agent
-ferror-limit 19 -fmessage-length 205 -fobjc-runtime=gcc
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/write-b7646d.o -x c
write.c
clang -cc1 version 6.0.1 based upon LLVM 6.0.1 default target
x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/include/postgresql
 /usr/include/glib-2.0
 /usr/lib/x86_64-linux-gnu/glib-2.0/include
 ../../../src/lib/c
 /usr/local/include
 /usr/lib/llvm-6.0/lib/clang/6.0.1/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/usr/bin/ld" -z relro --hash-style=gnu --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -o buckets
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crt1.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtbegin.o -L../../../src/lib/c
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../..
-L/usr/lib/llvm-6.0/bin/../lib -L/lib -L/usr/lib /tmp/buckets-71d083.o
validate.o inits.o liccache.o walk.o leaf.o match.o container.o child.o
/tmp/write-b7646d.o -lfossology -lglib-2.0 -lpq -lpq -lgomp -lrt -lgcc
--as-needed -lgcc_s --no-as-needed -lpthread -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtend.o
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crtn.o
make[3]: Leaving directory
`/home/fossyback/development/fossology/src/buckets/agent'
make[3]: Entering directory
`/home/fossyback/development/fossology/src/buckets/ui'
nothing to do
make[3]: Leaving directory
`/home/fossyback/development/fossology/src/buckets/ui'
make[2]: Leaving directory `/home/fossyback/development/fossology/src/buckets'
make -s -C cli
make[2]: Entering directory `/home/fossyback/development/fossology/src/cli'
Regenerating variables list ...
make[3]: Entering directory `/home/fossyback/development/fossology/src/cli'
make[4]: Entering directory `/home/fossyback/development/fossology/src/cli'
make[4]: Leaving directory `/home/fossyback/development/fossology/src/cli'
make[3]: Leaving directory `/home/fossyback/development/fossology/src/cli'
Generating fo_wrapper ...
make[2]: Leaving directory `/home/fossyback/development/fossology/src/cli'
make -s -C copyright
make[2]: Entering directory
`/home/fossyback/development/fossology/src/copyright'
writing VERSION file for copyright
writing VERSION file for ecc
make[3]: Entering directory
`/home/fossyback/development/fossology/src/copyright/agent'
/usr/bin/ld: cannot find -lomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I even tried installing libiomp5 and set the -fopenmp=libiomp5 but still got
the same problem.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>