如何获取rpm-mpi钩以将正确的版本信息附加到使用Cmake构建的RPM? 我一直面临着使用MPI(在我的情况下)为C ++项目生成RPM的问题,并在Rocky9(Virtual)机器上使用Cmake构建。由于RHEL8,MPI分布有望包含...

问题描述 投票:0回答:1
部分中包含一个额外的标识符,以标记其特定版本。

应该由RPM-MPI-HOKS软件包完成。但是,我找不到有关应如何实际运行的任何信息。我当前生成的rpms尝试安装时给我这个错误 Problem 1: conflicting requests - nothing provides libmpi.so.40()(64bit) needed by myrpm

预期的包裹具有

libmpi.so.40()(64bit)(openmpi-x86_64)的形式,但我的需要libmpi.so.40()(64bit)

。 我发现了一些面临相同问题的人的资源
Herey,
Here

Here
Here
,通常指向Fedora指南,指向

包装MPI

。 我尝试了很多事情,包括在.spec文件的许多斑点中使用宏观,我尝试将二进制重命名为末尾具有-MPI标记,或者将它们移至特定的MPI目录而没有成功。 通过制作特定文件的准则,我构建了一个非常简单的设置,其中实际代码是一个很小的Helloworld C ++代码。 使用cmakelists.txt: cmake_minimum_required(VERSION 3.0) project(HelloWorld) add_executable(HWorld main.cxx) set(CMAKE_INSTALL_PREFIX "/usr") find_package(MPI REQUIRED) include_directories(SYSTEM ${MPI_INCLUDE_PATH}) target_link_libraries(HWorld ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES}) install(TARGETS HWorld DESTINATION bin) 和一个非常通用的.spec文件: Name: HWorld Version: 1 Release: 1%{?dist} Summary: Test script with MPI License: Test Source0: https://www.example.com/%{name}/releases/%{name}-%{version}.tar.gz %define debug_package %{nil} BuildRequires: gcc BuildRequires: make %description %prep %setup -q %build %cmake %cmake_build %install %cmake_install %files %{_bindir}/%{name} %post %changelog * ... 这给我一个带有不良MPI的RPM需要标签:

$ rpmbuild -bb HWorld.spec $ rpm -qp --requires HWorld-1-1.el9.x86_64.rpm ... libmpi.so.40()(64bit)

通常最好从已经存在的事物中寻求灵感。
,例如,EPEL提供的

vtk

包装是通过
cmake
构建的,取决于MPI。

here是样本

CMakeLists.txt

cmake mpi rpmbuild rpm-spec
1个回答
0
投票

spec

文件(

openmpi
是硬编码,您通常想要构建一个适用于
spec

mpich

的文件
openmpi

这是
Name: helloworld Version: 1.0 Release: 1%{?dist} Summary: Test script with MPI License: Test Source0: https://www.example.com/%{name}/releases/helloworld-%{version}.tar.gz %define debug_package %{nil} BuildRequires: gcc BuildRequires: cmake %description %prep %setup -q %build %global \_vpath_builddir build-openmpi %\_openmpi_load %cmake %cmake \\ -DCMAKE_PREFIX_PATH:PATH=$MPI_HOME \\ -DCMAKE_INSTALL_PREFIX:PATH=$MPI_HOME %cmake_build %install %cmake_install %package openmpi BuildRequires: openmpi-devel Summary: binaries built with openmpi %description openmpi %files openmpi %{\_libdir}/openmpi/bin/%{name}

软件包的要求:

helloworld-openmpi
    

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.