如果系统里没有cmake怎么办? 使用pip install来安装cmake
如果系统里没有cmake怎么办?
可以使用系统自己的包管理器比如apt、pkg等来安装
如果没有root权限怎么办?
可以用普通用户编译安装cmake到用户目录
如果无法编译安装到用户目录怎么办?
可以直接用pip安装cmake
以下为在启智社区云脑任务的Ascend NPU环境下,使用pip安装cmake的过程:
(MindSpore) [root@hfed647d3e83452bbcda1f6041056a53-task0-0 ma-user]# cmake
sh: cmake: command not found
(MindSpore) [root@hfed647d3e83452bbcda1f6041056a53-task0-0 ma-user]# pip install cmake
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting cmakeDownloading http://mirrors.aliyun.com/pypi/packages/d1/8b/a873f9dbd7983d3a8981cee68246ef690b18aa41ec25281cce54c01e9a5b/cmake-4.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (30.4 MB)━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 30.4/30.4 MB 18.5 MB/s eta 0:00:00
DEPRECATION: moxing-framework 2.1.16.2ae09d45 has a non-standard version number. pip 24.0 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of moxing-framework or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: cmake
Successfully installed cmake-4.1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
(MindSpore) [root@hfed647d3e83452bbcda1f6041056a53-task0-0 ma-user]# cmake
Usagecmake [options] <path-to-source>cmake [options] <path-to-existing-build>cmake [options] -S <path-to-source> -B <path-to-build>Specify a source directory to (re-)generate a build system for it in the
current working directory. Specify an existing build directory to
re-generate its build system.Run 'cmake --help' for more information.(MindSpore) [root@hfed647d3e83452bbcda1f6041056a53-task0-0 ma-user]#