# Copyright (c) 2014 Dave Love, University of Liverpool # Licence as for the package itself # Called sprng2 in expectation of incompatible version4 %if 0%{?el6} %global mpich mpich2 %global mpich_load %_mpich2_load %global mpich_unload %_mpich2_unload %else %global mpich mpich %global mpich_load %_mpich_load %global mpich_unload %_mpich_unload %endif Name: libsprng2 Version: 2.0b Release: 2%{?dist} Summary: The Scalable Parallel Random Number Generators Library # fixme: no direct copyright statement, but is in Debian # License: other URL: http://www.sprng.org//Version2.0/ Source: http://www.sprng.org/Version2.0/sprng%version.tar.gz Patch1: libsprng-gmp.patch Patch2: libsprng-memcpy.patch Patch3: sprng-debian.patch BuildRequires: gcc-gfortran openmpi-devel %mpich-devel gmp-devel %global desc \ Computational stochastic approaches (Monte Carlo methods) based on the random\ sampling are becoming extremely important research tools not only in their\ "traditional" fields such as physics, chemistry or applied mathematics but also\ in social sciences and, recently, in various branches of industry. An indication\ of importance is, for example, the fact that Monte Carlo calculations consume\ about one half of the supercomputer cycles. One of the indispensable and\ important ingredients for reliable and statistically sound calculations is the\ source of pseudo random numbers. The goal of our project is to develop,\ implement and test a scalable package for parallel pseudo random number\ generation. %description %desc This is the serial version. %package openmpi Summary: The Scalable Parallel Random Number Generators Library - openmpi version Requires: openmpi %description openmpi %desc This is the openmpi version. %package %mpich Summary: The Scalable Parallel Random Number Generators Library - %mpich version Requires: %mpich %description %mpich %desc This is the %mpich version. %package devel Summary: Development library and headers for %name Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and header files for developing applications that use %{name}. %package openmpi-devel Summary: Development library and headers for %name-openmpi Requires: %{name}-openmpi = %{version}-%{release}, openmpi-devel %description openmpi-devel The %{name}-openmpi-devel package contains libraries and header files for developing applications that use %{name}-openmpi. %package %mpich-devel Summary: Development library and headers for %name-%mpich Requires: %{name} = %{version}-%{release}, %mpich-devel %description %mpich-devel The %{name}-%mpich-devel package contains libraries and header files for developing applications that use %{name}-%mpich. %package examples Summary: Example source codes for SPRNG BuildArch: noarch %description examples Computational stochastic approaches (Monte Carlo methods) based on the random sampling are becoming extremely important research tools not only in their "traditional" fields such as physics, chemistry or applied mathematics but also in social sciences and, recently, in various branches of industry. An indication of importance is, for example, the fact that Monte Carlo calculations consume about one half of the supercomputer cycles. One of the indispensable and important ingredients for reliable and statistically sound calculations is the source of pseudo random numbers. The goal of our project is to develop, implement and test a scalable package for parallel pseudo random number generation. This package contains example source codes for SPRNG. %prep %setup -q -n sprng2.0 %patch1 -p1 -b .gmp %patch2 -p1 -b .memcpy %patch3 -p1 -b .debian # incompatible with installed version rm SRC/pmlcg/gmp.h rm include/d~ # rogue binary rm EXAMPLES/sprngD chmod 0644 DOCS/README DOCS/new_sprng.ps gzip DOCS/new_sprng.ps %build # not -j-clean make src F77=gfortran PLAT=GENERIC FFLAGS='$(CFLAGS)' \ %if %__isa_bits == 64 CFLAGS="$RPM_OPT_FLAGS -fPIC -DUSE_PMLCG -DPOINTER_SIZE=8 -D_LONG_LONG" %else CFLAGS="$RPM_OPT_FLAGS -fPIC -DUSE_PMLCG" %endif for d in openmpi %mpich; do mkdir -p $d/lib cp -a SRC EXAMPLES include make.CHOICES Makefile $d done %global dobuild \ make \\\ %if %__isa_bits == 64 \ compilerflags='-DPOINTER_SIZE=8 -D_LONG_LONG' \\\ %endif \ PLAT=GENERIC F77=mpif90 CC=mpicc src %_openmpi_load pushd openmpi %dobuild popd %_openmpi_unload %mpich_load pushd %mpich %dobuild popd %mpich_unload %install mkdir -p $RPM_BUILD_ROOT%_includedir/sprng2 $RPM_BUILD_ROOT%_libdir install -m 755 lib/libsprng.so.2.0 $RPM_BUILD_ROOT%_libdir ln -s libsprng.so.2.0 $RPM_BUILD_ROOT%_libdir/libsprng.so install -m 644 include/* $RPM_BUILD_ROOT%_includedir/sprng2 %global doinst \ mkdir -p $RPM_BUILD_ROOT$MPI_INCLUDE/sprng2 $RPM_BUILD_ROOT$MPI_LIB\ install -m 755 lib/libsprng.so.2.0 $RPM_BUILD_ROOT$MPI_LIB\ ln -s libsprng.so.2.0 $RPM_BUILD_ROOT$MPI_LIB/libsprng2.so\ install -m 644 include/* $RPM_BUILD_ROOT$MPI_INCLUDE/sprng2 %_openmpi_load pushd openmpi %doinst popd %_openmpi_unload %mpich_load pushd %mpich %doinst popd %mpich_unload mkdir -p $RPM_BUILD_ROOT%_datadir/libsprng2 cp -r EXAMPLES $RPM_BUILD_ROOT%_datadir/libsprng2/examples %check ./checksprng %ldconfig_scriptlets openmpi %ldconfig_scriptlets mpich %files %doc DOCS/README %_libdir/libsprng.so.2* %files devel %_includedir/* %_libdir/*.so %doc DOCS/new_sprng.ps.gz %files openmpi %doc DOCS/README %_libdir/openmpi/lib/libsprng.so.2* %files openmpi-devel %_includedir/openmpi-%_arch/sprng2 %_libdir/openmpi/lib/*.so %doc DOCS/new_sprng.ps.gz %files %mpich %doc DOCS/README %_libdir/%mpich/lib/libsprng.so.* %files %mpich-devel %_includedir/%mpich-%_arch/sprng2 %_libdir/%mpich/lib/*.so %doc DOCS/new_sprng.ps.gz %files examples %_datadir/%name/examples %changelog * Tue Jul 2 2019 Dave Love - 2.0b-2 - Fix building debug package * Thu Jul 17 2014 Dave Love - 2.0b-1 - Initial packaging