davidchall / homebrew-hep

Homebrew tap for high energy physics
https://davidchall.github.io/homebrew-hep/
74 stars 31 forks source link

Installation issue with Herwig and hepmc output in Sherpa. #322

Closed dharmendergaur closed 1 year ago

dharmendergaur commented 1 year ago

Verification

What were you trying to do (and why)?

First of all, thanks a lot for this extension of brew. I just switched from Linux to Mac and was struggling with compilation of sherpa to set complier environment. I successfully installed sherpa with 'brew install sherpa' and trying to obtain a .hepmc file for an example of v+jet events. I also tried installing Herwig, but it was unsuccessful for me.

What happened (include all command output)?

During the Herwig installation, I believe THEPEG was configured properly but during herwig configuration the execution stops with this error: "Error: Failure while executing; patch -g 0 -f -p1 exited with 1. Here's the output: patching file 'src/defaults/decayers.in.in' 1 out of 1 hunks failed--saving rejects to 'src/defaults/decayers.in.in.rej'"

In Sherpa, the installation was successful and the calculations starts normally, but it fails to load the library 'libSherpaHepMCOutput.dylib' and throws missing module.

What did you expect to happen?

Since, there was no error during Sherpa installation, the hempc output should've been produced. I assume in Herwig it is the python3 issue. but I tried with changing shell environment to Python 2.7.18 using pyenv, but the issue was not resolved

Step-by-step reproduction instructions (by running brew commands)

Hepmc output in Sherpa

- I started with installation of Sherpa using 'brew install sherpa'.
- Sherpa was installed smoothly, with no warnings at all (last few lines are:)
==> Installing davidchall/hep/sherpa
==> ./configure --prefix=/opt/homebrew/Cellar/sherpa/2.2.15_1 --enable-analysis --enable-gzip --with-sqlite3=/opt/homebrew/opt/sqlite --enable-fastjet=/opt/home
==> make
==> make install
🍺  /opt/homebrew/Cellar/sherpa/2.2.15_1: 955 files, 47MB, built in 3 minutes 31 seconds
==> Running `brew cleanup sherpa`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

- I started running my run.dat file which was working perfectly in Ubuntu, and executed the command: " /opt/homebrew/bin/Sherpa -f Run.dat" and throws back:

Grid_Creator::CreateGridInternal: Initializing grid for MI.
   99 % ( 69 s elapsed / 0 s left / 70 s total )    
}
Simple_Chain::CalculateTotal(): Result is {
   \sigma_{hard} = 40.0579 mb
   at PT_{min} = 4.74183 GeV
}
Profile_Function_Base::CalculateOMean(2.33328): Results are {
   k           = 7.21211
   <\tilde{O}> = 0.323522
}
Initialized the Multiple_Interactions_Handler (MI_Handler).
Initialized the Soft_Photon_Handler.
Library_Loader::LoadLibrary(): Failed to load library 'libSherpaHepMCOutput.dylib'.
Sherpa: Initialization_Handler::InitializeTheIO throws missing module: 
   Cannot load output library SherpaHepMCOutput.
------------------------------------------------------------------------
Please cite the publications listed in 'Sherpa_References.tex'.
  Extract the bibtex list by running 'get_bibtex Sherpa_References.tex'
  or email the file to 'slaclib2@slac.stanford.edu', subject 'generate'.
------------------------------------------------------------------------
Exception_Handler::Exit: Exiting Sherpa with code (1)

- I tried multiple times but still it shows the same error.

Installation of Herwig:

- I started with brew install herwig, which started downloading source files
- It showed some minor warnings like: unused variables, hessian2replicas.cc:484:15: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]

- In the end, it ended with:

==> Fetching davidchall/hep/herwig
==> Downloading https://herwig.hepforge.org/downloads/Herwig-7.2.3.tar.bz2
Already downloaded: /Users/dharmender/Library/Caches/Homebrew/downloads/0c8585fcf7a5531696f152f6ee8a59d0566bb7619b6778da9eb051c471a9f8d9--Herwig-7.2.3.tar.bz2
==> Installing herwig from davidchall/hep
==> Patching
Error: Failure while executing; `patch -g 0 -f -p1` exited with 1. Here's the output:
patching file 'src/defaults/decayers.in.in'
1 out of 1 hunks failed--saving rejects to 'src/defaults/decayers.in.in.rej'

brew gist-logs <formula> link OR brew config AND brew doctor output

dharmender@Dharmenders-MacBook-Air sherpa_home % brew config
HOMEBREW_VERSION: 4.0.20
ORIGIN: https://github.com/Homebrew/brew
HEAD: 8917acac9560f8e2846eedc4181470f0345f6db8
Last commit: 6 days ago
Core tap JSON: 05 Jun 18:52 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.10 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 14.0.3 build 1403
Git: 2.39.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.88.1 => /usr/bin/curl
macOS: 13.4-arm64
CLT: 14.3.1.0.1.1683849156
Xcode: 14.3.1
Rosetta 2: false

dharmender@Dharmenders-MacBook-Air sherpa_home % brew doctor 
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
  /usr/local/lib/libLHAPDF.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/LHAPDF/AlphaS.h
  /usr/local/include/LHAPDF/BicubicInterpolator.h
  /usr/local/include/LHAPDF/BilinearInterpolator.h
  /usr/local/include/LHAPDF/Config.h
  /usr/local/include/LHAPDF/ContinuationExtrapolator.h
  /usr/local/include/LHAPDF/ErrExtrapolator.h
  /usr/local/include/LHAPDF/Exceptions.h
  /usr/local/include/LHAPDF/Extrapolator.h
  /usr/local/include/LHAPDF/Factories.h
  /usr/local/include/LHAPDF/FileIO.h
  /usr/local/include/LHAPDF/GridPDF.h
  /usr/local/include/LHAPDF/Info.h
  /usr/local/include/LHAPDF/Interpolator.h
  /usr/local/include/LHAPDF/KnotArray.h
  /usr/local/include/LHAPDF/LHAGlue.h
  /usr/local/include/LHAPDF/LHAPDF.h
  /usr/local/include/LHAPDF/LogBicubicInterpolator.h
  /usr/local/include/LHAPDF/LogBilinearInterpolator.h
  /usr/local/include/LHAPDF/NearestPointExtrapolator.h
  /usr/local/include/LHAPDF/PDF.h
  /usr/local/include/LHAPDF/PDFIndex.h
  /usr/local/include/LHAPDF/PDFInfo.h
  /usr/local/include/LHAPDF/PDFSet.h
  /usr/local/include/LHAPDF/Paths.h
  /usr/local/include/LHAPDF/Reweighting.h
  /usr/local/include/LHAPDF/Utils.h
  /usr/local/include/LHAPDF/Version.h

Warning: Unbrewed '.la' files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.la' files:
  /usr/local/lib/libLHAPDF.la

Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected '.pc' files:
  /usr/local/lib/pkgconfig/lhapdf.pc

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
  /usr/local/lib/libLHAPDF.a
davidchall commented 1 year ago

Hi @dharmendergaur,

Thanks for raising this Herwig bug. I've fixed it, so please retry the installation.

Based on the Sherpa error message, I think you were attempting to use the HepMC2 interface. However, the Sherpa formula previously only had support for the HepMC3 interface. I've added an optional dependency for HepMC2, so you should now be able to run your existing parameter file after installing with brew install sherpa --with-hepmc2. Alternatively, you can update the output to HepMC3.

dharmendergaur commented 1 year ago

Hi David, Thanks a lot for the update. I am finally able to run both herwig and sherpa in MAC OS, I switched to Ubuntu after failing multiple times. Thanks a lot for your help! Quick question tho, I am not sure whether the issue is with the installation or not, but somehow when I analyze the hepmc output from herwig with RIVET, it fails to analyse all the events. For example, for a hepmc file storing 500k events, the analysis breaks down at 200k-250k with this error:

ERROR:: ReaderAsciiHepMC2:

HEPMC3_ERROR parsing

ERROR ::ReaderAsciiHepMC2:

particle

information

event parsing failed. Returning empty event

DEBUG (1):: Parsing

failed

at line:

P 11169 22 88542893916947543e-02 -2.6

On the other hand, when I run the same code with the same setup on my Ubuntu system, it analyzes all the 500k events without any issue. Can you give me some insight regarding what could be causing this?

Again thanks for your help, Dharmender

davidchall commented 1 year ago

I notice your message mentions both HepMC2 and HepMC3, so it might be caused by a conflict in output formats. This is about using the package though, so you might get better support from the package developers.

dharmendergaur commented 1 year ago

Thank you for your quick response. I will try to configure both Herwig and rivet with the same hepmc version and check if that works. Thank you for the tip,

Thanking you, Dharmender

On Fri, Oct 20, 2023 at 11:37 AM David C Hall @.***> wrote:

I notice your message mentions both HepMC2 and HepMC3, so it might be caused by a conflict in output formats. This is about using the package though, so you might get better support from the package developers.

— Reply to this email directly, view it on GitHub https://github.com/davidchall/homebrew-hep/issues/322#issuecomment-1772137329, or unsubscribe https://github.com/notifications/unsubscribe-auth/A2WQANO7K62JPBDIMZC2K5LYAIIKPAVCNFSM6AAAAAAY4AYSICVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZSGEZTOMZSHE . You are receiving this because you were mentioned.Message ID: @.***>