Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Configure generates invalid Makefile for clang, if AMD runtime is installed #305

Closed
AngryLoki opened this issue Dec 25, 2023 · 2 comments

Comments

@AngryLoki
Copy link
Contributor

AngryLoki commented Dec 25, 2023

Describe the bug
This issue was originally reported to https://bugs.gentoo.org/919253

When clang is used, and HIP runtime (amdgpu) is installed, build fails with:

>>> Compiling source in /var/tmp/portage/sys-process/lsof-4.99.0/work/lsof-4.99.0 ...

make -j4 DEBUG= all 
Makefile:1120: *** missing separator.  Stop.

$ cat Makefile
... output skipped ...
cc = clang
ccflags = -march=native -O2 -pipe -flto=thin -D_FILE_OFFSET_BITS=64 -DLSOF_VSTR=\"6.5.7-gentoo-dist\"
ccv = 17.0.3
5.7.31921
datadir = /usr/share
... output skipped ...
...

The issue is caused by line https://github.com/lsof-org/lsof/blob/4.99.0/configure.ac#L559 , which attempts to extract clang version, while clang -v additionally outputs version of HIP runtime. This issue is similar to #68, but there it was clang/macos/nvidia and now it affects clang/linux/amdgpu.

$ clang -v 2>&1 | grep version
clang version 17.0.3
Found HIP installation: /usr/local, version 5.7.31921

It is very likely that as described in #68, Makefile will also fail with Found CUDA installation: /usr/local/cuda, version 9.0 too

To Reproduce
Steps to reproduce the behavior:

  1. Install hip runtime and clang. Try to build with clang
  2. See error

Expected behavior
As clang outputs its version in the first line, and may output arbitrary information after that, it should be safe to take version from the first version in the output.

  • Kernel: Linux
  • OS: Gentoo
  • lsof Version: 4.99.0
  • Origin: lsof update during system upgrade
@AngryLoki
Copy link
Contributor Author

Closed with fix in #306, thanks for merging

@jiegec
Copy link
Contributor

jiegec commented Dec 26, 2023

Fixed in #306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants