rocm / rocm-cmake Goto Github PK
View Code? Open in Web Editor NEWCMake modules used within the ROCm libraries
Home Page: https://rocm.github.io/rocm-cmake/doc/html/
License: MIT License
CMake modules used within the ROCm libraries
Home Page: https://rocm.github.io/rocm-cmake/doc/html/
License: MIT License
This can help speed up building in many targets.
Using
if(${inout_variable})
where the value of inout_variable might be CPACK_DEB_WIBBLE looks up the truthfulness of the variable CPACK_DEB_WIBBLE.
However the cmake idea of true does not include strings like
N
0
FALSE
so this function givens incorrect results for
set(X FALSE)
rocm_join_if_set("," X "he said")
the function ought to be fixed to compare to the empty string or else renamed to rocm_join_if_true to reflect its nature. Of course the latter function is much less useful.
Can this project have a release for the stable version that could be used and linked to another project?
I've failed to use cmake -DCMAKE_INSTALL_PREFIX=$pkgdir/opt/rocm --build . --target install
to package rocm-cmake for my distro. How to correctly use it?
Let's check what hcc is using so we don't conflict.
I am trying to install rocm-cmake on Ubuntu 20.04. I am getting the following error;
:~/rocm-cmake/build$ cmake --build . --target install
Install the project...
-- Install configuration: ""
-- Up-to-date: /opt/rocm/./share
CMake Error at cmake_install.cmake:41 (file):
file INSTALL cannot set permissions on "/opt/rocm/./share": Operation not
permitted.
make: *** [Makefile:119: install] Error 1
Please see: https://github.com/jtojnar/cmake-snips#assuming-cmake_install_dir-is-relative-path
For context: ROCm/hipamd#55
Here is an example:
https://github.com/RadeonOpenCompute/rocm-cmake/blob/027404a8326da6e7e9338e0b81f9428660190724/share/rocm/cmake/ROCMInstallTargets.cmake#L87-L96
This assumes that CMAKE_INSTALL_<DIR>
is relative, which is definitely not always the case.
The version specified in rocm-cmake is not written to a file detectable by cmake, so other packages cannot require a specific version of rocm-cmake. Attempting to require version 0.5 (the latest version on master) results in the error message:
[cmake] Could not find a configuration file for package "ROCM" that is compatible
[cmake] with requested version "0.5".
[cmake]
[cmake] The following configuration files were considered but not accepted:
[cmake]
[cmake] /opt/rocm/share/rocm/cmake/ROCMConfig.cmake, version: unknown
We are going to enforce two factor authentication in (https://github.com/RadeonOpenCompute/) organization on 8th April , 2022 . Since we identified you as outside collaborator for this organization, you need to enable two factor authentication in your github account else you shall be removed from the organization after the enforcement. Please skip if already done.
To set up two factor authentication, please go through the steps in below link:
Please reach out to "[email protected] " for queries
Invoking
find_package( ROCM 0.5 CONFIG QUIET PATHS ${ROCM_PATH} /opt/rocm )
to include rocm-cmake is confusing.
We should consider changing the name to ROCM-CMAKE.
ROCm/ROCm#1905 discussed that currently rocm packages install test binaries as tests component. ROCm/ROCm#1905 (comment) pointed out that it may be used in cpack, but for distos which does not use cpack, the default installation includes test binaries (if they are built).
Is it possible that rocm-install
function add an EXCLUDE_FROM_ALL
option when COMPONENTS
matches tests
? This requires minimum cmake version of 3.6 (https://cmake.org/cmake/help/latest/command/install.html)
CPackRPM:Warning: CPACK_SET_DESTDIR is set (=ON) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.
Can we look at supporting relocatable packages by default? Do we need this value set?
See failure in https://github.com/ROCm/rocm-cmake/actions/runs/7493947898/job/20400783726.
Unknown failure in Doxygen when running the doc-sphinxdoxygen test on macOS.
(CPU/GPU irrelevant)
Failure log:
[...]
[100%] Building html documentation with Sphinx
Running Sphinx v5.3.0
making output directory... done
Extension error (rocm_docs.doxygen):
Handler <function _run_doxygen at 0x[109](https://github.com/ROCm/rocm-cmake/actions/runs/7493947898/job/20400783726#step:7:110)b42940> for event 'config-inited' threw an exception (exception: Failed when running doxygen)
make[3]: *** [CMakeFiles/useful-sphinx-HTML] Error 2
make[2]: *** [CMakeFiles/useful-sphinx-HTML.dir/all] Error 2
make[1]: *** [CMakeFiles/doc.dir/rule] Error 2
make: *** [doc] Error 2
CMake Error at /Users/runner/work/rocm-cmake/rocm-cmake/test/test.cmake:88 (message):
Process failed: COMMAND
/Users/runner/hostedtoolcache/cmake/3.20.0/x64/cmake-3.20.0-macos-universal/CMake.app/Contents/bin/cmake
--build
/Users/runner/work/rocm-cmake/rocm-cmake/cget/cget/build/_url_L1VzZXJzL3J1bm5lci93b3JrL3JvY20tY21ha2Uvcm9jbS1jbWFrZQ__/build/test/tmp/pass-doc-sphinxdoxygen-QV4JI/builds/EA1Dz
--target doc
Call Stack (most recent call first):
/Users/runner/work/rocm-cmake/rocm-cmake/test/test.cmake:[115](https://github.com/ROCm/rocm-cmake/actions/runs/7493947898/job/20400783726#step:7:116) (test_exec)
/Users/runner/work/rocm-cmake/rocm-cmake/test/test.cmake:133 (configure_dir)
/Users/runner/work/rocm-cmake/rocm-cmake/test/pass/doc-sphinxdoxygen.cmake:5 (install_dir)
/Users/runner/work/rocm-cmake/rocm-cmake/test/test.cmake:171 (include)
[...]
macOS-11
N/A
AMD Radeon VII
ROCm 6.0.0
rocm-cmake
No response
No response
No response
sudo apt remove rocm-cmake
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
hip-dev hip-doc hip-samples hipcub-dev hipfort-dev hipify-clang rocm-device-libs rocm-ml-libraries rocprim-dev
rocthrust-dev rocwmma-dev
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
rocm-cmake rocm-hip-runtime-dev rocm-hip-sdk rocm-ml-sdk
0 upgraded, 0 newly installed, 4 to remove and 170 not upgraded.
After this operation, 168 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 276855 files and directories currently installed.)
Removing rocm-ml-sdk (5.5.1.50501-74~22.04) ...
Removing rocm-hip-sdk (5.5.1.50501-74~22.04) ...
Removing rocm-hip-runtime-dev (5.5.1.50501-74~22.04) ...
Removing rocm-cmake (0.8.1.50501-74~22.04) ...
The symlink seems to be wrong.
It creates the symlink in package library with link-destination /opt/rocm/lib/..
and overwrites the original library file. The library also creates symlink in /opt/rocm/lib/ in reversed way.
Use hipFFT as example,
\${LINK_PATH}/$<TARGET_LINKER_FILE_NAME:${TARGET}>
is ../../lib/libhipfft.so
\${LINK_DIR}/${ROCM_INSTALL_LIBDIR}/$<TARGET_LINKER_FILE_NAME:${TARGET}>
is /opt/rocm/hipfft/lib/libhipfft.so
/opt/rocm/hipfft/lib/libhipfft.so
-> ../../lib/libhipfft.so
(i.e. /opt/rocm/lib/libhipfft.so
)
It overwrites the original library.
and hipFFT also creates /opt/rocm/lib/libhipfft.so
-> /opt/rocm/hipfft/lib/libhipfft.so
to lead circular symlink
[Observations]
with googletest v1.14.0
(latest version as of 10/31/2023)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG f8d7d77c06936315286eb55f8de22cd23c188571
)
We observe multiple ROCMChecks WARNING
warnings like
*******************************************************************************
*------------------------------- ROCMChecks WARNING --------------------------*
Options and properties should be set on a cmake target where possible. The
variable 'CMAKE_C_FLAGS' may be set by the cmake toolchain, either by
calling 'cmake -DCMAKE_C_FLAGS=""'
or set in a toolchain file and added with
'cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file>'. ROCMChecks now calling:
CMake Warning at /opt/rocm/share/rocm/cmake/ROCMChecks.cmake:46 (message):
'CMAKE_C_FLAGS' is set at
/home/junliu/MIOpen/build/_deps/googletest-src/googletest/CMakeLists.txt:<line#>
shown below:
Call Stack (most recent call first):
build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:9223372036854775807 (rocm_check_toolchain_var)
build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:52 (string)
build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:72 (fix_default_compiler_settings_)
build/_deps/googletest-src/googletest/CMakeLists.txt:83 (config_compiler_and_linker)
*-----------------------------------------------------------------------------*
*******************************************************************************
*******************************************************************************
*------------------------------- ROCMChecks WARNING --------------------------*
Options and properties should be set on a cmake target where possible. The
variable 'CMAKE_CXX_FLAGS' may be set by the cmake toolchain, either by
calling 'cmake -DCMAKE_CXX_FLAGS=""'
or set in a toolchain file and added with
'cmake -DCMAKE_TOOLCHAIN_FILE=<toolchain-file>'. ROCMChecks now calling:
CMake Warning at /opt/rocm/share/rocm/cmake/ROCMChecks.cmake:46 (message):
'CMAKE_CXX_FLAGS' is set at
/home/junliu/MIOpen/build/_deps/googletest-src/googletest/CMakeLists.txt:<line#>
shown below:
Call Stack (most recent call first):
build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:9223372036854775807 (rocm_check_toolchain_var)
build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:38 (string)
build/_deps/googletest-src/googletest/cmake/internal_utils.cmake:72 (fix_default_compiler_settings_)
build/_deps/googletest-src/googletest/CMakeLists.txt:83 (config_compiler_and_linker)
*-----------------------------------------------------------------------------*
*******************************************************************************
[Likely Root Cause]:
It is likely that rocm-cmake
grep the keywords from
foreach (flag_var
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
such as CMAKE_CXX_FLAGS
and CMAKE_C_FLAGS
Should this be a false positive? How can we disable or suppress warning like this one?
cmake ../ && make -j8 && sudo make install
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /usr/share/cmake-3.10/Modules/WriteBasicConfigVersionFile.cmake:35 (message):
Bad COMPATIBILITY value used for WRITE_BASIC_CONFIG_VERSION_FILE():
"SameMinorVersion"
Call Stack (most recent call first):
/usr/share/cmake-3.10/Modules/CMakePackageConfigHelpers.cmake:207 (write_basic_config_version_file)
CMakeLists.txt:21 (write_basic_package_version_file)
-- Configuring incomplete, errors occurred!
See also "/home/kiriti/develop/docker/rocm/rocm-cmake/build/CMakeFiles/CMakeOutput.log".
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.