Sophie

Sophie

distrib > Mandriva > 10.2 > x86_64 > by-pkgid > 50a54b299750e9c99674ac96af535576 > files > 2

mpich2-1.0.1-2mdk.src.rpm

%define	name	mpich2
%define	version 1.0.1
%define release	2mdk
%define	lib_name_orig	lib%{name}
%define	lib_major	1
%define	lib_name	%mklibname %{name} %{lib_major}
%define old_lib_name	%mklibname mpich %{lib_major}
%define	mpihome		%{_localstatedir}/mpi

Name: 		%{name}
Summary: 	MPICH2 is a portable implementation of MPI.
Version: 	%{version}
Release: 	%{release}
Source0: 	%{name}-%{version}.tar.bz2
Source1: 	rhosts.mpi
Source2:	test_mpi.c
URL: 		http://www-unix.mcs.anl.gov/mpi/mpich/
License:	BSD-style 
Group: 		Cluster/Message Passing
BuildRoot: 	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: 	rsh, xinetd, rsh-server, %{lib_name} = %{version}-%{release}
Conflicts:	mpich >= 1.2
PreReq:		rpm-helper
BuildRequires:	gcc >= 3.2, gcc-g77 >= 3.2

%description
MPICH is a freely available, portable implementation of MPI, the Standard 
for message-passing libraries.
MPICH-A Portable Implementation of MPI is a MPI Standard conforming library 
that was developed by the Argonne National Laboratory. It allows different 
processes across a network of workstations to communicate using specific 
message passing functions. It includes librairies, parallel debuging tools 
and docs.

This package provides the libraries that use the standard p4 device.

%package -n	%{name}-doc
Summary:	Documentation for developing programs that will use MPICH
Group:		Development/Other

%description -n %{name}-doc
MPICH is a freely available, portable implementation of MPI, the Standard 
for message-passing libraries.
MPICH-A Portable Implementation of MPI is a MPI Standard conforming library 
that was developed by the Argonne National Laboratory. It allows different 
processes across a network of workstations to communicate using specific 
message passing functions. It includes librairies, parallel debuging tools 
and docs.

This package provides the documentation needed to develop
applications using the MPICH libraries.

%package -n	%{lib_name}
Summary:	Shared Librairies for MPICH
Group:		Development/Other
Conflicts:	%{old_lib_name} >= 1.2
Provides:	%{lib_name}

%description  -n %{lib_name}
Shared Librairies for MPICH

%package -n	%{lib_name}-devel
Summary:	Headers for developing programs that will use MPICH
Group:		Development/Other
Requires:	%{name} = %{version}-%{release}, %{lib_name} = %{version}-%{release}
Conflicts:	%{old_lib_name}-devel >= 1.2
Provides:	%{lib_name}-devel

%description -n %{lib_name}-devel
MPICH is a freely available, portable implementation of MPI, the Standard 
for message-passing libraries.
MPICH-A Portable Implementation of MPI is a MPI Standard conforming library 
that was developed by the Argonne National Laboratory. It allows different 
processes across a network of workstations to communicate using specific 
message passing functions. It includes librairies, parallel debuging tools 
and docs.

This package provides the static libraries and header files needed to compile
applications using the MPICH libraries.

%package -n	mpi2cc
Summary:	The MPICH wrapper over the C compiler
Group:		Development/C
Conflicts:	mpicc >= 1.2
Requires:	gcc >= 3.2, %{lib_name}-devel = %{version}-%{release}

%description -n mpi2cc
MPICH is a freely available, portable implementation of MPI, the Standard 
for message-passing libraries.
MPICH-A Portable Implementation of MPI is a MPI Standard conforming library 
that was developed by the Argonne National Laboratory. It allows different 
processes across a network of workstations to communicate using specific 
message passing functions. It includes librairies, parallel debuging tools 
and docs.

This package provides the shell script mpicc, with headers, which allows to
compile C programs using the MPICH libraries.

%package -n	mpi2cxx
Summary:	The MPICH wrapper over the C++ compiler
Conflicts:	mpic++ >= 1.2
Group:		Development/C++
Requires:	gcc-c++ >= 3.2, %{lib_name}-devel = %{version}-%{release}

%description -n mpi2cxx
MPICH is a freely available, portable implementation of MPI, the Standard 
for message-passing libraries.
MPICH-A Portable Implementation of MPI is a MPI Standard conforming library 
that was developed by the Argonne National Laboratory. It allows different 
processes across a network of workstations to communicate using specific 
message passing functions. It includes librairies, parallel debuging tools 
and docs.

This package provides the shell script mpiCC, with headers, which allows to
compile C++ programs using the MPICH libraries.

%package -n	mpi2f77
Summary:	The MPICH wrapper over the Fortran 77 compiler
Group:		Development/Other
Conflicts:	mpif77 >= 1.2
Requires:	gcc-g77 >= 3.2, %{lib_name}-devel = %{version}-%{release}

%description -n mpi2f77
MPICH is a freely available, portable implementation of MPI, the Standard 
for message-passing libraries.
MPICH-A Portable Implementation of MPI is a MPI Standard conforming library 
that was developed by the Argonne National Laboratory. It allows different 
processes across a network of workstations to communicate using specific 
message passing functions. It includes librairies, parallel debuging tools 
and docs.

This package provides the shell script mpif77, with headers, which allows to
compile Fortran 77 (NOT Fortran 90!) programs using the MPICH libraries.


%prep
%setup -q

find -name .cvsignore | xargs rm -rf
find -name CVS -type d | xargs rm -rf

%pre
/usr/sbin/groupadd -g 12384 -r -f mpi > /dev/null 2>&1 ||:
/usr/sbin/useradd -u 12384 -g mpi -d %{mpihome} -r -s /bin/bash mpi -p "" -m > /dev/null 2>&1 ||:

%postun
%_postun_userdel mpi

%post
STATUS=$(cat /etc/xinetd.d/rsh  | grep disable | cut -d "=" -f 2)
if [ $STATUS == "yes" ]; then
echo "Warning !!"
echo "The rsh daemon is disabled in your xinetd config file(/etc/xinetd.d/rsh), please activate it."
fi
echo "Remember that you should create a .rhosts in your home directory."
echo "Look at .rhosts in the doc directory for a sample configuration"
echo "A mpi user has been created, change it's home directory to a network file system with the other nodes"

# automatically set mpi variable
TEST_MPI_ENV=`grep MPI /etc/bashrc`
if [ -z "$TEST_MPI_ENV" ] ; then
	echo "# MPI environement" >> /etc/bashrc
	echo "MPIRUN_HOME=/usr/bin" >> /etc/bashrc
	echo "export MPIRUN_HOME" >> /etc/bashrc
fi


%build
CFLAGS=$RPM_OPT_FLAGS; export CFLAGS;
[ -f configure.in ] && libtoolize --copy --force;

./configure --prefix=%{_prefix} \
        --exec-prefix=%{_exec_prefix} \
        --bindir=%{_bindir} \
	--sbindir=%{_sbindir} \
        --datadir=%{_datadir}/mpich/ \
        --includedir=%{_includedir} \
	--libdir=%{_libdir} \
        --sharedstatedir=%{_sharedstatedir} \
	--with-docdir=%{_datadir}/doc/%{name}-%{version} \
	--with-htmldir=%{_datadir}/doc/%{name}-%{version}/www \
        --mandir=%{_mandir} \
	--enable-cache \
	--with-mpe \
        --enable-cxx \
        --enable-f77 \
        --with-arch=LINUX \
        --enable-sharedlibs=gcc \
 	--enable-debuginfo \
	--disable-weak-symbols

#	--without-java

make


%install
rm -rf $RPM_BUILD_ROOT

export MPICH_INCLUDE_PROFLIB="yes"

#Changing libdir for compilators
for i in $(ls $RPM_BUILD_DIR/%{name}-%{version}/bin/mpi*); do
perl -pi -e "s|libdir=/usr/lib|libdir=$RPM_BUILD_ROOT/usr/lib|" $i
done

###Patching UseSharedLib for using libmpichfarg by default
##perl -pi -e 's|UseSharedLib\=\$\{MPICH_USE_SHLIB\-no\}|UseSharedLib\=yes|' $RPM_BUILD_DIR/%{name}-%{version}/bin/mpif77
##perl -pi -e 's|UseSharedLib\=\$\{MPICH_USE_SHLIB\-no\}|UseSharedLib\=yes|' $RPM_BUILD_DIR/%{name}-%{version}/src/fortran/src/mpif77


#Patching prefix for mpd
#perl -pi -e "s|exec_prefix \=.*|exec_prefix \=$RPM_BUILD_ROOT/usr/|" $RPM_BUILD_DIR/%{name}-%{version}/mpid/mpd/Makefile

# patch to get BuildROOT
perl -pi -e "s|^exec_prefix.*|exec_prefix =$RPM_BUILD_ROOT/usr|" $RPM_BUILD_DIR/%{name}-%{version}/Makefile
perl -pi -e "s|^libdir.*|libdir =$RPM_BUILD_ROOT/usr/lib|" $RPM_BUILD_DIR/%{name}-%{version}/Makefile
perl -pi -e "s|^docdir.*|docdir =$RPM_BUILD_ROOT/usr/share/doc/mpich2-1.0.1|" $RPM_BUILD_DIR/%{name}-%{version}/Makefile
perl -pi -e "s|^htmldir.*|htmldir =$RPM_BUILD_ROOT/usr/share/doc/mpich2-1.0.1/www|" $RPM_BUILD_DIR/%{name}-%{version}/Makefile
perl -pi -e "s|^mandir.*|mandir =$RPM_BUILD_ROOT/usr/share/man|" $RPM_BUILD_DIR/%{name}-%{version}/Makefile
perl -pi -e "s|^includedir.*|includedir =$RPM_BUILD_ROOT/usr/include|" $RPM_BUILD_DIR/%{name}-%{version}/Makefile

%makeinstall

#make install "PREFIX=$RPM_BUILD_ROOT%{_prefix} \
#	-sysconfpath=$RPM_BUILD_ROOT/%{_sysconfdir}/mpich/ \
#	-datapath=$RPM_BUILD_ROOT/%{_datadir}/mpich/ \
#	-shliblocal=$RPM_BUILD_ROOT/%{_libdir} \
#	-soft"


#Changing back libdir for compilators
for i in $(ls $RPM_BUILD_ROOT/usr/bin/mpi*); do
perl -pi -e "s|libdir=$RPM_BUILD_ROOT/usr/lib|libdir=/usr/lib|" $i
done

#Activiating PMPI patches
for i in $(ls $RPM_BUILD_DIR/%{name}-%{version}/bin/*); do
perl -pi -e 's|MPI_WITH_PMPI\=.*|MPI_WITH_PMPI\=\"yes\" \n
MPICH_INCLUDE_PROFLIB\=\"yes\" \n|' $i
done


for rep in $RPM_BUILD_ROOT/etc/mpich $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT/usr/examples
do
  for file in $rep/*
  do
	if [ -f "$file" ];
	then
		perl -pi -e 's|%buildroot||g' "$file"
	fi
  done
done

#for i in $(ls $RPM_BUILD_ROOT/usr/bin/*); do
#perl -pi -e 's|MPI_WITH_PMPI\=\"yes\".*|MPI_WITH_PMPI\=yes \n MPICH_INCLUDE_PROFLIB\=yes|' $i
#done

HOSTNAME=`hostname`
mkdir -p $RPM_BUILD_ROOT%{_datadir}/mpich
echo $HOSTNAME > $RPM_BUILD_ROOT%{_datadir}/mpich/machines.LINUX

mkdir -p $RPM_BUILD_ROOT%{_docdir}
mkdir -p $RPM_BUILD_ROOT/%{mpihome}

install -m644 %{SOURCE1} $RPM_BUILD_DIR/%{name}-%{version}/rhosts

find $RPM_BUILD_ROOT -name CVS -type d | xargs rm -rf

# A sample mpi program (hello world)
#$RPM_BUILD_DIR/%{name}-%{version}/bin/mpicc -I$RPM_BUILD_ROOT/usr/include -L$RPM_BUILD_ROOT/usr/lib %{SOURCE2} -o $RPM_BUILD_DIR/%{name}-%{version}/test_mpi.%{name}

#cd $RPM_BUILD_ROOT/%{_libdir}
#rm libpmpich.so*
#ln -sf libmpich.so.1.0 libmpich.so
#ln -sf libfmpich.so.1.0 libfmpich.so

#Cleaning uncessary files 
rm -f  $RPM_BUILD_ROOT%{_mandir}/mandesc*
rm -rf $RPM_BUILD_ROOT%{_libdir}/shared
rm -rf $RPM_BUILD_ROOT%{_datadir}/examples
rm -rf $RPM_BUILD_ROOT%{_datadir}/upshot
#rm -rf $RPM_BUILD_ROOT%{_docdir}

mv $RPM_BUILD_ROOT%{_prefix}/examples/cpi $RPM_BUILD_ROOT%{_bindir}

%clean
rm -rf $RPM_BUILD_ROOT

%postun -n %{lib_name}
/sbin/ldconfig

%post -n %{lib_name}
/sbin/ldconfig

%files
%defattr(-,root,root,755)
%doc COPYRIGHT 
#%doc test_mpi.mpich
%doc rhosts
#%{_sbindir}/*
%{_bindir}/mpd*
%{_bindir}/mpi*
%{_bindir}/cpi
%{_bindir}/test*
%config(noreplace) %{_datadir}/mpich/*
%{_mandir}/man1/MPI.1*

%files -n %{lib_name}
%defattr(-,root,root,755)
%{_libdir}/*.so

%files -n mpich2-doc
%defattr(644,root,root,755)
%doc doc/* examples www  

%files -n %{lib_name}-devel
%defattr(-,root,root)
%doc COPYRIGHT
%{_mandir}/man3/*.3*
%{_includedir}/*.h
%{_libdir}/*.a

%files -n mpi2cc
%defattr(-,root,root,755)
%doc COPYRIGHT
%{_bindir}/mpicc
%config(noreplace) %{_sysconfdir}/mpicc.conf
%{_mandir}/man1/mpicc.1*

%files -n mpi2cxx
%defattr(-,root,root,755)
%doc COPYRIGHT
%{_bindir}/mpicxx
%config(noreplace) %{_sysconfdir}/mpicxx.conf
%{_mandir}/man1/mpicxx.1*

%files -n mpi2f77
%defattr(-,root,root,755)
%doc COPYRIGHT
%{_bindir}/mpif77
%config(noreplace) %{_sysconfdir}//mpif77.conf
%{_mandir}/man1/mpif77.1*
#%{_bindir}/mpif90
#%{_mandir}/man1/mpif90.1*

%changelog
* Mon Mar 21 2005 Antoine Ginies <aginies@n1.mandrakesoft.com> 1.0.1-2mdk
- add conflict with mpich-1.2.X
- rename mpic++ to mpi2cxx

* Fri Mar 18 2005 Antoine Ginies <aginies@n1.mandrakesoft.com> 1.0.1-1mdk
- release mpich2 1.0.1

* Fri Jul 27 2004 Erwan Velu <erwan@mandrakesoft.com> 1.2.5.2-5mdk
- Rebuild

* Fri Jun 25 2004 Erwan Velu <erwan@mandrakesoft.com> 1.2.5.2-4mdk
- Disabling java in jumpshot

* Tue Jun 15 2004 Erwan Velu <erwan@mandrakesoft.com> 1.2.5.2-3mdk
- Fixing requires

* Fri Jun 11 2004 Erwan Velu <erwan@mandrakesoft.com> 1.2.5.2-2mdk
- Fixing path for buildroot path removing
- Using a new test program
- Requires libmpich1 on mpich
* Sun Jan 04 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 1.2.5.2-1mdk
- 1.2.5.2
- cosmetics
- don't rm -rf $RPM_BUILD_ROOT at the beginning of %%prep
- no .bz2 ending for man pages in file list
- fix typo in Fortran interface for MPI_Wtime (P4)
- Fix to the MPI-IO Fortran interface (P5)
- work around rsh test that might stall (P6)
- fix unpackaged files
- fix permissions for docs

* Tue Jan 21 2003  <erwan@no.mandrakesoft.com> 1.2.5-1mdk
- New version

* Thu Jan 16 2003 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-31mdk
- fixing missed wrong requires for gcc

* Thu Jan 16 2003 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-30mdk
- Rebuild for new Glibc
- Changing gcc requires

* Thu Dec 05 2002 Clic-dev <clic-dev-public@mandrakesoft.com> 1.2.4-29mdk
- Fixing wrong source format (thx to Götz Waschk)

* Thu Nov 21 2002 Clic-dev <clic-dev-public@mandrakesoft.com> 1.2.4-28mdk
- Adding missing files
- Changing default documentation paths

* Wed Nov 20 2002 Clic-dev <clic-dev-public@mandrakesoft.com> 1.2.4-27mdk
- Removing lam conflict

* Thu Oct 10 2002 Clic-dev <clic-dev-public@mandrakesoft.com> 1.2.4-26mdk
- Fixing f77 compilation problem (libmpichfarg)

* Thu Oct 10 2002 Clic-dev <clic-dev-public@mandrakesoft.com> 1.2.4-25mdk
- Switching back to ch_p4 because ch_p4mpd doesn't support SMP nodes
- Switching back traceback 

* Wed Oct 09 2002 Clic-dev <clic-dev-public@mandrakesoft.com> 1.2.4-24mdk
- Applying official cumulative patch (7073, 7090, 7096, 7201, 7187, 7265, 7276)

* Tue Oct 08 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-23mdk
- Enable traceback option
- Switching from ch_p4 to ch_p4mpd
- Fixing (again) libpmpich problems

* Mon Aug 26 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-22mdk
- Re-adding mpi user
- Applying officials mpich patches
- Fixing buildrequires
- Enable debug for TotalView
- Separting mpi and pmpi libs
- Using -soft tag (avoid install mpich to build mpich)

* Thu Aug 08 2002 Antoine Ginies <aginies@mandrakesoft.com> 1.2.4-21mdk
- correct requires (thx Goetz Waschk)
- remove mpi user

* Tue Aug 06 2002 Antoine Ginies <aginies@mandrakesoft.com> 1.2.4-20mdk
- build with gcc 3.2

* Wed Jul 10 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-19mdk
- Changing exports from /etc/profile to /etc/bashc

* Tue Jul 09 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-18mdk
- Changing gcc requires to 2.96

* Tue Jul 09 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-17mdk
- Fixing MPICH_INCLUDE_PROFLIB problem in mpicc,mpiCC,mpicxx, mpif90 and mpif77

* Sat Jul 06 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-16mdk
- Suse merge
- Removing libpmpi.so.*
- Spliting libs in sub packages

* Sat Jul 06 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-15mdk
- Adding pmpi lib !

* Sat Jul 06 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-14mdk
- Fixing specfile for building & installing lib*.so

* Thu Jul 04 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-13mdk
- Removing bashrc & bash profile
- Moving testmpi.mpich in docdir

* Tue Jun 25 2002 Antoine Ginies <aginies@mandrakesoft.com> 1.2.4-12mdk
- adjust environement variable in /etc/profile

* Mon Jun 17 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-11mdk
- Adding noreplace on configuration files
- Removing building hostname on machines.LINUX

* Thu Jun 06 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-10mdk
- Setting mpi user id
* Wed Jun 05 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-9mdk
- Fixing typo in .bashrc of mpi user

* Tue Jun 04 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-8mdk
- Fixing wrong perm on sample script
- Using another sample script program

* Tue Jun 04 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-7mdk
- Removing gcc require on main mpich package
- Removing virtual Mpi provide

* Mon Jun 03 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-6mdk
- Fixing stupid friday mistake

* Fri May 31 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-5mdk
- Adding hello world sample mpi test program
- Adding ch_p4 option 

* Thu May 30 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-4mdk
- Adding /usr/adm for serv_p4 process
- Adding MPIRUN_HOME in default environment of mpi user

* Tue May 28 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-3mdk
- Adding more conflicts with lam

* Fri May 24 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-2mdk
- Provides virtual Mpi
- Fixing spec file

* Wed May 22 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.4-1mdk
- New release
- Bug-fix and improved-SMP performance release
- Other new features include better support for Intel compilers, particularly for IA64 Linux,
better support for various Fortran compilers, and some fixes for rare race conditions in the ch_p4 device.

* Wed May 22 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.2.2-7mdk
- Fixing home dir for MPI user
- Gcc 3.1 build

* Tue Apr 23 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.2.2-6mdk
- Fixing stupid places of man pages
- Fixing forgoten dependencies
- Adding rhosts example and warnings
- Adding MPI user

* Fri Apr 12 2002 Erwan Velu <erwan@mandrakesoft.com> 1.2.2.2-5mdk
- Fixing stupid things

* Fri Nov 23 2001 Ludovic Francois <lfrancois@mandrakesoft.com> 1.2.2.2-4mdk
- Removed unresolved dependencies

* Mon Nov 19 2001 Ludovic Francois <lfrancois@mandrakesoft.com> 1.2.2.2-3mdk
- Added sub packages mpich-doc mpicc mpic++ mpif77

* Tue Oct 25 2001 Ludovic Francois <lfrancois@mandrakesoft.com> 1.2.2.2-2mdk
- Rebuild for rpmlint

* Fri Oct 12 2001 Ludovic Francois <lfrancois@mandrakesoft.com> 1.2.2.2-1mdk
- Mpich package build for the first time.

# end of file