Jeremey,
Could you let me know if in the LLVM-openMP project we have the same opt as the default llvm-opt ?
as I am running these procedures:
1- clang(Openmp) -S -emit-llvm -fopenmp llvm_openmp.c
2- opt(Openmp) -S -o hello_opt.ll hello.ll
3- clang(Openmp) hello_opt.ll -lm
I am getting :
[ashouri@savina openmp_power]$ clang -v llvm_openmp.ll -lm
clang version 3.5.0 (https://github.com/clang-omp/clang 05ab95f7cb2779bbf20341ae6ed293106de5afda) (https://github.com/clang-omp/llvm e45b045553e027cbe400cbb8ac8c264abbbfaf83)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.4.4
Found candidate GCC installation: /usr/lib/gcc/i686-redhat-linux/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.4.7
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/4.4.7
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
“~/llvm/build/Debug+Asserts/bin/clang” -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name llvm_openmp.ll -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.20.51.0.2 -v -dwarf-column-info -resource-dir ~llvm/build/Debug+Asserts/bin/…/lib/clang/3.5.0 -fdebug-compilation-dir /usa/ashouri/phase_ordering/openmp_power -ferror-limit 19 -fmessage-length 204 -mstackrealign -fobjc-runtime=gcc -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/llvm_openmp-3af5c7.o -x ir llvm_openmp.ll
clang -cc1 version 3.5.0 based upon LLVM 3.5.0 default target x86_64-unknown-linux-gnu
“/usr/bin/ld” --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/lib64 -L/lib/…/lib64 -L/usr/lib/…/lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/… -L/~/llvm/build/Debug+Asserts/bin/…/lib -L/lib -L/usr/lib /tmp/llvm_openmp-3af5c7.o -lm -L. -L/~/openmp/runtime/exports/lin_32e/lib -L~/openmp/runtime/exports/lin_32e/lib -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/…/…/…/…/lib64/crtn.o
/tmp/llvm_openmp-3af5c7.o: In function `main’:
llvm_openmp.ll:(.text+0x75): undefined reference to `__kmpc_fork_call’
/tmp/llvm_openmp-3af5c7.o: In function `.omp_microtask.’:
llvm_openmp.ll:(.text+0xf1): undefined reference to `omp_get_thread_num’
llvm_openmp.ll:(.text+0xf9): undefined reference to `omp_get_num_threads’
llvm_openmp.ll:(.text+0x101): undefined reference to `omp_get_max_threads’
llvm_openmp.ll:(.text+0x12d): undefined reference to `__kmpc_cancel_barrier’
its strange cuz when I dont invoke -emit-llvm and just compiler and link at once with clang(openmp) -fopenmp foo.c the executable can be run with max threads.
Appreciate any helps,
-Amir