Skip to content

Commit

Permalink
added suport to build indiviual toolfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Aug 23, 2021
1 parent 55c2395 commit 0713c74
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 27 deletions.
1 change: 0 additions & 1 deletion cmssw-patch-tool-conf.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
### RPM cms cmssw-patch-tool-conf 4.0

## NOCOMPILER
## INSTALL_DEPENDENCIES cmsLHEtoEOSManager gcc-fixincludes

Requires: cmssw
Expand Down
1 change: 0 additions & 1 deletion cmssw-tool-conf.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
### RPM cms cmssw-tool-conf 51.0
# With cmsBuild, change the above version only when a new tool is added

## NOCOMPILER
## INSTALL_DEPENDENCIES cmsLHEtoEOSManager gcc-fixincludes cmssw-osenv cms-git-tools
## UPLOAD_DEPENDENCIES dqmgui

Expand Down
1 change: 0 additions & 1 deletion coral-tool-conf.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
### RPM cms coral-tool-conf 10.0
## NOCOMPILER

Requires: pcre
Requires: python
Expand Down
4 changes: 1 addition & 3 deletions fwlite-tool-conf.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
### RPM cms fwlite-tool-conf 20.0
## NOCOMPILER
# with cmsBuild, change the above version only when a new
# tool is added
## INITENV SET CMSSW_TOOL_CONF_ROOT $FWLITE_TOOL_CONF_ROOT
Expand Down Expand Up @@ -54,6 +53,5 @@ Requires: zstd
Requires: freetype
%endif

%define skipreqtools jcompiler db6 expat fftw3 sqlite

## INCLUDE cmssw-drop-tools
## INCLUDE scram-tool-conf
24 changes: 3 additions & 21 deletions scram-tool-conf.file
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
### FILE scram-tool-conf
## NOCOMPILER
## BUILDREQUIRE-TOOLFILE
Requires: gmake
## NO_AUTO_RUNPATH
## NO_AUTO_DEPENDENCY
BuildRequires: SCRAMV1
Source99: scram-tools
## INCLUDE compilation_flags
## INCLUDE cuda-flags
Source: none

%if "%{?vec_tools:set}" != "set"
Expand All @@ -27,23 +25,7 @@ mkdir -p %i/tools/selected %i/tools/available
%define skipreqtools %{nil}
%endif

export ROOT_CXXMODULES="0"
%if "%{?package_vectorization}" != ""
export PKG_VECTORIZATION=`echo %package_vectorization`
%endif
export CMSDIST_DIR=%cmsdist_directory

%ifarch x86_64
export COMPILER_CXXFLAGS="$(%{cmsdist_directory}/vectorization/cmsdist_packages.py)"
%endif
%ifarch ppc64le
export COMPILER_CXXFLAGS="%{ppc64le_build_flags}"
%endif
export ORACLE_ENV_ROOT=""
export CUDA_FLAGS="%{nvcc_cuda_flags}"
export CUDA_HOST_CXXFLAGS="%{nvcc_stdcxx}"
if [ $(echo ' %requiredtools ' | grep ' python3 ' |wc -l) -gt 0 ] ; then export PYTHON3_LIB_SITE_PACKAGES ; fi
if [ $(echo ' %requiredtools ' | grep ' python ' |wc -l) -gt 0 ] ; then export PYTHON_LIB_SITE_PACKAGES ; fi
## INCLUDE scram-tools.file/tool-env

for tool in %requiredtools; do
echo ">> Copying tool files from: $tool"
Expand Down
8 changes: 8 additions & 0 deletions scram-tools.file/cmsdist_packages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
def packages(virtual_packages, *args):
from os.path import dirname, join, basename
from glob import glob
tools_dir = join(dirname(__file__), "tools")
for tool in [basename(t) for t in glob(tools_dir+"/*")]:
spec = "%s-toolfile" % tool
virtual_packages[spec] = 'echo -e "### RPM cms %s 1.0\nRequires: %s\n## INCLUDE scram-tools.file/toolfile"' % (spec, tool)
return
20 changes: 20 additions & 0 deletions scram-tools.file/tool-env.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## INCLUDE compilation_flags
## INCLUDE cuda-flags

export ROOT_CXXMODULES="0"
%if "%{?package_vectorization}" != ""
export PKG_VECTORIZATION=`echo %package_vectorization`
%endif
export CMSDIST_DIR=%cmsdist_directory

%ifarch x86_64
export COMPILER_CXXFLAGS="$(%{cmsdist_directory}/vectorization/cmsdist_packages.py)"
%endif
%ifarch ppc64le
export COMPILER_CXXFLAGS="%{ppc64le_build_flags}"
%endif
export ORACLE_ENV_ROOT=""
export CUDA_FLAGS="%{nvcc_cuda_flags}"
export CUDA_HOST_CXXFLAGS="%{nvcc_stdcxx}"
if [ $(echo ' %requiredtools ' | grep ' python3 ' |wc -l) -gt 0 ] ; then export PYTHON3_LIB_SITE_PACKAGES ; fi
if [ $(echo ' %requiredtools ' | grep ' python ' |wc -l) -gt 0 ] ; then export PYTHON_LIB_SITE_PACKAGES ; fi
23 changes: 23 additions & 0 deletions scram-tools.file/toolfile.file
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## NOCOMPILER
## NO_AUTO_RUNPATH
## NO_AUTO_DEPENDENCY
Source: none
%define tool %(echo %{n} | sed 's|-toolfile$||')
%define uctool %(echo %{tool} | tr '[a-z-]' '[A-Z_]')

%prep

%build

%install
## INCLUDE scram-tools.file/tool-env
%{cmsdist_directory}/scram-tools.file/bin/get_tools "${%{uctool}_ROOT}" "${%{uctool}_VERSION}" %i "%{tool}"
mkdir %{i}/etc
mv %{i}/tools/selected %{i}/etc/scram.d
rm -rf %{i}/tools

%post
if [ "X$CMS_INSTALL_PREFIX" = "X" ] ; then CMS_INSTALL_PREFIX=$RPM_INSTALL_PREFIX; export CMS_INSTALL_PREFIX; fi
%{relocateConfig}etc/scram.d/*.xml
echo "%{uctool}_TOOLFILE_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.sh
echo "set %{uctool}_TOOLFILE_ROOT='$CMS_INSTALL_PREFIX/%{pkgrel}'" > $RPM_INSTALL_PREFIX/%{pkgrel}/etc/profile.d/init.csh

0 comments on commit 0713c74

Please sign in to comment.