Skip to content

Commit

Permalink
Merge pull request #3705 from mrodozov/bkprt-vecgeom-10-0-X
Browse files Browse the repository at this point in the history
Backport vecgeom to 10_0_X
  • Loading branch information
smuzaffar committed Feb 1, 2018
2 parents 62e9909 + bc2f7c5 commit 72e049d
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmssw-tool-conf.spec
Expand Up @@ -36,6 +36,7 @@ Requires: gcc-toolfile
Requires: gdbm-toolfile
Requires: geant4-toolfile
Requires: geant4data-toolfile
Requires: vecgeom-toolfile
Requires: glimpse-toolfile
Requires: gmake-toolfile
Requires: gsl-toolfile
Expand Down
4 changes: 3 additions & 1 deletion geant4-toolfile.spec
Expand Up @@ -36,7 +36,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/geant4core.xml
<lib name="G4tracking"/>
<lib name="G4track"/>
<lib name="G4analysis"/>
<flags CXXFLAGS="-DG4MULTITHREADED -DG4USE_STD11 -ftls-model=global-dynamic -pthread"/>
<flags CXXFLAGS="-DG4MULTITHREADED -DG4USE_STD11 -DG4GEOM_USE_USOLIDS -ftls-model=global-dynamic -pthread"/>
<client>
<environment name="GEANT4CORE_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$GEANT4CORE_BASE/lib"/>
Expand All @@ -46,6 +46,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/geant4core.xml
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<flags cppdefines="GNU_GCC G4V9"/>
<use name="clhep"/>
<use name="vecgeom"/>
<use name="root_cxxdefaults"/>
</tool>
EOF_TOOLFILE
Expand All @@ -59,6 +60,7 @@ cat << \EOF_TOOLFILE >%i/etc/scram.d/geant4static.xml
<environment name="GEANT4STATIC_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$GEANT4STATIC_BASE/lib/archive"/>
</client>
<use name="vecgeom"/>
<use name="clhep"/>
<use name="xerces-c"/>
</tool>
Expand Down
6 changes: 5 additions & 1 deletion geant4.spec
Expand Up @@ -4,11 +4,12 @@
%define github_user cms-externals
Source: git+https://github.com/%github_user/%{n}.git?obj=%{branch}/%{tag}&export=%{n}.%{realversion}&output=/%{n}.%{realversion}-%{tag}.tgz

BuildRequires: cmake
BuildRequires: cmake gmake

Requires: clhep
Requires: expat
Requires: xerces-c
Requires: vecgeom

%define keep_archives true

Expand All @@ -25,6 +26,8 @@ fi
rm -rf ../build
mkdir ../build
cd ../build
export Usolids_DIR=${VECGEOM_ROOT}/lib/cmake/Usolids
export VecGeom_DIR=${VECGEOM_ROOT}/lib/cmake/VecGeom

cmake ../%{n}.%{realversion} \
-DCMAKE_CXX_COMPILER="g++" \
Expand All @@ -37,6 +40,7 @@ cmake ../%{n}.%{realversion} \
-DGEANT4_BUILD_TLS_MODEL:STRING="global-dynamic" \
-DGEANT4_ENABLE_TESTING=OFF \
-DGEANT4_BUILD_VERBOSE_CODE=OFF \
-DGEANT4_USE_USOLIDS="all" \
-DBUILD_SHARED_LIBS=ON \
-DXERCESC_ROOT_DIR:PATH="${XERCES_C_ROOT}" \
-DCLHEP_ROOT_DIR:PATH="$CLHEP_ROOT" \
Expand Down
42 changes: 42 additions & 0 deletions vecgeom-toolfile.spec
@@ -0,0 +1,42 @@
### RPM external vecgeom-toolfile 1.0
Requires: vecgeom
%prep

%build

%install

mkdir -p %i/etc/scram.d
cat << \EOF_TOOLFILE >%i/etc/scram.d/vecgeom_interface.xml
<tool name="vecgeom_interface" version="@TOOL_VERSION@">
<info url="https://gitlab.cern.ch/VecGeom/VecGeom"/>
<client>
<environment name="VECGEOM_INTERFACE_BASE" default="@TOOL_ROOT@"/>
<environment name="INCLUDE" default="$VECGEOM_INTERFACE_BASE/include"/>
</client>
<flags CPPDEFINES="VECGEOM_SCALAR"/>
<flags CPPDEFINES="VECGEOM_REPLACE_USOLIDS"/>
<flags CPPDEFINES="VECGEOM_NO_SPECIALIZATION"/>
<flags CPPDEFINES="VECGEOM_USOLIDS"/>
<flags CPPDEFINES="VECGEOM_INPLACE_TRANSFORMATIONS"/>
<flags CPPDEFINES="VECGEOM_USE_INDEXEDNAVSTATES"/>
<runtime name="ROOT_INCLUDE_PATH" value="$INCLUDE" type="path"/>
<use name="root_cxxdefaults"/>
</tool>
EOF_TOOLFILE

mkdir -p %i/etc/scram.d
cat << \EOF_TOOLFILE >%i/etc/scram.d/vecgeom.xml
<tool name="vecgeom" version="@TOOL_VERSION@">
<info url="https://gitlab.cern.ch/VecGeom/VecGeom"/>
<lib name="vecgeom"/>
<lib name="usolids"/>
<client>
<environment name="VECGEOM_BASE" default="@TOOL_ROOT@"/>
<environment name="LIBDIR" default="$VECGEOM_BASE/lib"/>
</client>
<use name="vecgeom_interface"/>
</tool>
EOF_TOOLFILE

## IMPORT scram-tools-post
35 changes: 35 additions & 0 deletions vecgeom.spec
@@ -0,0 +1,35 @@
### RPM external vecgeom v00.05.00
Source: git+https://gitlab.cern.ch/VecGeom/VecGeom.git?obj=master/%{realversion}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}.tgz
BuildRequires: cmake gmake
%define keep_archives true

%prep
%setup -n %{n}-%{realversion}

%build
rm -rf ../build
mkdir ../build
cd ../build

cmake ../%{n}-%{realversion} \
-DCMAKE_INSTALL_PREFIX=%{i} \
-DROOT=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DNO_SPECIALIZATION=ON \
-DBACKEND=Scalar \
-DUSOLIDS=ON \
-DUSOLIDS_VECGEOM=ON \
-DVECGEOM_VECTOR=sse3 \
-DGEANT4=OFF

make %{makeprocesses}

%install
cd ../build
make %{makeprocesses} install

%post
%{relocateConfig}lib/cmake/USolids/*.cmake
%{relocateConfig}lib/cmake/VecCore/*.cmake
%{relocateConfig}lib/cmake/VecGeom/*.cmake

0 comments on commit 72e049d

Please sign in to comment.