File nvidia-cuda-toolkit.spec of Package nvidia-cuda-toolkit
#
# spec file for package nvidia-cuda-toolkit
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# needsrootforbuild
%define name nvidia-cuda-toolkit
%define version 4.2.9
%define release 1
%define driver_ver 295.41.00
Summary: NVIDIA CUDA Toolkit libraries
License: SUSE-Freeware
Group: System/Libraries
Name: %{name}
Version: %{version}
Release: %{release}
Source0: cudatoolkit_%{version}_linux_32_sles11.0.run
Source1: cudatoolkit_%{version}_linux_64_sles11.0.run
#Source2: nvidia
Source2: 86-nvidia.rules
Source3: nvidia.sh
Source4: rpmlintrc
Source5: nvcc.profile
Url: http://www.nvidia.com/cuda
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: nvidia-computeG02 >= %{driver_ver}
NoSource: 0
NoSource: 1
BuildRequires: fdupes
BuildRequires: udev
%define DOCDIR %{_defaultdocdir}/%{name}
%description
NVIDIA CUDA is a general purpose parallel computing architecture
that leverages the parallel compute engine in NVIDIA graphics
processing units (GPUs) to solve many complex computational problems
in a fraction of the time required on a CPU. It includes the CUDA
Instruction Set Architecture (ISA) and the parallel compute engine in
the GPU. To program to the CUDA architecture, developers can, today,
use C, one of the most widely used high-level programming languages,
which can then be run at great performance on a CUDA enabled
processor. Other languages will be supported in the future, including
FORTRAN and C++.
%package -n libcusparse4
Summary: NVIDIA CUDA Sparse Matrix runtime library
Group: System/Libraries
%description -n libcusparse4
This package contains the NVIDIA CUDA Sparse Matrix runtime library.
%package -n libcurand4
Summary: NVIDIA CUDA Random Numbers Generation runtime library
Group: System/Libraries
%description -n libcurand4
This package contains the NVIDIA CUDA Random Numbers Generation runtime library.
%package -n libcufft4
Summary: NVIDIA CUDA FFT runtime library
Group: System/Libraries
%description -n libcufft4
This package contains the NVIDIA CUDA FFT runtime library.
%package -n libcublas4
Summary: NVIDIA CUDA BLAS runtime library
Group: System/Libraries
%description -n libcublas4
This package contains the NVIDIA CUDA BLAS runtime library.
%package -n libcuinj4
Summary: NVIDIA CUDA runtime library
Group: System/Libraries
%description -n libcuinj4
This package contains the NVIDIA CUDA PTI runtime library.
%package -n libcupti4
Summary: NVIDIA CUDA runtime library
Group: System/Libraries
%description -n libcupti4
This package contains the NVIDIA CUDA PTI runtime library.
%package -n libcudart4
Summary: NVIDIA CUDA runtime library
Group: System/Libraries
%description -n libcudart4
This package contains the NVIDIA CUDA runtime library.
%package -n libnpp4
Summary: NVIDIA CUDA npp library
Group: System/Libraries
%description -n libnpp4
This package contains the NVIDIA CUDA npp library.
%package -n nvidia-opencl-devel
Summary: NVIDIA openCL header files
Group: Development/Libraries/C and C++
Requires: nvidia-computeG02
Conflicts: ati-opencl-devel
%description -n nvidia-opencl-devel
This package contains the development header files for build applications
with the nvidia openCL library provided with the NVIDIA proprietary driver.
%package devel
Summary: NVIDIA CUDA Toolkit development files
Group: Development/Libraries/C and C++
Requires: libcublas4 = %{version}-%{release}
Requires: libcudart4 = %{version}-%{release}
Requires: libcufft4 = %{version}-%{release}
Requires: libcuinj4 = %{version}-%{release}
Requires: libcupti4 = %{version}-%{release}
Requires: libcurand4 = %{version}-%{release}
Requires: libcusparse4 = %{version}-%{release}
Requires: libnpp4 = %{version}-%{release}
%description devel
NVIDIA CUDA is a general purpose parallel computing architecture
that leverages the parallel compute engine in NVIDIA graphics
processing units (GPUs) to solve many complex computational problems
in a fraction of the time required on a CPU. It includes the CUDA
Instruction Set Architecture (ISA) and the parallel compute engine in
the GPU. To program to the CUDA architecture, developers can, today,
use C, one of the most widely used high-level programming languages,
which can then be run at great performance on a CUDA enabled
processor. Other languages will be supported in the future, including
FORTRAN and C++.
This package contains the nvcc compiler and the development files needed
to build programs that make use of CUDA.
%package -n nvidia-cuda-gdb
Summary: The NVIDIA CUDA debugger
Group: Development/Tools/Debuggers
Requires: %{name}-devel = %{version}-%{release}
%description -n nvidia-cuda-gdb
This package contains the nvidia cuda debugger.
%package doc
Summary: NVIDIA CUDA Toolkit documentation files
Group: Documentation/Other
%description doc
NVIDIA CUDA is a general purpose parallel computing architecture
that leverages the parallel compute engine in NVIDIA graphics
processing units (GPUs) to solve many complex computational problems
in a fraction of the time required on a CPU. It includes the CUDA
Instruction Set Architecture (ISA) and the parallel compute engine in
the GPU. To program to the CUDA architecture, developers can, today,
use C, one of the most widely used high-level programming languages,
which can then be run at great performance on a CUDA enabled
processor. Other languages will be supported in the future, including
FORTRAN and C++.
This package contains the documentation need fo developpers in html format
and pdf files.
%package -n udev-nvidia-cuda-driver
Summary: NVIDIA CUDA driver udev files
Group: System/Kernel
Requires: nvidia-gfxG02-kmp
%description -n udev-nvidia-cuda-driver
This package contains the udev rules that create the device node files
as soon as the NVIDIA CUDA driver is loaded.
This package useful only if you want to use NVIDIA CUDA driver
on a compute host without running a X11 server.
%ifarch i586
%package -n nvidia-cuda-profiler
Summary: NVIDIA CUDA Visual Profiler
Group: Development/Languages/C and C++
Requires: %{name} = %{version}-%{release}
%description -n nvidia-cuda-profiler
NVIDIA CUDA is a general purpose parallel computing architecture
that leverages the parallel compute engine in NVIDIA graphics
processing units (GPUs) to solve many complex computational problems
in a fraction of the time required on a CPU. It includes the CUDA
Instruction Set Architecture (ISA) and the parallel compute engine in
the GPU. To program to the CUDA architecture, developers can, today,
use C, one of the most widely used high-level programming languages,
which can then be run at great performance on a CUDA enabled
processor. Other languages will be supported in the future, including
FORTRAN and C++.
This package contains the CUDA Visual Profiler.
%package -n nvidia-cuda-profiler-doc
Summary: NVIDIA CUDA Visual Profiler documentation
Group: Documentation/Other
%description -n nvidia-cuda-profiler-doc
NVIDIA CUDA is a general purpose parallel computing architecture
that leverages the parallel compute engine in NVIDIA graphics
processing units (GPUs) to solve many complex computational problems
in a fraction of the time required on a CPU. It includes the CUDA
Instruction Set Architecture (ISA) and the parallel compute engine in
the GPU. To program to the CUDA architecture, developers can, today,
use C, one of the most widely used high-level programming languages,
which can then be run at great performance on a CUDA enabled
processor. Other languages will be supported in the future, including
FORTRAN and C++.
This package contains the CUDA Visual Profiler documentation.
%endif
%prep
%setup -q -T -c %{name}-%{version}
%ifnarch x86_64
bash %SOURCE0 --tar xf -C .
%else
bash %SOURCE1 --tar xf -C .
%endif
%build
%install
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_datadir}
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_includedir}
# install libs
cp -ar %_lib/* %{buildroot}%{_libdir}
# install devel headers
cp -ar include/* %{buildroot}%{_includedir}
#install compilers binary files
cp -ar bin/* %{buildroot}%{_bindir}
mkdir -p %{buildroot}/etc/udev/rules.d/
mkdir -p %{buildroot}/lib/udev/
install -D -m 644 %SOURCE2 %{buildroot}/etc/udev/rules.d/
install -D -m 755 %SOURCE3 %{buildroot}/lib/udev/
install -m 644 %SOURCE5 %{buildroot}%{_bindir}/nvcc.profile
sed -i 's|@lib@|%{_lib}|g' %{buildroot}%{_bindir}/nvcc.profile
# open64 files needed by the nvcc compiler
mkdir -p %{buildroot}%{_libexecdir}/open64/{bin,lib}
cp -ar open64/bin/* %{buildroot}%{_libexecdir}/open64/bin
cp -ar open64/lib/* %{buildroot}%{_libexecdir}/open64/lib
# nvvm
cp -ar nvvm %{buildroot}%{_libexecdir}/
chmod 644 %{buildroot}%{_libexecdir}/nvvm/ci_include.h
# CUPTI
cp -ar extras/CUPTI/%_lib/*.so* %{buildroot}%{_libdir}
cp -ar extras/CUPTI/include/* %{buildroot}%{_includedir}
# GL headers are already prideved by mesa-devel
rm -rf %{buildroot}%{_includedir}/GL
# debugger header files
cp -ar extras/Debugger/include/*.h %{buildroot}%{_includedir}
sed -i 's/\r//' doc/EULA.txt
mkdir -p %{buildroot}%{DOCDIR}
cp -ar doc/* %{buildroot}%{DOCDIR}
cp -ar extras/CUPTI/doc/* %{buildroot}%{DOCDIR}
cp -ar tools/CUDA_Occupancy_Calculator.xls %{buildroot}%{DOCDIR}
cp -ar extras/Debugger/doc/* %{buildroot}%{DOCDIR}
# Replace duplicate files by symlinks or hardlinks
%fdupes %{buildroot}%{DOCDIR}
%clean
rm -rf %{buildroot}
%post -n libcusparse4 -p /sbin/ldconfig
%postun -n libcusparse4 -p /sbin/ldconfig
%post -n libcufft4 -p /sbin/ldconfig
%postun -n libcufft4 -p /sbin/ldconfig
%post -n libcublas4 -p /sbin/ldconfig
%postun -n libcublas4 -p /sbin/ldconfig
%post -n libcudart4 -p /sbin/ldconfig
%postun -n libcudart4 -p /sbin/ldconfig
%post -n libcurand4 -p /sbin/ldconfig
%postun -n libcurand4 -p /sbin/ldconfig
%post -n libcuinj4 -p /sbin/ldconfig
%postun -n libcuinj4 -p /sbin/ldconfig
%post -n libcupti4 -p /sbin/ldconfig
%postun -n libcupti4 -p /sbin/ldconfig
%post -n libnpp4 -p /sbin/ldconfig
%postun -n libnpp4 -p /sbin/ldconfig
%files -n libcusparse4
%defattr(-,root,root)
%_libdir/libcusparse.so.*
%files -n libcurand4
%defattr(-,root,root)
%_libdir/libcurand.so.*
%files -n libcufft4
%defattr(-,root,root)
%_libdir/libcufft.so.*
%files -n libcublas4
%defattr(-,root,root)
%_libdir/libcublas.so.*
%files -n libcudart4
%defattr(-,root,root)
%_libdir/libcudart.so.*
%files -n libcuinj4
%defattr(-,root,root)
%_libdir/libcuinj.so.*
%files -n libcupti4
%defattr(-,root,root)
%_libdir/libcupti.so.*
%files -n libnpp4
%defattr(-,root,root)
%_libdir/libnpp.so.*
%files -n udev-nvidia-cuda-driver
%defattr(-,root,root)
%config /etc/udev/rules.d/86-nvidia.rules
/lib/udev/*
%files -n nvidia-opencl-devel
%defattr(-,root,root)
%_includedir/CL
%files devel
%defattr(-,root,root)
%_bindir/*
%{_libexecdir}/open64
%{_libexecdir}/nvvm
%exclude %_bindir/cuda-gdb
%_libdir/*.so
%_includedir/crt
%_includedir/*.h
%_includedir/thrust
#%%_mandir/man1/*
#%%_mandir/man3/*
#%%exclude %%_mandir/man3/major.3.gz
#%%exclude %%_mandir/man3/minor.3.gz
%files -n nvidia-cuda-gdb
%defattr(-,root,root)
%{_bindir}/cuda-gdb
%files doc
%defattr(-,root,root)
%{DOCDIR}
%changelog