Issue 86744
Summary Missing header `omp.h` in install directory when building `[email protected]` with `openmp` as runtime with `[email protected]`
Labels new issue
Assignees
Reporter s-sajid-ali
    ### Summary
When installing `[email protected]` with `spack` using `[email protected]` and configuring `openmp` to be enabled as a runtime, the final install directory is missing `omp.h` even though the header is present in the build directory. However, this problem does not occur when building `[email protected]` with the same configuration using `[email protected]`. 

### Details
Here are the two builds of `[email protected]` differing only in the version of `cmake` used for the build. 
```
sasyed@MAC-140753 ~> spack find -lv llvm
-- darwin-sonoma-m1 / [email protected] ------------------------
cgcsya3 [email protected]+clang~code_signing~cuda~flang~gold~ipo~libomptarget~libomptarget_debug~link_llvm_dylib+lld+lldb+llvm_dylib+lua~mlir+polly~python~split_dwarf~z3~zstd build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime shlib_symbol_version=none targets=none version_suffix=none
bydpwmd [email protected]+clang~code_signing~cuda~flang~gold~ipo~libomptarget~libomptarget_debug~link_llvm_dylib+lld+lldb+llvm_dylib+lua~mlir+polly~python~split_dwarf~z3~zstd build_system=cmake build_type=Release compiler-rt=runtime generator=ninja libcxx=runtime libunwind=runtime openmp=runtime shlib_symbol_version=none targets=none version_suffix=none
==> 2 installed packages
sasyed@MAC-140753 ~> spack diff /cgc /byd
==> Warning: This interface is subject to change.

--- [email protected]/cgcsya36nknpeizproew2cdxtf4r6xcb
+++ [email protected]/bydpwmdkng7shunf3ltzj56a3bkjepy5
@@ hash @@
-  cmake slpmwq3esyyjikfqskqbea3nvobw7oei
+  cmake yyb45mfiot4obxxx7kashbrpvudmx3d4
-  llvm cgcsya36nknpeizproew2cdxtf4r6xcb
+  llvm bydpwmdkng7shunf3ltzj56a3bkjepy5
@@ package_hash @@
-  cmake gsj2wl26n5psfanwtf3a3owh6fcj5mnx6eyuygm6g7eo5wye6y4a====
+  cmake 4nfzzuirvovagbkvkxjvtkvwyokgaekv3iyo3emo7h2ai42uofmq====
@@ version @@
-  cmake 3.29.0
+  cmake 3.27.9
sasyed@MAC-140753 ~>
```

Here are the results of an attempt to locate `omp.h` within the two install destinations: 
```
sasyed@MAC-140753 ~> fd "omp.h" (spack location -i /cgc)
/Users/sasyed/Documents/packages/spack/opt/spack/darwin-sonoma-m1/apple-clang-15.0.0/llvm-18.1.2-cgcsya36nknpeizproew2cdxtf4r6xcb/include/llvm/Frontend/OpenMP/OMP.h.inc
/Users/sasyed/Documents/packages/spack/opt/spack/darwin-sonoma-m1/apple-clang-15.0.0/llvm-18.1.2-cgcsya36nknpeizproew2cdxtf4r6xcb/include/polly/CodeGen/LoopGeneratorsGOMP.h
sasyed@MAC-140753 ~> fd "omp.h" (spack location -i /byd)
/Users/sasyed/Documents/packages/spack/opt/spack/darwin-sonoma-m1/apple-clang-15.0.0/llvm-18.1.2-bydpwmdkng7shunf3ltzj56a3bkjepy5/include/c++/v1/__algorithm/comp.h
/Users/sasyed/Documents/packages/spack/opt/spack/darwin-sonoma-m1/apple-clang-15.0.0/llvm-18.1.2-bydpwmdkng7shunf3ltzj56a3bkjepy5/include/llvm/Frontend/OpenMP/OMP.h.inc
/Users/sasyed/Documents/packages/spack/opt/spack/darwin-sonoma-m1/apple-clang-15.0.0/llvm-18.1.2-bydpwmdkng7shunf3ltzj56a3bkjepy5/include/polly/CodeGen/LoopGeneratorsGOMP.h
/Users/sasyed/Documents/packages/spack/opt/spack/darwin-sonoma-m1/apple-clang-15.0.0/llvm-18.1.2-bydpwmdkng7shunf3ltzj56a3bkjepy5/lib/clang/18/include/omp.h
sasyed@MAC-140753 ~> 
```
where it is clear that when using `[email protected]` the header `omp.h` is missing. 

It is however, present in the build directory as shown below:
```
sasyed@MAC-140753 /v/f/m/z/T/s/s/s/spack-build-cgcsya3> pwd
/var/folders/mb/zd6pgmt100q77s5fhn5xf4jw0000gq/T/sasyed/spack-stage/spack-stage-llvm-18.1.2-cgcsya36nknpeizproew2cdxtf4r6xcb/spack-build-cgcsya3
sasyed@MAC-140753 /v/f/m/z/T/s/s/s/spack-build-cgcsya3> fd "omp.h"
include/c++/v1/__algorithm/comp.h
include/llvm/Frontend/OpenMP/OMP.h.inc
runtimes/runtimes-bins/openmp/runtime/src/omp.h
sasyed@MAC-140753 /v/f/m/z/T/s/s/s/spack-build-cgcsya3> 
```

### Platform information & Supporting logs
Output of `spack debug report`:
```
sasyed@MAC-140753 ~> spack debug report
* **Spack:** 0.22.0.dev0 (69509a6d9a9c515dc4e00fbfe94c7e27a440b0ad)
* **Python:** 3.9.6
* **Platform:** darwin-sonoma-m1
* **Concretizer:** clingo
sasyed@MAC-140753 ~> 
```

Build log for `[email protected] targets=none ^[email protected]`: [spack-build-out.txt](https://github.com/llvm/llvm-project/files/14765311/spack-build-out.txt)
Build log for `[email protected] targets=none` (implicitly picking `[email protected]`): [spack-build-out.txt](https://github.com/llvm/llvm-project/files/14765315/spack-build-out.txt)



_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to