-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'IB/CMSSW_12_3_X/rootnext' into root624
- Loading branch information
Showing
23 changed files
with
162 additions
and
672 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
%prep | ||
|
||
%build | ||
|
||
%install | ||
|
||
mkdir -p %i/etc/scram.d | ||
cat << \EOF_TOOLFILE >%i/etc/scram.d/cmsswdata.xml | ||
<tool name="cmsswdata" version="%v"> | ||
<client> | ||
<environment name="CMSSWDATA_BASE" default="%{cmsroot}/%{cmsplatf}/%{pkgcategory}"/> | ||
<environment name="CMSSW_DATA_PATH" default="$CMSSWDATA_BASE"/> | ||
EOF_TOOLFILE | ||
|
||
cat << \EOF_TOOLFILE > %i/searchpath.xml | ||
</client> | ||
<runtime name="CMSSW_DATA_PATH" value="$CMSSWDATA_BASE" type="path"/> | ||
EOF_TOOLFILE | ||
|
||
for toolbase in `echo %pkgreqs | tr ' ' '\n' | grep 'cms/data-'` ; do | ||
toolver=`basename $toolbase` | ||
pack=`echo $toolbase | cut -d/ -f2 | sed 's|data-||;s|-|/|'` | ||
echo " <flags CMSSW_DATA_PACKAGE=\"$pack=$toolver\"/>" >> %i/etc/scram.d/cmsswdata.xml | ||
echo " <runtime name=\"CMSSW_SEARCH_PATH\" default=\"%{cmsroot}/%{cmsplatf}/$toolbase\" type=\"path\"/>" >> %i/searchpath.xml | ||
done | ||
|
||
cat %i/searchpath.xml >> %i/etc/scram.d/cmsswdata.xml | ||
echo " </tool>" >> %i/etc/scram.d/cmsswdata.xml | ||
rm -f %i/searchpath.xml | ||
|
||
%post | ||
%{relocateConfig}etc/scram.d/*.xml | ||
echo "%{BaseTool}_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh | ||
echo "set %{BaseTool}_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.csh | ||
echo "%{BaseTool}_PKGREQUIRED='%pkgreqs'" >> $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh | ||
echo "set %{BaseTool}_PKGREQUIRED='%pkgreqs'" >> $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.csh | ||
|
||
for DATA_PATH in %directpkgreqs; do | ||
PKG_DIR=$(echo $DATA_PATH | cut -d/ -f2) | ||
[ $(echo $PKG_DIR | grep '^data-' | wc -l) -eq 1 ] || continue | ||
PKG_DIR=$(echo $PKG_DIR | sed 's|^data-||;s|-|/|') | ||
SOURCE=$RPM_INSTALL_PREFIX/%{cmsplatf}/$DATA_PATH | ||
DES_PATH=$(echo $DATA_PATH | cut -d/ -f1,2)/$(echo $DATA_PATH | cut -d/ -f3 | tr '-' '\n' | grep '^V[0-9][0-9]$\|^[0-9][0-9]$' | tr '\n' '-' | sed 's|-$||') | ||
PKG_DATA=$(echo $PKG_DIR | cut -d/ -f1) | ||
if [ ! -e $RPM_INSTALL_PREFIX/share/$DES_PATH/$PKG_DIR ] ; then | ||
rm -rf $RPM_INSTALL_PREFIX/share/$DES_PATH | ||
mkdir -p $RPM_INSTALL_PREFIX/share/$DES_PATH | ||
if [ -L $SOURCE/$PKG_DATA ] ; then | ||
ln -fs ../../../../%{cmsplatf}/$DATA_PATH/$PKG_DATA $RPM_INSTALL_PREFIX/share/$DES_PATH/$PKG_DATA | ||
else | ||
echo "Moving $DATA_PATH in share" | ||
rsync -aq --no-t --size-only $SOURCE/$PKG_DATA/ $RPM_INSTALL_PREFIX/share/$DES_PATH/$PKG_DATA/ | ||
fi | ||
fi | ||
if [ ! -L $SOURCE/$PKG_DATA ] ; then | ||
rm -rf $SOURCE/$PKG_DATA && ln -fs ../../../../share/$DES_PATH/$PKG_DATA $SOURCE/$PKG_DATA | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,67 @@ | ||
### RPM external cuda-compatible-runtime 1.0 | ||
|
||
%define branch master | ||
%define commit 18d5a51bfb32fbb7b765dd2eecd14e193cce8126 | ||
%define commit bfe5537537428ab4a72ae929c77977a55501c576 | ||
|
||
Source: git+https://:@gitlab.cern.ch:8443/cms-patatrack/%{n}.git?obj=%{branch}/%{commit}&export=%{n}&filter=./test.c&output=/%{n}-%{realversion}.tgz | ||
Source: git+https://:@gitlab.cern.ch:8443/cms-patatrack/%{n}.git?obj=%{branch}/%{commit}&export=%{n}&filter=./test.cu&output=/%{n}-%{realversion}.tgz | ||
Requires: cuda | ||
AutoReq: no | ||
|
||
%prep | ||
%setup -n %{n} | ||
|
||
%build | ||
## INCLUDE cuda-flags | ||
# defines nvcc_stdcxx and cuda_flags_4 | ||
|
||
rm -rf %{_builddir}/build && mkdir %{_builddir}/build | ||
gcc -std=c99 -O2 -Wall test.c -I $CUDA_ROOT/include -L $CUDA_ROOT/lib64 -L $CUDA_ROOT/lib64/stubs -l cudart_static -l cuda -ldl -lrt -pthread -static-libgcc -o %{_builddir}/build/cuda-compatible-runtime # || true | ||
if | ||
$CUDA_ROOT/bin/nvcc %{nvcc_stdcxx} -O2 -g %{cuda_flags_4} test.cu -I $CUDA_ROOT/include -L $CUDA_ROOT/lib64 -L $CUDA_ROOT/lib64/stubs --cudart static -ldl -lrt --compiler-options '-Wall -pthread' -o %{_builddir}/build/cuda-compatible-runtime | ||
then | ||
true | ||
else | ||
# CUDA is not supported by this architecture or compiler version | ||
cat > %{_builddir}/build/cuda-compatible-runtime << @EOF_ | ||
#! /bin/bash | ||
|
||
%install | ||
VERBOSE=false | ||
|
||
mkdir %{i}/test | ||
if [ -f %{_builddir}/build/cuda-compatible-runtime ]; then | ||
cp %{_builddir}/build/cuda-compatible-runtime %{i}/test/cuda-compatible-runtime | ||
else | ||
ln -s /usr/bin/false %{i}/test/cuda-compatible-runtime | ||
function usage() { | ||
cat << @EOF | ||
Usage: \$0 [-h|-v] | ||
|
||
Options: | ||
-h Print a help message and exits. | ||
-v Be more verbose. | ||
@EOF | ||
} | ||
|
||
for ARG in "\$@"; do | ||
case "\$ARG" in | ||
-h) | ||
usage | ||
exit 0 | ||
;; | ||
-v) | ||
VERBOSE=true | ||
;; | ||
*) | ||
echo "\$0: invalid option '\$ARG'" | ||
echo | ||
usage | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
\$VERBOSE && echo "CUDA ${CUDA_VERSION} is not compatible with GCC ${GCC_VERSION}" | ||
exit 1 | ||
@EOF_ | ||
chmod +x %{_builddir}/build/cuda-compatible-runtime | ||
fi | ||
|
||
%install | ||
mkdir %{i}/test | ||
cp %{_builddir}/build/cuda-compatible-runtime %{i}/test/cuda-compatible-runtime | ||
|
||
%post |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.