CLHEP issueshttps://gitlab.cern.ch/CLHEP/CLHEP/-/issues2023-08-23T20:44:58+02:00https://gitlab.cern.ch/CLHEP/CLHEP/-/issues/4Make HepRandomEngine std conformant (improvement)2023-08-23T20:44:58+02:00Vincenzo InnocenteMake HepRandomEngine std conformant (improvement)I suggest to make HepRandomEngine interface conformant to std::random.
as example I coded this simple wrapper
```
#include <cstdint>
#include <limits>
#include <cstring>
#include "CLHEP/Random/RandomEngine.h"
// a wrapper to make a He...I suggest to make HepRandomEngine interface conformant to std::random.
as example I coded this simple wrapper
```
#include <cstdint>
#include <limits>
#include <cstring>
#include "CLHEP/Random/RandomEngine.h"
// a wrapper to make a HepRandomEngine std conformant
class CLHEP2STDRandom {
public:
using result_type = uint64_t;
CLHEP2STDRandom(CLHEP::HepRandomEngine & engine) : m_engine(engine) {}
// MixMax is limited to 61 bits (and will reimplement operator() to return getNext() )
static constexpr result_type u61 = std::numeric_limits<result_type>::max() >> (64-61);
// to be overridden by those who generate uint64_t natively...
virtual result_type operator()() {
uint64_t u1 = uint32_t(*this);
uint64_t u2 = uint32_t(*this);;
u1 <<=32;
return u1 | u2;
}
static constexpr result_type min() { return 0; } // actually 1??
static constexpr result_type max() { return u61; }
private:
CLHEP::HepRandomEngine & m_engine;
};
```
There are of course two limitations:
1) It assumes all CLHEP generators to have at least 53 bits of "entropy"
2) Cannot "export" more than 53 bits with the current interface of HepRandomEngine
Lifting these limitations making all CLHEP generators able to provide a guaranteed number of random bits larger than 53 would be of course ideal.https://gitlab.cern.ch/CLHEP/CLHEP/-/issues/3Out Of Source Check Doesn't Work as Intended2022-06-09T20:08:46+02:00Laurence James NevayOut Of Source Check Doesn't Work as IntendedPlease use JIRA for CLHEP issues. -> I posted on there last year and was told to post here... so no idea which is the right place. I'll start here..
I get a wrong error message about making an in-source build. In part this is due to m...Please use JIRA for CLHEP issues. -> I posted on there last year and was told to post here... so no idea which is the right place. I'll start here..
I get a wrong error message about making an in-source build. In part this is due to my preferences, but it is a bug in the cmake.
When we download clhep from the website as a tar.gz we get
```CLHEP/2.4.5.2/<real source code>```
I move the 2.4.5.2 dir to
```clhep-2.4.5.2```
As I have other software apart from clhep and it makes sense for it be labelled including the package name. Also, I can't have multiple CLHEP directories in the same directory. I go for the the (fairly standard) cmake pattern of directories:
packagename
packagename-build
packagename-install
So I have
```
/Users/nevay/physics/packages/clhep-2.4.5.2
/Users/nevay/physics/packages/clhep-2.4.5.2-build
/Users/nevay/physics/packages/clhep-2.4.5.2-install
```
If I go to build and try to run cmake it gives me an error that I'm doing an in-source build. This is wrong. The bug is in ClhepOutOfSourceBuild.cmake. It searches for the CMAKE_SOURCE_DIR string in the CMAKE_BINARY_DIR string (or equal) and it finds it, therefore initiates the fatal error. This should be fixed.
Obviously, I can just rename my directory something different to get around this, but probably should be fixed.
Cheers,
Lauriehttps://gitlab.cern.ch/CLHEP/CLHEP/-/issues/2Installation fails2021-07-06T17:49:14+02:00Paolo BaessoInstallation failsHi,
I am following the "readme" instructions to install the code on my machine.
I checked out the code into `~/CLHEP_source/CLHEP` and would like to build into `~/CLHEP`.
All steps complete without problems, ctest shows that everything ...Hi,
I am following the "readme" instructions to install the code on my machine.
I checked out the code into `~/CLHEP_source/CLHEP` and would like to build into `~/CLHEP`.
All steps complete without problems, ctest shows that everything passed. However when I do:
`cmake --build . --target install`
I get the following error:
`-- Up-to-date: /home/phpgb/CLHEP/include/CLHEP/Geometry/Vector3D.h`
`CMake Error at Geometry/src/cmake_install.cmake:42 (file):`
` file INSTALL cannot find`
` "/home/phpgb/CLHEP/lib/libCLHEP-Geometry-2.4.1.0.so".`
`Call Stack (most recent call first):`
` Geometry/cmake_install.cmake:42 (include)`
` cmake_install.cmake:196 (include)`
Any idea about what is going wrong?https://gitlab.cern.ch/CLHEP/CLHEP/-/issues/1problem with linking clhep-libraries with g++2018-01-24T19:57:53+01:00Mathias Wagnerproblem with linking clhep-libraries with g++**Operating system:**
CentOS Linux release 7.4.1708 (Core)
**Problem description:**
I experienced a problem with ``clhep-config --libs`` and ``clhep-config --include``. I wrote a very simple test example of a c++-code that basically do...**Operating system:**
CentOS Linux release 7.4.1708 (Core)
**Problem description:**
I experienced a problem with ``clhep-config --libs`` and ``clhep-config --include``. I wrote a very simple test example of a c++-code that basically does nothing. When I wanted to compile the code with loading the clhep-libraries (still without using any of its functionality in the code), I got the following error message:
Input: `g++ -std=c++11 $(clhep-config --libs) -o test.exe test.cc`
Error: `/usr/bin/ld: cannot find -lCLHEP-2.4.0.1
collect2: error: ld returned 1 exit status`
**Finding the solution:**
When I look at the output of `clhep-config --libs` yielding `-L"/localhome/wagner/Tools/clhep/install/lib" -lCLHEP-2.4.0.1`, and insert this instead everything works:
Input: `g++ -std=c++11 -L"/localhome/wagner/Tools/clhep/install/lib" -lCLHEP-2.4.0.1 -o test.exe test.cc`
When looking at both expressions with `echo`, the difference is that the quotation marks (") in the first case are still present, while they are gone in the second version.
**Working solution:**
Open the ``clhep-config`` file and go to the line
`` --libs)
echo -L\"${libdir}\" -lCLHEP-2.4.0.1 ``
And remove both `\"`:
`` --libs)
echo -L${libdir} -lCLHEP-2.4.0.1 ``
**Same solution for `clhep-config --include`**
Also remove the quotation marks in line:
` --include)
echo -I\"${includedir}\"`
**Working code:**
After these changes the following line worked without errors (now also including some CLHEP-classes inside the test-code):
`g++ -std=c++11 $(clhep-config --libs) $(clhep-config --include) -o test.exe test.cc`