1
1

Add yet another define option for the spec file:

use_default_rpm_opt_flags.  It defaults to a value of 1, meaning that
we'll try to use $RPM_OPT_FLAGS.  But if you're not compiling with the
GNU compilers, you might want to set this value to 0 so that your
compiler doesn't get flags that it doesn't understand (e.g., PGI 7.0
will barf on flags that it doesn't understand).

This commit was SVN r14477.
Этот коммит содержится в:
Jeff Squyres 2007-04-23 19:00:29 +00:00
родитель 1682a72d34
Коммит 08041a54c5
2 изменённых файлов: 46 добавлений и 77 удалений

79
contrib/dist/linux/README поставляемый
Просмотреть файл

@ -34,76 +34,9 @@ The prefix, target architecture, and choice of RPM(s) to build are all
currently hard-coded in the beginning of the buildrpm.sh script. currently hard-coded in the beginning of the buildrpm.sh script.
Alternatively, you can build directly from the openmpi.spec spec file Alternatively, you can build directly from the openmpi.spec spec file
or SRPM directly. The following options are permissable on the or SRPM directly. Many options can be passed to the building process
"rpmbuild" command line via the --define option: via rpmbuild's --define option (there are older versions of rpmbuild
that do not seem to handle --define'd values properly in all cases,
- lanl: 0 or 1 (default: 0) but we generally don't care about those old versions of rpmbuild...).
A shortcut for several Los Alamos-specific options (see specfile for The available options are described in the comments in the beginning
current list of values -- look for "%if %{lanl}"). of the spec file in this directory.
- install_in_opt: 0 or 1 (default: 0)
If 1, use a prefix of /opt/openmpi/<version>-<release>.
- install_profile_d_scripts: 0 or 1 (default: 0)
If 1, and install_in_opt is 1, then install the /etc/profile.d
scripts.
- install_modulefile: 0 or 1 (default: 0)
If 1 and if install_in_opt is 1, then install a modulefile in
%{modulefile_path}/%{modulefile_subdir}/%{modulefile_name}
- modulefile_path: string (default: "/etc/modulefiles")
Defaults to /etc/modulefiles
- modulefile_subdir: string (default: "openmpi")
Defaults to openmpi
- modulefile_name: string (default: "%{version}")
Defaults to %{version}
- modules_rpm_name: string ("modules")
Name of the environment modules RPM to "require".
- build_debuginfo_rpm: 0 or 1 (default: 0)
If 1, builds a corresponding debuginfo rpm.
- _prefix (etc.): string (default: supplied by rpmbuild)
Prefix directory (all other standard names are also supported, such
as _libdir, _sysconfdir, _includedir, etc.).
- configure_options: string (default: "")
String to pass directly to the ./configure script.
- _packager: string (default: supplied by rpmbuild)
Name of the packager
- _vendor: string (default: supplied by rpmbuild)
Name of the vendor
- cflags: string (default: supplied by rpmbuild: $RPM_OPT_FLAGS)
CFLAGS value to use
- cxxflags: string (default: supplied by rpmbuild: $RPM_OPT_FLAGS)
CXXFLAGS value to use
- f77flags: string (default: supplied by rpmbuild: $RPM_OPT_FLAGS)
F77FLAGS value to use
- fcflags: string (default: supplied by rpmbuild: $RPM_OPT_FLAGS)
F90FLAGS value to use
- mflags: string (default: "")
Flags to pass to the "make" [default] target during %build
- mflags_install: string (default: "")
Flags to pass to the "make install" target during %install
- build_all_in_one_rpm: 0 or 1 (default: 1)
If 1 (the default), make a single RPM that contains all of the Open
MPI software. If 0, build multiple sub-package RPMs to split up the
Open MPI code into separate functional areas. See the spec file for
the exact division and subpackage definitions.
- name: string (default "openmpi")
If set, used as the name of the RPM (useful if you want to add a
compiler name -- or some other qualifier -- to the RPM name).

44
contrib/dist/linux/openmpi.spec поставляемый
Просмотреть файл

@ -32,6 +32,18 @@
# #
# Configuration Options # 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 # Help for OSCAR RPMs
@ -108,6 +120,18 @@
# type: bool (0/1) # type: bool (0/1)
%{!?munge_build_into_install: %define munge_build_into_install 0} %{!?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 # OSCAR-specific defaults
@ -176,6 +200,9 @@
%{!?configure_options: %define configure_options %{nil}} %{!?configure_options: %define configure_options %{nil}}
%if !%{use_default_rpm_opt_flags}
%define optflags ""
%endif
############################################################################# #############################################################################
# #
@ -315,7 +342,9 @@ rm -rf $RPM_BUILD_ROOT
# --define on the rpmbuild command line, unless they find and override # --define on the rpmbuild command line, unless they find and override
# all "global" CFLAGS kinds of RPM macros (every distro names them # all "global" CFLAGS kinds of RPM macros (every distro names them
# differently). For example, non-gcc compilers cannot use # differently). For example, non-gcc compilers cannot use
# FORTIFY_SOURCE (at least, not as of 6 Oct 2006). # 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=1 using_gcc=1
if test "$CC" != ""; then if test "$CC" != ""; then
@ -349,10 +378,16 @@ if test "$using_gcc" = "1"; then
fi fi
fi fi
# If we're not using the default RPM_OPT_FLAGS, then wipe them clean
# (the "optflags" macro has already been wiped clean, above).
%if !%{use_default_rpm_opt_flags}
RPM_OPT_FLAGS=
export RPM_OPT_FLAGS
%endif
# If we're not GCC, strip out any GCC-specific arguments in the # If we're not GCC, strip out any GCC-specific arguments in the
# RPM_OPT_FLAGS before potentially propagating them everywhere. We # RPM_OPT_FLAGS before potentially propagating them everywhere.
# can really only examine the basename of the compiler, so search for
# it in a few places.
if test "$using_gcc" = 0; then if test "$using_gcc" = 0; then
@ -371,6 +406,7 @@ CXXFLAGS="%{?cxxflags:%{cxxflags}}%{!?cxxflags:$RPM_OPT_FLAGS}"
FFLAGS="%{?f77flags:%{f77flags}}%{!?f7flags:$RPM_OPT_FLAGS}" FFLAGS="%{?f77flags:%{f77flags}}%{!?f7flags:$RPM_OPT_FLAGS}"
FCFLAGS="%{?fcflags:%{fcflags}}%{!?fcflags:$RPM_OPT_FLAGS}" FCFLAGS="%{?fcflags:%{fcflags}}%{!?fcflags:$RPM_OPT_FLAGS}"
export CFLAGS CXXFLAGS F77FLAGS FCFLAGS export CFLAGS CXXFLAGS F77FLAGS FCFLAGS
echo ================================ DONE DONE DONE
%configure %{configure_options} %configure %{configure_options}
%{__make} %{?mflags} %{__make} %{?mflags}