Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 853718 - dev-util/hip-5.0.2-r1 fails to compile
Summary: dev-util/hip-5.0.2-r1 fails to compile
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-22 08:59 UTC by Yiyang Wu
Modified: 2022-06-22 13:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,248.55 KB, text/x-log)
2022-06-22 09:00 UTC, Yiyang Wu
Details
emerge --info output (emerge-info.txt,5.22 KB, text/plain)
2022-06-22 09:03 UTC, Yiyang Wu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yiyang Wu 2022-06-22 08:59:42 UTC
Starting from the latest gentoo stage3 docker image, emerge hip fails with:

FAILED: src/CMakeFiles/amdhip64.dir/hip_global.cpp.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DATI_ARCH_X86 -DATI_OS_LINUX -DCL_TARGET_OPENCL_VERSION=220 -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DCOMGR_DYN_DLL -DHAVE_CL2_HPP -DLITTLEENDIAN_CPU -DOPENCL_C_MAJOR=2 -DOPENCL_C_MINOR=0 -DOPENCL_MAJOR=2 -DOPENCL_MINOR=2 -DROCCLR_SUPPORT_NUMA_POLICY -DUSE_COMGR_LIBRARY -DWITH_HSA_DEVICE -DWITH_LIGHTNING_COMPILER -DWITH_LIQUID_FLASH=0 -D__HIP_ENABLE_RTC -D__HIP_PLATFORM_AMD__ -Damdhip64_EXPORTS -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/HIP-rocm-5.0.2/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2_build/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../compiler/lib -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../compiler/lib/include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../compiler/lib/backends/common -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../device -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../elf -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCclr-rocm-5.0.2/cmake/../include -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../../.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../../../.. -I/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/ROCm-OpenCL-Runtime-rocm-5.0.2/khronos/headers/opencl2.2/CL/../../../../amdocl -isystem /usr/include/hsa  -O2 -pipe -fPIC -std=c++17 -MD -MT src/CMakeFiles/amdhip64.dir/hip_global.cpp.o -MF src/CMakeFiles/amdhip64.dir/hip_global.cpp.o.d -o src/CMakeFiles/amdhip64.dir/hip_global.cpp.o -c /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp
/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp: In function ‘size_t amd_dbgapi_get_build_id()’:
/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:18:3: error: return-statement with no value, in function returning ‘size_t’ {aka ‘long unsigned int’} [-fpermissive]
   18 |   return HIP_VERSION_BUILD_ID;
      |   ^~~~~~
/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp: In destructor ‘hip::DeviceVar::~DeviceVar()’:
/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:65:22: warning: ignoring returned value of type ‘hipError_t’, declared with attribute ‘nodiscard’ [-Wunused-result]
   65 |     ihipUnbindTexture(texRef);
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.hpp:9,
                 from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:1:
/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_internal.hpp:439:19: note: in call to ‘hipError_t ihipUnbindTexture(textureReference*)’, declared here
  439 | extern hipError_t ihipUnbindTexture(textureReference* texRef);
      |                   ^~~~~~~~~~~~~~~~~
In file included from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.hpp:7,
                 from /ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/hipamd-rocm-5.0.2/src/hip_global.cpp:1:
/ext4-disk/build-vanilla/portage/dev-util/hip-5.0.2-r1/work/HIP-rocm-5.0.2/include/hip/hip_runtime_api.h:317:3: note: ‘hipError_t’ declared here
  317 | } hipError_t;
      |   ^~~~~~~~~~

Reproducible: Always

Steps to Reproduce:
1. docker pull gentoo/stage3
2. docker run -it gentoo/stage3 bash
3. emerge hip
Comment 1 Yiyang Wu 2022-06-22 09:00:24 UTC
Created attachment 786695 [details]
build.log
Comment 2 Yiyang Wu 2022-06-22 09:03:50 UTC
Created attachment 786698 [details]
emerge --info output
Comment 3 Yiyang Wu 2022-06-22 09:27:00 UTC
This cause is ${HIP_VERSION_BUILD_ID} defined in ${S}/CMakeLists.txt:129 is somehow lost when cmake processes to line 293.
Comment 4 Yiyang Wu 2022-06-22 09:28:27 UTC
(In reply to Yiyang Wu from comment #3)
> This cause is ${HIP_VERSION_BUILD_ID} defined in ${S}/CMakeLists.txt:129 is
> somehow lost when cmake processes to line 293.

Oh, so if git is not installed HIP_VERSION_BUILD_ID is not set.
Comment 5 Benda Xu gentoo-dev 2022-06-22 09:33:01 UTC
(In reply to Yiyang Wu from comment #4)
> (In reply to Yiyang Wu from comment #3)
> > This cause is ${HIP_VERSION_BUILD_ID} defined in ${S}/CMakeLists.txt:129 is
> > somehow lost when cmake processes to line 293.
> 
> Oh, so if git is not installed HIP_VERSION_BUILD_ID is not set.

hip build depends on git... too bad.
Comment 6 Yiyang Wu 2022-06-22 09:44:23 UTC
(In reply to Benda Xu from comment #5)
> hip build depends on git... too bad.

Should we add a BDEPEND or just patch it? Adding BDEPEND means we won't have to patch CMakeLists.txt, and future -9999.ebuild may benefit (upstream use git in cmake to determine various version strings).
Comment 7 Yiyang Wu 2022-06-22 11:21:27 UTC
On the other hand this should be a upstream bug -- we should patch CMakelists and submit to upstream.
Comment 8 Larry the Git Cow gentoo-dev 2022-06-22 13:03:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=93ff73188c29fe12088f6166df669847cde9b2b4

commit 93ff73188c29fe12088f6166df669847cde9b2b4
Author:     Yiyang Wu <xgreenlandforwyy@gmail.com>
AuthorDate: 2022-06-22 11:39:27 +0000
Commit:     Benda Xu <heroxbd@gentoo.org>
CommitDate: 2022-06-22 13:00:00 +0000

    dev-util/hip: fix build failure when git not installed
    
    Closes: https://bugs.gentoo.org/853718
    Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
    Signed-off-by: Benda Xu <heroxbd@gentoo.org>

 dev-util/hip/files/hip-5.0.2-set-build-id.patch | 20 ++++++++++++++++++++
 dev-util/hip/hip-5.0.2-r2.ebuild                |  1 +
 2 files changed, 21 insertions(+)
Comment 9 Benda Xu gentoo-dev 2022-06-22 13:28:50 UTC
(In reply to Yiyang Wu from comment #7)
> On the other hand this should be a upstream bug -- we should patch
> CMakelists and submit to upstream.

Yes, please forward the patch upstream.