|
| 1 | +### RPM external acts v44.0.1 |
| 2 | +## INCLUDE cpp-standard |
| 3 | +## INCLUDE microarch_flags |
| 4 | +## INCLUDE compilation_flags |
| 5 | +## INCLUDE compilation_flags_lto |
| 6 | +## INCLUDE cuda-flags |
| 7 | +## INCLUDE rocm-flags |
| 8 | + |
| 9 | +%define tag 2d4cf6938 |
| 10 | +%define branch cms/%{realversion} |
| 11 | +%define github_user cms-externals |
| 12 | +Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz |
| 13 | +Source99: scram-tools.file/tools/eigen/env |
| 14 | + |
| 15 | +# Do not build the Acts and Traccc tests |
| 16 | +%define build_test 0 |
| 17 | + |
| 18 | +# ROCm support is not yet building correctly |
| 19 | +%define without_rocm 1 |
| 20 | + |
| 21 | +BuildRequires: cmake |
| 22 | +Requires: boost |
| 23 | +Requires: dd4hep |
| 24 | +Requires: eigen |
| 25 | +Requires: expat |
| 26 | +Requires: geant4 |
| 27 | +Requires: json |
| 28 | +Requires: python3 |
| 29 | +Requires: root |
| 30 | +Requires: xerces-c |
| 31 | +Requires: zlib |
| 32 | +%{!?without_cuda:Requires: cuda} |
| 33 | +%{!?without_rocm:Requires: rocm} |
| 34 | +%if %{build_test} |
| 35 | +# These are ony used to build the examples and unit tests |
| 36 | +Requires: hepmc3 |
| 37 | +Requires: tbb |
| 38 | +%endif |
| 39 | + |
| 40 | +%prep |
| 41 | +%setup -n %{n}-%{realversion} |
| 42 | + |
| 43 | +%build |
| 44 | +rm -rf ../build |
| 45 | +mkdir ../build |
| 46 | +cd ../build |
| 47 | +source %{_sourcedir}/env |
| 48 | + |
| 49 | +%define cuda_enabled %{?without_cuda:OFF}%{!?without_cuda:ON} |
| 50 | +%define rocm_enabled %{?without_rocm:OFF}%{!?without_rocm:ON} |
| 51 | + |
| 52 | +# Notes: |
| 53 | +# - gcc-ar and gcc-ranlib are needed to build static libraries with LTO support. |
| 54 | +# - building with RPATH enabled is necessary to build and run the tests; set CMAKE_SKIP_INSTALL_RPATH to strip the RPATH |
| 55 | +# information after installing the libraries. |
| 56 | +# - HIP/ROCm support is not yet working correctly. |
| 57 | + |
| 58 | +cmake ../%{n}-%{realversion} \ |
| 59 | + -DCMAKE_PREFIX_PATH="%{cmake_prefix_path}" \ |
| 60 | + -DCMAKE_CXX_COMPILER="$GCC_ROOT/bin/g++" \ |
| 61 | + -DCMAKE_CXX_STANDARD="%{cms_cxx_standard}" \ |
| 62 | + -DCMAKE_CXX_FLAGS="-fPIC $CMS_EIGEN_CXX_FLAGS %{arch_build_flags} %{selected_microarch} %{lto_build_flags}" \ |
| 63 | + -DCMAKE_AR="$GCC_ROOT/bin/gcc-ar" \ |
| 64 | + -DCMAKE_RANLIB="$GCC_ROOT/bin/gcc-ranlib" \ |
| 65 | + -DCMAKE_BUILD_TYPE="Release" \ |
| 66 | + -DCMAKE_INSTALL_PREFIX="%{i}" \ |
| 67 | + -DCMAKE_SKIP_INSTALL_RPATH="ON" \ |
| 68 | + -DCMAKE_CUDA_ARCHITECTURES="$(echo %{cuda_arch} | sed -e 's/ \+/;/g')" \ |
| 69 | + -DCMAKE_CUDA_FLAGS="-Wno-deprecated-gpu-targets --threads 0" \ |
| 70 | + -DCMAKE_HIP_ARCHITECTURES="$(echo %{rocm_archs} | sed -e 's/ \+/;/g')" \ |
| 71 | + -DAMDGPU_TARGETS="$(echo %{rocm_archs} | sed -e 's/ \+/;/g')" \ |
| 72 | + -DBUILD_SHARED_LIBS="ON" \ |
| 73 | + -DACTS_NLOHMANNJSON_SOURCE="" \ |
| 74 | + -DACTS_USE_SYSTEM_NLOHMANN_JSON="ON" \ |
| 75 | + -DACTS_BUILD_PLUGIN_ACTSVG="ON" \ |
| 76 | + -DACTS_BUILD_PLUGIN_JSON="ON" \ |
| 77 | + -DACTS_BUILD_PLUGIN_ROOT="ON" \ |
| 78 | + -DACTS_BUILD_PLUGIN_DD4HEP="ON" \ |
| 79 | + -DACTS_BUILD_PLUGIN_GEANT4="ON" \ |
| 80 | + -DACTS_BUILD_PLUGIN_TRACCC="ON" \ |
| 81 | + -DACTS_ENABLE_LOG_FAILURE_THRESHOLD="ON" \ |
| 82 | + -DCOVFIE_PLATFORM_CPU="ON" \ |
| 83 | + -DCOVFIE_PLATFORM_CUDA="%{cuda_enabled}" \ |
| 84 | + -DCOVFIE_PLATFORM_HIP="%{rocm_enabled}" \ |
| 85 | + -DDETRAY_SETUP_NLOHMANN="ON" \ |
| 86 | + -DDETRAY_USE_SYSTEM_NLOHMANN="ON" \ |
| 87 | + -DDETRAY_BUILD_HOST="ON" \ |
| 88 | + -DDETRAY_BUILD_CUDA="%{cuda_enabled}" \ |
| 89 | + -DDETRAY_BUILD_HIP="%{rocm_enabled}" \ |
| 90 | + -DTRACCC_BUILD_CUDA="%{cuda_enabled}" \ |
| 91 | + -DTRACCC_BUILD_HIP="%{rocm_enabled}" \ |
| 92 | + -DTRACCC_SETUP_THRUST="%{cuda_enabled}" \ |
| 93 | + -DTRACCC_SETUP_ROCTHRUST="%{rocm_enabled}" \ |
| 94 | + -DTRACCC_USE_SYSTEM_THRUST="%{cuda_enabled}" \ |
| 95 | + -DTRACCC_USE_SYSTEM_ROCTHRUST="%{rocm_enabled}" \ |
| 96 | + -DVECMEM_BUILD_CUDA_LIBRARY="%{cuda_enabled}" \ |
| 97 | + -DVECMEM_BUILD_HIP_LIBRARY="%{rocm_enabled}" \ |
| 98 | +%if %{build_test} |
| 99 | + -DACTS_BUILD_UNITTESTS="ON" \ |
| 100 | + -DACTS_BUILD_INTEGRATIONTESTS="ON" \ |
| 101 | + -DACTS_BUILD_EXAMPLES_PYTHON_BINDINGS="ON" \ |
| 102 | + -DTRACCC_BUILD_TESTING="ON" \ |
| 103 | +%endif |
| 104 | + -L |
| 105 | + |
| 106 | +make %{makeprocesses} VERBOSE=1 |
| 107 | + |
| 108 | +%install |
| 109 | +cd ../build |
| 110 | +make install VERBOSE=1 |
| 111 | + |
| 112 | +%if %{build_test} |
| 113 | +# download the traccc test data file to the .../data directory |
| 114 | +mkdir -p %{i}/data |
| 115 | +./_deps/traccc-src/data/traccc_data_get_files.sh -o %{i}/data |
| 116 | +%endif |
| 117 | + |
| 118 | +# remove the scripts used to set the Acts environment variables |
| 119 | +rm %{i}/bin/this_acts.sh |
| 120 | +rm %{i}/bin/this_acts_withdeps.sh |
| 121 | + |
| 122 | +%post |
| 123 | +%{relocateConfig}lib64/cmake/*/*.cmake |
0 commit comments