[openib-general] SRPM for infiniband-support
Makia Minich
Mon Mar 29 08:39:33 PST 2004
I attempted to build the SRPM for the infiniband-support on RHEL3, but it
didn't work (it almost worked, but not quite). I noticed a few unnicities
(namely, it did a real install and then attempted to pull the files into an
RPM). So, this prompted a few edits on my part. I'm attaching the new SPEC
file that I edited. I'm not sure if anyone cares, but at least this makes me
feel useful.
--
(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))
Makia Minich The memories of a man in his old age,
are the deeds of a man in his Prime.
makia at llnl.gov -- Waters/Wright
(((((((((((((((((((((((((((((((((())))))))))))))))))))))))))))))))))
-------------- next part --------------
#
# specfile for package infiniband-support (version 2.0)
#
Name: infiniband-support
Group: System Environment/Kernel
Version: 2.0
Release: 1
Summary: Tools and libraries for InfiniBand
License: Dual BSD/GPL
Source0: infiniband-support-2004-02-26.tar.bz2
Buildroot: %{_tmppath}/%{name}-root
%description
Tools and libraries for using InfiniBand, including MPI and uDAPL.
%prep
%setup
ln -s /usr/src/linux third_party/linux_host_native_2_6
%build
make TS_TARGET_SYSTEMS=host_native_2_6
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}/%{_lib}
mkdir -p ${RPM_BUILD_ROOT}/%{_libdir}
mkdir -p ${RPM_BUILD_ROOT}/%{_bindir}
mkdir -p ${RPM_BUILD_ROOT}/%{_includedir}
mkdir -p ${RPM_BUILD_ROOT}/sbin
mkdir -p ${RPM_BUILD_ROOT}/%{_datadir}
mkdir -p ${RPM_BUILD_ROOT}/%{_sysconfdir}
BUILD_LIB=build/lib/host_native_2_6
BUILD_EXE=build/exe/host_native_2_6
BUILD_SCRIPTS=build/exe/scripts
install $BUILD_LIB/libsdp.so $RPM_BUILD_ROOT/%{_lib}
LIBRARIES="libdapl.so libdat.so libts_ib_cm_user.so libts_ib_cm_user.a"
for lib in $LIBRARIES; do
install $BUILD_LIB/$lib $RPM_BUILD_ROOT/%{_libdir}
done
MELLANOX_LIBRARIES="libvapi.so libmtl_common.so libmtgetopt.so libmosal.so libmpga.so libvapi.a libmtl_common.a libmtgetopt.a libmosal.a libmpga.a"
for lib in $MELLANOX_LIBRARIES; do
install $BUILD_EXE/tavor/lib/$lib $RPM_BUILD_ROOT/%{_libdir}
done
install -d $RPM_BUILD_ROOT/%{_includedir}/vapi
install -d $RPM_BUILD_ROOT/%{_includedir}/vapi/sys
MELLANOX_HEADERS="bit_ops.h mosal.h mpga.h mtl_types.h vapi_common.h evapi.h mtl_common.h packet_append.h vapi_features.h ib_defs.h mtl_errno.h packet_utilities.h vapi.h ib_opcodes.h mtl_log.h vapi_types.h sys/mtl_sys_defs.h sys/mtl_sys_types.h"
for mheader in $MELLANOX_HEADERS; do
install $BUILD_EXE/tavor/include/$mheader $RPM_BUILD_ROOT/%{_includedir}/vapi/
done
cp $BUILD_EXE/tavor/include/sys/* $RPM_BUILD_ROOT/%{_includedir}/vapi/sys/
install $BUILD_SCRIPTS/ipoib_arp $RPM_BUILD_ROOT/sbin
install $BUILD_EXE/tavor/bin/open_hcas $RPM_BUILD_ROOT/sbin
install $BUILD_EXE/tavor/bin/vping $BUILD_EXE/tavor/bin/vstat $RPM_BUILD_ROOT/%{_bindir}
install $BUILD_EXE/ipoibcfg.x $RPM_BUILD_ROOT/sbin/ipoibcfg
install $BUILD_EXE/sdp_ttcp.x $RPM_BUILD_ROOT/%{_bindir}/ttcp.sdp
install $BUILD_EXE/dapltest.x $RPM_BUILD_ROOT/%{_bindir}
install $BUILD_EXE/lat_client.x $BUILD_EXE/lat_server.x $BUILD_EXE/thru_client.x $BUILD_EXE/thru_server.x $RPM_BUILD_ROOT/%{_bindir}
install $BUILD_SCRIPTS/rescan-scsi-bus.sh $RPM_BUILD_ROOT/sbin
install -d $RPM_BUILD_ROOT/%{_includedir}/infiniband
install -m 0644 host/ulp/sdp/include/sdp_sock.h $RPM_BUILD_ROOT/%{_includedir}/infiniband
install -d $RPM_BUILD_ROOT/%{_includedir}/dat
UDAPL_HEADERS="dat_error.h dat.h dat_platform_specific.h dat_redirection.h dat_registry.h dat_vendor_specific.h kdat.h kdat_config.h kdat_redirection.h kdat_vendor_specific.h udat.h udat_config.h udat_redirection.h udat_vendor_specific.h"
for file in $UDAPL_HEADERS; do
install -m 0644 host/ulp/dapl/dapl3/dat/include/dat/$file $RPM_BUILD_ROOT/%{_includedir}/dat
done
udapl_example_dirs=`find host/ulp/dapl/bench -type d \( \( \( -name CVS -o -name obj_\* \) -prune \) -o -print \)`
for dir in $udapl_example_dirs; do
d=`echo $dir | sed s:host/ulp/dapl/bench::`
example_files=`find $dir -maxdepth 1 \( -name \*.c -o -name \*.h -o -name Makefile.orig \)`
if [ "$example_files" ]; then
install -d ${RPM_BUILD_ROOT}/%{_datadir}/infiniband/dapl/$d
for file in $example_files; do
f=`echo $file | sed -e s:Makefile\.orig:Makefile: -e s:host/ulp/dapl/bench::`
sed -e s:/lib:/%{_lib}:g <$file > ${RPM_BUILD_ROOT}/%{_datadir}/infiniband/dapl/$f
done
fi
done
# rewrite /lib/ to /%{_lib}/ so that we get lib64 on AMD64:
sed -e s:/lib/:/%{_lib}/: < host/ulp/dapl/dapl3/dat/dat.conf.suse > $RPM_BUILD_ROOT/%{_sysconfdir}/dat.conf
install -m 0644 $BUILD_SCRIPTS/libsdp.conf $RPM_BUILD_ROOT/%{_sysconfdir}
install -m 0644 $BUILD_SCRIPTS/modprobe.conf.infiniband $RPM_BUILD_ROOT/%{_sysconfdir}
install -d ${RPM_BUILD_ROOT}/%{_datadir}/infiniband/examples
install -m 0644 host/ulp/sdp/test/ttcp.c $RPM_BUILD_ROOT/%{_datadir}/infiniband/examples
# Scripts to setup dynamic device nodes
install $BUILD_SCRIPTS/create_udapl_devs $BUILD_SCRIPTS/create_useraccess_devs $BUILD_SCRIPTS/create_useraccess_cm_devs $BUILD_SCRIPTS/create_mosal_devs $BUILD_SCRIPTS/create_vipkl_devs $BUILD_SCRIPTS/create_ip2pr_devs $RPM_BUILD_ROOT/sbin
# This script fixes up IPoIB interfaces to setup arp_filter correctly
install $BUILD_SCRIPTS/update_ipoib_intfs $RPM_BUILD_ROOT/sbin
install $BUILD_SCRIPTS/ts_srp.init.suse $RPM_BUILD_ROOT/%{_sysconfdir}/ts_srp
# MPI directories
install -d $RPM_BUILD_ROOT/%{_includedir}/mpi/mpich/src
install -d $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich
install -d $RPM_BUILD_ROOT/%{_libdir}/mpi/mpich
install -d $RPM_BUILD_ROOT/usr/src/mpi/mpich/bin
# include directories for MPI
mpi_dirs="include"
for _dir in $mpi_dirs; do
mpi_dir=`find host/mpi/mpich/$_dir -type d \( \( \( -name CVS -o -name obj_\* \) -prune \) -o -print \)`
for sub_dir in $mpi_dir; do
d=`echo $sub_dir | sed s:host/mpi/mpich/$_dir::`
mpi_files=`find $sub_dir -maxdepth 1 -type f`
echo $mpi_files
if [ "$mpi_files" ]; then
install -d $RPM_BUILD_ROOT/%{_includedir}/mpi/mpich/$d
for file in $mpi_files; do
f=`echo $file | sed -e s:Makefile\.orig:Makefile: -e s:host/mpi/mpich/$_dir::`
install -m 0755 $file $RPM_BUILD_ROOT/%{_includedir}/mpi/mpich/$f
done
fi
done
done
# MPI Library's
install $BUILD_LIB/*mpi* $RPM_BUILD_ROOT/%{_libdir}/mpi/mpich
MPI_BIN_FILES="mpiman"
for file in $MPI_BIN_FILES; do
install -m 0755 host/mpi/mpich/bin/$file $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich
done
install $BUILD_EXE/mpirun_rsh.x $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich/mpirun_rsh
install $BUILD_EXE/mpirun_ssh.x $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich/mpirun_ssh
install $BUILD_EXE/mpi_bandwidth.x $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich/mpi_bandwidth
install $BUILD_EXE/mpi_latency.x $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich/mpi_latency
chmod 755 $RPM_BUILD_ROOT/%{_bindir}/mpi/mpich/*
# install MPI source
mpi_dirs="ccbugs doc include installtest man mpe MPI-2-C++ mpid romio src util www examples"
for _dir in $mpi_dirs; do
mpi_dir=`find host/mpi/mpich/$_dir -type d \( \( \( -name CVS -o -name obj_\* \) -prune \) -o -print \)`
for sub_dir in $mpi_dir; do
d=`echo $sub_dir | sed s:host/mpi/mpich/$_dir::`
tmp_files=`find $sub_dir -maxdepth 1 -type f`
mpi_files=`echo $tmp_files | grep -v "*.o"`
echo $mpi_files
if [ "$mpi_files" ]; then
install -d $RPM_BUILD_ROOT/usr/src/mpi/mpich/$_dir/$d
for file in $mpi_files; do
f=`echo $file | sed -e s:Makefile\.orig:Makefile: -e s:host/mpi/mpich/$_dir::`
install -m 0755 $file $RPM_BUILD_ROOT/usr/src//mpi/mpich/$_dir/$f
done
fi
done
done
#include files
mpi_files="attr.h mpidmpi.h mpifort.h mpiprof.h pmpi2mpi.h sendq.h binding.h mpi_errno.h mpi.h mpipt2pt.h protofix.h mpicoll.h mpi_error.h mpiimpl.h patchlevel.h ptrcvt.h mpidefs.h.in mpif.f90.in mpiops.h sbcnst.h"
for mfile in $mpi_files; do
cp host/mpi/mpich/include/$mfile $RPM_BUILD_ROOT/%{_includedir}/mpi/mpich/src
done
for mpi_files in $TS_DEVEL_ROOT/host/mpi/mpich/*; do
if [ -f $mpi_files ] ; then
cp $mpi_files $RPM_BUILD_ROOT/usr/src/mpi/mpich
fi
done
cp host/mpi/mpich/bin/tarch $RPM_BUILD_ROOT/usr/src/mpi/mpich/bin/
cp host/mpi/mpich/bin/tdevice $RPM_BUILD_ROOT/usr/src/mpi/mpich/bin/
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/Makefile
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/Makefile.libmpich
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/fortran/src/Makefile
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/MPI-2-C++/src/Makefile
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/MPI-2-C++/src/mpi2c++/Makefile
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/mpid/ch_vapi/process/Makefile
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/mpid/ch_vapi/Makefile
rm -f $RPM_BUILD_ROOT/usr/src/mpi/mpich/examples/Makefile
PERL_LOC=$(which perl)
WISH_LOC=$(which wish)
for fix_loc in $(egrep -r "(/usr/local/bin/perl5|/usr/local/tcl/bin/wish)" /tmp/infiniband-support-root/ | awk -F: '{print $1}') ; do
cp -a $fix_loc $fix_loc.tmp
sed -e "s!/usr/local/bin/perl5!${PERL_LOC}! ; s!/usr/local/tcl/bin/wish!${WISH_LOC}!" $fix_loc.tmp > $fix_loc
rm -f $fix_loc.tmp
done
%post
#strip out anything old
if [ -f /etc/modprobe.conf ] ; then
perl -ni -e 'print if not m/modprobe.conf.infiniband/' /etc/modprobe.conf
echo include modprobe.conf.infiniband >> /etc/modprobe.conf
else
echo "Please add the following to modules.conf:"
cat /etc/modprobe.conf.infiniband
fi
%preun
if [ -f /etc/modprobe.conf ] ; then
perl -ni -e 'print if not m/modprobe.conf.infiniband/' /etc/modprobe.conf
fi
if [ $1 = 0 ]; then
# Only delete these if this isn't an upgrade
rm -f /dev/udapl
rm -f /dev/vipkl_dev
rm -f /dev/mosal
for i in 0 1 2 3 4 5 6; do
rm -f /dev/ts_ua$i /dev/ts_ua_cm$i
done
fi
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/dat.conf
%config(noreplace) %{_sysconfdir}/libsdp.conf
/%{_lib}/libsdp.so
%{_libdir}/mpi
%{_libdir}/libdapl.so
%{_libdir}/libdat.so
%{_libdir}/libts_ib_cm_user.so
%{_libdir}/libts_ib_cm_user.a
%{_libdir}/libvapi.so
%{_libdir}/libmtl_common.so
%{_libdir}/libmtgetopt.so
%{_libdir}/libmosal.so
%{_libdir}/libmpga.so
%{_libdir}/libvapi.a
%{_libdir}/libmtl_common.a
%{_libdir}/libmtgetopt.a
%{_libdir}/libmosal.a
%{_libdir}/libmpga.a
%{_includedir}/vapi
%{_includedir}/infiniband
%{_includedir}/dat
%{_includedir}/mpi
%{_datadir}/infiniband
%{_bindir}/mpi
%{_bindir}/vping
%{_bindir}/vstat
%{_bindir}/ttcp.sdp
%{_bindir}/dapltest.x
%{_bindir}/lat_client.x
%{_bindir}/lat_server.x
%{_bindir}/thru_client.x
%{_bindir}/thru_server.x
/usr/src/mpi
/sbin/ipoib_arp
/sbin/open_hcas
/sbin/ipoibcfg
/sbin/rescan-scsi-bus.sh
/sbin/create_udapl_devs
/sbin/create_useraccess_devs
/sbin/create_useraccess_cm_devs
/sbin/create_mosal_devs
/sbin/create_vipkl_devs
/sbin/create_ip2pr_devs
/sbin/update_ipoib_intfs
%{_sysconfdir}/ts_srp
%{_sysconfdir}/modprobe.conf.infiniband
More information about the openib-general mailing list