conda-forge / conda-forge/llvmdev-feedstock

/usr/include leaking into conda-build with openmp runtimes enabled.

Open
#230 24 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Shell
Stars
12
Forks
54
Avg merge
4h 15m
Merged PRs (30d)
3

Description

### Comment:

I'm not using the conda-forge recipes (instead basing what I'm doing on the Numba recipe) but I thought this group might have expertise to answer my question. In build.sh, I'm building clang/lld/libunwind and the openmp runtimes as below.

_cmake_config+=(-DLLVM_ENABLE_PROJECTS:STRING="clang;lld;libunwind")
_cmake_config+=(-DLLVM_ENABLE_RUNTIMES:STRING=openmp)

I'm doing this in a Centos 7 VM. The build gets into building the runtime and for some of the compilation steps I get the following errors.

```
[ 12%] Building LLVM bitcode Reduction.cpp-sm_52.bc
cd $SRC_DIR/llvm/build/runtimes/runtimes-bins/openmp/libomptarget/DeviceRTL && $SRC_DIR/llvm/build/bin/clang -S -x c++ -std=c++17 -fvisibility=hidden -O1 -mllvm -openmp-opt-disable -DSHARED_SCRATCHPAD_SIZE=512 -Xclang -emit-llvm-bc -Xclang -aux-triple -Xclang x86_64-unknown-linux-gnu -fopenmp -fopenmp-cuda-mode -Xclang -fopenmp-is-device -I$SRC_DIR/openmp/libomptarget/DeviceRTL/include -I$SRC_DIR/openmp/libomptarget/DeviceRTL/../include -I$SRC_DIR/llvm/include -I$SRC_DIR/llvm/build/include -DOMPTARGET_DEBUG=0 -Xclang -target-cpu -Xclang sm_52 -target nvptx64-nvidia-cuda -Xclang -target-feature -Xclang +ptx61 -D__CUDA_ARCH__=520 $SRC_DIR/openmp/libomptarget/DeviceRTL/src/Reduction.cpp -o Reduction.cpp-sm_52.bc
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp:16:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/Object/Binary.h:17:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/Triple.h:12:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/Twine.h:12:
/home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/SmallVector.h:191:12: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
std::enable_if_t, T *>::value,
~~~~~^~~~~~~~~~~
enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
struct enable_if
^
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp:16:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/Object/Binary.h:17:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/Triple.h:12:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/Twine.h:12:
/home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/SmallVector.h:191:43: error: no template named 'remove_const_t' in namespace 'std'; did you mean 'remove_const'?
std::enable_if_t, T *>::value,
~~~~~^~~~~~~~~~~~~~
remove_const
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1327:12: note: 'remove_const' declared here
struct remove_const
^
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/openmp/libomptarget/plugins/common/elf_common/elf_common.cpp:16:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/Object/Binary.h:17:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/Triple.h:12:
In file included from /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/Twine.h:12:
/home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/work/llvm/include/llvm/ADT/SmallVector.h:204:12: error: no template named 'enable_if_t' in namespace 'std'; did you mean 'enable_if'?
std::enable_if_t, T *>::value,
~~~~~^~~~~~~~~~~
enable_if
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../include/c++/4.8.5/type_traits:1766:12: note: 'enable_if' declared here
struct enable_if
^
...
```

It seems to be trying to get the C++ include files from /usr/include and failing because enable_if_t is not available in the base gcc available on centos 7 (gcc 4.8.5). I don't know why it is trying to use this gcc at all since the conda environment created at the beginning has gcc 7.5 in it as follows:

```
## Package Plan ##

environment location: /home/taanders/miniconda3/envs/pyomp39/conda-bld/llvmdev_1689873850502/_build_env

The following NEW packages will be INSTALLED:

_libgcc_mutex: 0.1-main
_openmp_mutex: 5.1-1_gnu
_sysroot_linux-64_curr_repodata_hack: 3-haa98f57_10
binutils_impl_linux-64: 2.35.1-h27ae35d_9
binutils_linux-64: 2.35.1-h454624a_30
bzip2: 1.0.8-h7b6447c_0
c-ares: 1.19.0-h5eee18b_0
ca-certificates: 2023.05.30-h06a4308_0
cmake: 3.26.4-h96355d8_0
curl: 7.88.1-h5eee18b_1
expat: 2.4.9-h6a678d5_0
gcc_impl_linux-64: 7.5.0-h7105cf2_17
gcc_linux-64: 7.5.0-h8f34230_30
gdbm: 1.18-hd4cb3f1_4
gettext: 0.21.0-h39681ba_1
git: 2.40.1-pl5340h36fbf9e_1
gxx_impl_linux-64: 7.5.0-h0a5bf11_17
gxx_linux-64: 7.5.0-hffc177d_30
icu: 58.2-he6710b0_3
kernel-headers_linux-64: 3.10.0-h57e8cba_10
krb5: 1.20.1-h143b758_1
ld_impl_linux-64: 2.35.1-h7274673_9
libcurl: 7.88.1-h251f7ec_1
libedit: 3.1.20221030-h5eee18b_0
libev: 4.33-h7f8727e_1
libffi: 3.4.4-h6a678d5_0
libgcc-devel_linux-64: 7.5.0-hbbeae57_17
libgcc-ng: 11.2.0-h1234567_1
libgomp: 11.2.0-h1234567_1
libnghttp2: 1.52.0-h2d74bed_1
libssh2: 1.10.0-hdbd6064_2
libstdcxx-devel_linux-64: 7.5.0-hf0c5c8d_17
libstdcxx-ng: 11.2.0-h1234567_1
libuuid: 1.41.5-h5eee18b_0
libuv: 1.44.2-h5eee18b_0
libxml2: 2.10.3-hcbfbd50_0
lz4-c: 1.9.4-h6a678d5_0
make: 4.2.1-h1bed415_1
ncurses: 6.4-h6a678d5_0
openssl: 3.0.9-h7f8727e_0
pcre2: 10.42-hebb0a14_0
perl: 5.34.0-h5eee18b_2
pip: 23.1.2-py311h06a4308_0
python: 3.11.4-h955ad1f_0
readline: 8.2-h5eee18b_0
rhash: 1.4.3-hdbd6064_0
setuptools: 67.8.0-py311h06a4308_0
sqlite: 3.41.2-h5eee18b_0
sysroot_linux-64: 2.17-h57e8cba_10
tk: 8.6.12-h1ccaba5_0
tzdata: 2023c-h04d1e81_0
wheel: 0.38.4-py311h06a4308_0
xz: 5.4.2-h5eee18b_0
zlib: 1.2.13-h5eee18b_0
zstd: 1.5.5-hc292b87_0
```

Any suggestions on how to proceed? Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with build.sh and reproduce the LLVM, clang, lld, libunwind, and OpenMP runtime build in the CentOS 7 environment described. Inspect which compiler and C++ include paths are selected during the failing DeviceRTL and elf_common.cpp steps. Done means the runtime build completes without incorrectly using the CentOS 7 /usr/include C++ headers.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp, linux, shell
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.