Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pythoncompression
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Verbytskyi committed May 23, 2024
2 parents 07638e4 + 7ef81bf commit 9bef5e5
Show file tree
Hide file tree
Showing 59 changed files with 3,134 additions and 2,056 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-------------------------- HepMC3.2.8-pre ----------------------
-------------------------- HepMC3.3.0-pre ----------------------
2024-04-20 Andy Buckley
* Suppress cross-section/weight count-mismatch warning if only one cross-section.
2024-04-08 Mattias Ellert
* Add support for reading with uproot
* Drop Python2 support
Expand Down
45 changes: 29 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

HepMC3 is a new version of the HepMC event record. It uses shared pointers for in-memory navigation and the POD concept for persistency.
Visit the home page of the project http://hepmc.web.cern.ch/hepmc/ or the CERN GitLab repository https://gitlab.cern.ch/hepmc/HepMC3 for more information.
A short information on the compatibility between the HePMC3 versions and deprecation of some functionality see below.
A short information on the compatibility between the HepMC3 versions and deprecation of some functionality see below.
You can also send bug reports, feature requests and questions about HepMC3 to hepmc-devATcern.ch.



# Quick-start (applicable to recent versions):

0. On the Linux platform HepMC3 is available from the standard repositories of multiple many
linux distributions: Fedora, CentOS(EPEL), Arch Linux, Mageia, openSUSE Tumbleweed, Debian (outdated) etc.
linux distributions: Fedora, CentOS(EPEL), Arch Linux, Mageia, openSUSE Tumbleweed, Debian (outdated) etc.
It is recommended to use the system package manager to install HepMC3 for these systems.
The following commands will install the HepMC3 in the corresponding systems:
- Fedora:
Expand Down Expand Up @@ -203,7 +203,7 @@ On Windows (in Unix-compatible shell) one can use
```
cmake --build ./
```
instead
instead.

Please note that you have to have permissions to install HepMC3 into the selected directory.

Expand Down Expand Up @@ -237,16 +237,16 @@ The number of potential combinations of compiler suites, Python versions and ope
therefore it is recommended to install the HepMC3 form the default repositories of the used operating system.
If not possible, the following options are available
- compile the Python package from sources
- use the precompiled binaries from pypi: https://pypi.org/project/HepMC3/
- use the precompiled binaries from PyPi: https://pypi.org/project/HepMC3/
- use the https://anaconda.org/conda-forge/hepmc3
In addition to that part of the bindings are implemented in the pyhepmc project

https://github.com/HDembinski/pyhepmc.

Please note that
Please note that only the PyPi packages are officially supported.


10a
10.1

The installation path for the Python modules can be tweaked with
a set of dynamically named CMake variables:
Expand Down Expand Up @@ -279,14 +279,15 @@ will build Python modules for versions Python 3.6 and Python 3.12.
By default CMake will attempt to build the Python modules for Python version 3.


10b
10.2

In addition to the standard CPython modules, it is possible to build HepMC3 modules for PyPy.
However, the PyPy support is experimental. To build the bindings against the `pypy-c` library use `pypy<version>`
for the `HEPMC3_PYTHON_VERSIONS` option, e.g.
```
-DHEPMC3_PYTHON_VERSIONS=pypy2
```
This also requires quite a recent CMake.

11.

Expand Down Expand Up @@ -314,7 +315,8 @@ To include an existing build of HepMC3 in your project, you can use find_package
find_package(HepMC3 3.2.0 REQUIRED)
```

This will set up a number of CMake variables targets depending on the features that were built with the found version of HepMC3. Some useful CMake variables that will be set are included below:
This will set up a number of CMake variables targets depending on the features that were built with the found version of HepMC3.
Some useful CMake variables that will be set are included below:

```
HEPMC3_VERSION
Expand All @@ -329,7 +331,8 @@ HEPMC3_ROOTIO_LIB
HEPMC3_PROTOBUFIO_LIB
```

Generally in modern CMake projects you should use exported targets to model dependencies, rather than setting your own compiler and linker options using the values of variables like the above. Modern HepMC3 exports a number of targets, reproduced below:
Generally in modern CMake projects you should use exported targets to model dependencies, rather than setting your own compiler and
linker options using the values of variables like the above. Modern HepMC3 exports a number of targets, reproduced below:

```
HepMC3::All
Expand All @@ -350,15 +353,22 @@ To link a target, `MyLibrary`, from your project to the main HepMC3 library you
target_link_libraries(MyLibrary PUBLIC HepMC3::All)
```

_N.B._ That these exported targets container their own dependencies, the above _should_ be all that is needed to correctly set up the relevant compiler options, include directories, and link options on `MyLibrary`. This includes, for example, if you need to write out using the rootIO module, `HepMC3::All` links to `HepMC::rootIO`, which depends on a number of ROOT libraries and the ROOT include directory.
_N.B._ That these exported targets container their own dependencies, the above _should_ be all that is needed to correctly
set up the relevant compiler options, include directories, and link options on `MyLibrary`. This includes, for example,
if you need to write out using the rootIO module, `HepMC3::All` links to `HepMC::rootIO`, which depends on a number of
ROOT libraries and the ROOT include directory.

### A ROOT Gotcha

The way that the dependency on ROOT is currently included, means that paths to the ROOT include directory and ROOT libraries are hard-coded in the exported targets. This means that if your version of HepMC3 was built against one install of ROOT and other parts of your project pick up a different install of ROOT, you could have conflicts.
The way that the dependency on ROOT is currently included, means that paths to the ROOT include directory and ROOT libraries
are hard-coded in the exported targets. This means that if your version of HepMC3 was built against one install of ROOT and
other parts of your project pick up a different install of ROOT, you could have conflicts.

## Adding a dependency to HepMC3 with CPM.cmake

[CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) wraps modern CMake builtins to provide an intuitive interface for specifying dependencies within a CMake project that can be fetched and built automatically if they are not found. To include HepMC3 in your CMake project via CPM.cmake include something like:
[CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) wraps modern CMake builtins to provide an intuitive interface for
specifying dependencies within a CMake project that can be fetched and built automatically if they are not found.
To include HepMC3 in your CMake project via CPM.cmake include something like:

```
CPMAddPackage(
Expand All @@ -383,9 +393,12 @@ CPMAddPackage(

To use this version of HepMC3 in your CMake project, follow the [instructions above](#using-a-binary-distribution-of-hepmc3-in-your-cmake-project).

During the configuration step of your project, the HepMC3 source of the specified version will be fetched and its CMake project run and targets set up and exposed to your project such that the dependent build and installation is automatically run as required by your project targets.
During the configuration step of your project, the HepMC3 source of the specified version will be fetched and its
CMake project run and targets set up and exposed to your project such that the dependent build and installation
is automatically run as required by your project targets.

You can optionally try and find an existing HepMC3 installation, rather than build a dependent one, by using `CPMFindPackage` instead of `CPMAddPackage`.
You can optionally try and find an existing HepMC3 installation, rather than build a dependent one, by using
`CPMFindPackage` instead of `CPMAddPackage`.

# Installation troubleshooting

Expand Down Expand Up @@ -514,7 +527,7 @@ python/root_includes.hpp.in
python/search_includes.hpp.in
```

The directory contain the files that are used to build a Python package and installation:
The directory contains the files that are used to build a Python package and installation:
```
python/src/__init__.py
python/src/search/__init__.py
Expand Down Expand Up @@ -544,7 +557,7 @@ The files in `test/` can be split in two groups:
./test/testIO4.cc
./test/inputIO4.root
```

The tests ib both directories can also serve as examples for usage of HepMC3.

7. The subdirectory `cmake/Modules` contains files needed for the CMake configuration
The subdirectory `cmake/Templates` contains templates needed for generation
Expand Down
13 changes: 3 additions & 10 deletions doc/doxygen/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -669,15 +669,8 @@ WARN_LOGFILE =
# with spaces.

INPUT = @CMAKE_CURRENT_SOURCE_DIR@/../ \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/mainpage.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/features.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/differences.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/modules.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/building.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/LHEF.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/search.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/ReaderFactory.txt \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/Python.txt
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/mainpage.md \
@CMAKE_CURRENT_SOURCE_DIR@/doxygen/full.md

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
Expand Down Expand Up @@ -800,7 +793,7 @@ FILTER_SOURCE_PATTERNS =
# This can be useful if you have a project on for instance GitHub and want reuse
# the introduction page also for the doxygen output.

USE_MDFILE_AS_MAINPAGE =
USE_MDFILE_AS_MAINPAGE = mainpage.md

#---------------------------------------------------------------------------
# configuration options related to source browsing
Expand Down
Loading

0 comments on commit 9bef5e5

Please sign in to comment.