openmpi.spec

来自「MPI stands for the Message Passing Inter」· SPEC 代码 · 共 753 行 · 第 1/2 页

SPEC
753
字号
## Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana#                         University Research and Technology#                         Corporation.  All rights reserved.# Copyright (c) 2004-2005 The University of Tennessee and The University#                         of Tennessee Research Foundation.  All rights#                         reserved.# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, #                         University of Stuttgart.  All rights reserved.# Copyright (c) 2004-2005 The Regents of the University of California.#                         All rights reserved.# Copyright (c) 2006-2007 Cisco Systems, Inc.  All rights reserved.# $COPYRIGHT$# # Additional copyrights may follow# # $HEADER$############################################################################### Copyright (c) 2003, The Regents of the University of California, through# Lawrence Berkeley National Laboratory (subject to receipt of any# required approvals from the U.S. Dept. of Energy).  All rights reserved.## Initially written by:#       Greg Kurtzer, <gmkurtzer@lbl.gov>############################################################################################################################################################ Configuration Options## Options that can be passed in via rpmbuild's --define option.  Note# that --define takes *1* argument: a multi-token string where the first# token is the name of the variable to define, and all remaining tokens# are the value.  For example:## shell$ rpmbuild ... --define 'ofed 1' ...## Or (a multi-token example):## shell$ rpmbuild ... \#    --define 'configure_options CFLAGS=-g --with-openib=/usr/local/ofed' ...############################################################################### Help for OSCAR RPMs%{!?oscar: %define oscar 0}# Help for OFED RPMs%{!?ofed: %define ofed 0}# Define this if you want to make this SRPM build in /opt/NAME/VERSION-RELEASE# instead of the default /usr/# type: bool (0/1)%{!?install_in_opt: %define install_in_opt 0}# Define this if you want this RPM to install environment setup# shell scripts.# type: bool (0/1)%{!?install_shell_scripts: %define install_shell_scripts 0}# type: string (root path to install shell scripts)%{!?shell_scripts_path: %define shell_scripts_path %{_bindir}}# type: string (base name of the shell scripts)%{!?shell_scripts_basename: %define shell_scripts_basename mpivars-%{version}}# Define this to 1 if you want this RPM to install a modulefile.# type: bool (0/1)%{!?install_modulefile: %define install_modulefile 0}# type: string (root path to install modulefiles)%{!?modulefile_path: %define modulefile_path /etc/modulefiles}# type: string (subdir to install modulefile)%{!?modulefile_subdir: %define modulefile_subdir %{name}}# type: string (name of modulefile)%{!?modulefile_name: %define modulefile_name %{version}}# The name of the modules RPM.  Can vary from system to system.# type: string (name of modules RPM)%{!?modules_rpm_name: %define modules_rpm_name modules}# Should we use the mpi-selector functionality?# type: bool (0/1)%{!?use_mpi_selector: %define use_mpi_selector 0}# The name of the mpi-selector RPM.  Can vary from system to system.# type: string (name of mpi-selector RPM)%{!?mpi_selector_rpm_name: %define mpi_selector_rpm_name mpi-selector}# The location of the mpi-selector executable (can be a relative path# name if "mpi-selector" can be found in the path)# type: string (path to mpi-selector exectuable)%{!?mpi_selector: %define mpi_selector mpi-selector}# Should we build a debuginfo RPM or not?# type: bool (0/1)%{!?build_debuginfo_rpm: %define build_debuginfo_rpm 0}# Should we build an all-in-one RPM, or several sub-package RPMs?# type: bool (0/1)%{!?build_all_in_one_rpm: %define build_all_in_one_rpm 1}# Should we leave the BUILD_ROOT around?  Default: no# type: bool (0/1)%{!?leave_build_root: %define leave_build_root 0}# Should we use the default "check_files" RPM step (i.e., check for# unpackaged files)?  It is discouraged to disable this, but some# installers need it (e.g., OFED, because it installs lots of other# stuff in the BUILD_ROOT before Open MPI).# type: bool (0/1)%{!?use_check_files: %define use_check_files 1}# Should we use the traditional % build and % install sections?  Or# should we combine them both into % install?  This is entirely# motivated by the OFED installer where, on SLES, the % build macro# will completely remove the BUILD_ROOT before building (which breaks# some assumptions in the OFED installer).  Ick!# type: bool (0/1)%{!?munge_build_into_install: %define munge_build_into_install 0}# By default, RPM supplies a bunch of optimization flags, some of# which may not work with non-gcc compilers.  We attempt to weed some# of these out (below), but sometimes it's better to just ignore them# altogether (e.g., PGI 6.2 will warn about unknown compiler flags,# but PGI 7.0 will error -- and RPM_OPT_FLAGS contains a lot of flags# that PGI 7.0 does not understand).  The default is to use the flags,# but you can set this variable to 0, indicating that RPM_OPT_FLAGS# should be erased (in which case you probabl want to supply your own# optimization flags!).# type: bool (0/1)%{!?use_default_rpm_opt_flags: %define use_default_rpm_opt_flags 1}############################################################################### OSCAR-specific defaults##############################################################################%if %{oscar}%define install_in_opt 1%define install_modulefile 1%define modulefile_path /opt/modules/modulefiles%define modulefile_subdir openmpi%define modulefile_name %{name}-%{version}%define modules_rpm_name modules-oscar%endif############################################################################### OFED-specific defaults## Tailored for the peculiar requirements of the OFED installer; not# necessary for when building this SRPM outside of the OFED installer.##############################################################################%if %{ofed}%define leave_build_root 1%define use_check_files 0%define install_shell_scripts 1%define shell_scripts_basename mpivars%define munge_build_into_install 1%define use_mpi_selector 1%endif############################################################################### Configuration Logic##############################################################################%if %{install_in_opt}%define _prefix /opt/%{name}/%{version}%define _sysconfdir /opt/%{name}/%{version}/etc%define _libdir /opt/%{name}/%{version}/lib%define _includedir /opt/%{name}/%{version}/include%define _mandir /opt/%{name}/%{version}/man%define _pkgdatadir /opt/%{name}/%{version}/share/%{name}%endif%if !%{build_debuginfo_rpm}%define debug_package %{nil}%endif%if %(test "%{_prefix}" = "/usr" && echo 1 || echo 0)%global _sysconfdir /etc%else%global _sysconfdir %{_prefix}/etc%endif%{!?_pkgdatadir: %define _pkgdatadir %{_datadir}/%{name}}%if !%{use_check_files}%define __check_files %{nil}%endif%{!?configure_options: %define configure_options %{nil}}%if !%{use_default_rpm_opt_flags}%define optflags ""%endif############################################################################### Preamble Section##############################################################################Summary: A powerful implementaion of MPIName: %{?_name:%{_name}}%{!?_name:openmpi}Version: $VERSIONRelease: 1License: BSDGroup: Development/LibrariesSource: openmpi-%{version}.tar.$EXTENSIONPackager: %{?_packager:%{_packager}}%{!?_packager:%{_vendor}}Vendor: %{?_vendorinfo:%{_vendorinfo}}%{!?_vendorinfo:%{_vendor}}Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}Prefix: %{_prefix}Provides: mpiBuildRoot: /var/tmp/%{name}-%{version}-%{release}-root%if %{install_modulefile}Requires: %{modules_rpm_name}%endif%if %{use_mpi_selector}Requires: %{mpi_selector_rpm_name}%endif%descriptionOpen MPI is a project combining technologies and resources fromseveral other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) inorder to build the best MPI library available.This RPM contains all the tools necessary to compile, link, and runOpen MPI jobs.%if !%{build_all_in_one_rpm}############################################################################### Preamble Section (runtime)##############################################################################%package runtimeSummary: Tools and plugin modules for running Open MPI jobsGroup: Development/LibrariesProvides: mpi%if %{install_modulefile}Requires: %{modules_rpm_name}%endif%description runtimeOpen MPI is a project combining technologies and resources from several otherprojects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the bestMPI library available.This subpackage provides general tools (mpirun, mpiexec, etc.) and theModule Component Architecture (MCA) base and plugins necessary forrunning Open MPI jobs.%endif############################################################################### Preamble Section (devel)##############################################################################%package develSummary: Development tools and header files for Open MPIGroup: Development/LibrariesRequires: openmpi-runtime%description develOpen MPI is a project combining technologies and resources fromseveral other projects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) inorder to build the best MPI library available.This subpackage provides the development files for Open MPI, such aswrapper compilers and header files for MPI development.############################################################################### Preamble Section (docs)##############################################################################%package docsSummary: Documentation for Open MPIGroup: Development/DocumentationRequires: openmpi-runtime%description docsOpen MPI is a project combining technologies and resources from several otherprojects (FT-MPI, LA-MPI, LAM/MPI, and PACX-MPI) in order to build the bestMPI library available.This subpackage provides the documentation for Open MPI.############################################################################### Prepatory Section##############################################################################%prep# Unbelievably, some versions of RPM do not first delete the previous# installation root (e.g., it may have been left over from a prior# failed build).  This can lead to Badness later if there's files in# there that are not meant to be packaged.  HOWEVER: in some cases, we# do not want to delete the prior RPM_BUILD_ROOT because there may be# other stuff in there that we need (e.g., the OFED installer installs# everything into RPM_BUILD_ROOT that OMPI needs to compile, like the# OpenFabrics drivers).%if !%{leave_build_root}rm -rf $RPM_BUILD_ROOT%endif%setup -q -n openmpi-%{version}############################################################################### Build Section############################################################################### See note above about %{munge_build_into_install}%if %{munge_build_into_install}%install%else%build%endif# rpmbuild processes seem to be geared towards the GNU compilers --# they pass in some flags that will only work with gcc.  So if we're# trying to build with some other compiler, the process will choke.# This is *not* something the user can override with a well-placed# --define on the rpmbuild command line, unless they find and override# all "global" CFLAGS kinds of RPM macros (every distro names them# differently).  For example, non-gcc compilers cannot use# FORTIFY_SOURCE (at least, not as of 6 Oct 2006).  We can really only# examine the basename of the compiler, so search for it in a few# places.using_gcc=1if test "$CC" != ""; then    # Do horrible things to get the basename of just the compiler,    # particularly in the case of multword values for $CC    eval "set $CC"    if test "`basename $1`" != "gcc"; then        using_gcc=0    fifiif test "$using_gcc" = "1"; then    # Do wretched things to find a CC=* token    eval "set -- %{configure_options}"    compiler=    while test "$1" != "" -a "$compiler" = ""; do         case "$1" in         CC=*)                 compiler=`echo $1 | cut -d= -f2-`                 ;;         esac         shift    done    # Now that we *might* have the compiler name, do a best-faith    # effort to see if it's gcc.  Blah!    if test "$compiler" != ""; then        if test "`basename $compiler`" != "gcc"; then            using_gcc=0        fi

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?