Skip to content

Commit

Permalink
improve dd4hep cmake flags
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Dec 6, 2022
1 parent 2049e79 commit 7efc76b
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions dd4hep.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@ Source: git+https://github.com/%{github_user}/DD4hep.git?obj=%{branch}/%{tag}&ex
BuildRequires: cmake
Requires: root boost clhep xerces-c geant4

%define cmake_fixed_args \\\
-DCMAKE_INSTALL_PREFIX='%{i}' \\\
-DBoost_NO_BOOST_CMAKE=ON \\\
-DDD4HEP_USE_XERCESC=ON \\\
-DDD4HEP_USE_PYROOT=ON \\\
-DCMAKE_CXX_STANDARD=17 \\\
-DCMAKE_BUILD_TYPE=Release \\\
-DCMAKE_CXX_FLAGS_RELEASE='-O2 -DNDEBUG' \\\
-DDD4HEP_USE_GEANT4_UNITS=ON \\\
-DXERCESC_ROOT_DIR=${XERCES_C_ROOT} \\\
-DCMAKE_PREFIX_PATH="${CLHEP_ROOT};${XERCES_C_ROOT}"

%prep

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

%build

export BOOST_ROOT
CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX='%{i}' \
-DBoost_NO_BOOST_CMAKE=ON \
-DDD4HEP_USE_XERCESC=ON \
-DXERCESC_ROOT_DIR=${XERCES_C_ROOT} \
-DDD4HEP_USE_PYROOT=ON \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_RELEASE="-O2 -DNDEBUG" \
-DDD4HEP_USE_GEANT4_UNITS=ON \
-DCMAKE_PREFIX_PATH=${CLHEP_ROOT};${XERCES_C_ROOT}"

#Build normal Shared D4Hep without Geant4
rm -rf ../build; mkdir ../build; cd ../build
cmake $CMAKE_ARGS -DBUILD_SHARED_LIBS=ON ../%{n}-%{realversion}
cmake %{cmake_fixed_args} -DBUILD_SHARED_LIBS=ON ../%{n}-%{realversion}
make %{makeprocesses} VERBOSE=1
make install

#Building DDG4 static
rm -rf ../build-g4; mkdir ../build-g4; cd ../build-g4
cmake $CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF -DDD4HEP_USE_GEANT4=ON ../%{n}-%{realversion}
cmake %{cmake_fixed_args} -DBUILD_SHARED_LIBS=OFF -DDD4HEP_USE_GEANT4=ON ../%{n}-%{realversion}
cd DDG4
make %{makeprocesses} VERBOSE=1
for lib in $(ls ../lib/libDDG4*.a | sed 's|.a$||'); do
Expand Down

0 comments on commit 7efc76b

Please sign in to comment.