Skip to content

Commit

Permalink
Move the cuda-gdb wrapper to a separate tool
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Jun 9, 2018
1 parent 1d755dc commit d799877
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
3 changes: 2 additions & 1 deletion cmssw-tool-conf.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM cms cmssw-tool-conf 43.0
### RPM cms cmssw-tool-conf 44.0
## NOCOMPILER
# With cmsBuild, change the above version only when a new tool is added

Expand Down Expand Up @@ -167,6 +167,7 @@ Requires: tkonlinesw-toolfile
Requires: oracle-toolfile
Requires: cms_oracleocci_abi_hack-toolfile
Requires: cuda-toolfile
Requires: cuda-gdb-wrapper-toolfile
Requires: cub-toolfile
Requires: cuda-api-wrappers-toolfile
Requires: intel-vtune
Expand Down
19 changes: 19 additions & 0 deletions cuda-gdb-wrapper-toolfile.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### RPM external cuda-gdb-wrapper-toolfile 1.0
Requires: cuda-gdb-wrapper

%prep

%build

%install
mkdir -p %i/etc/scram.d
cat << \EOF_TOOLFILE >%i/etc/scram.d/cuda-gdb-wrapper.xml
<tool name="cuda-gdb-wrapper" version="@TOOL_VERSION@">
<client>
<environment name="CUDA_GDB_WRAPPER_BASE" default="@TOOL_ROOT@"/>
</client>
<runtime name="PATH" value="$CUDA_GDB_WRAPPER_BASE/bin" type="path"/>
</tool>
EOF_TOOLFILE

## IMPORT scram-tools-post
20 changes: 20 additions & 0 deletions cuda-gdb-wrapper.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### RPM external cuda-gdb-wrapper 1.0

Requires: cuda python

%prep

%build

%install
# add a wrapper for cuda-gdb
mkdir %{i}/bin
cat > %{i}/bin/cuda-gdb << @EOF
#! /bin/bash
export PYTHONHOME=$PYTHON_ROOT
exec $CUDA_ROOT/bin/cuda-gdb.real "\$@"
@EOF
chmod a+x %{i}/bin/cuda-gdb

%post
%{relocateConfig}bin/cuda-gdb
10 changes: 1 addition & 9 deletions cuda.spec
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,10 @@ rm -rf %_builddir/bin/nsight
rm -rf %_builddir/bin/nvvp
rm -rf %_builddir/bin/computeprof

# add a wrapper for cuda-gdb and package the support files
# package the cuda-gdb support files, and rename the binary to use it via a wrapper
mkdir %{i}/share
cp -ar %_builddir/share/gdb/ %{i}/share/
mv %_builddir/bin/cuda-gdb %_builddir/bin/cuda-gdb.real
cat > %_builddir/bin/cuda-gdb << @EOF
#! /bin/bash
cd \$CMSSW_BASE
export PYTHONHOME=\$(scram tool tag python PYTHON_BASE)
CUDA_BASE=\$(scram tool tag cuda CUDA_BASE)
cd \$OLDPWD
exec \$CUDA_BASE/bin/cuda-gdb.real "\$@"
@EOF

# package the binaries and tools
cp -ar %_builddir/bin %{i}
Expand Down

0 comments on commit d799877

Please sign in to comment.