New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pythonPackages.geant4: init at 10.6.2 #89688
Conversation
Starting geant4 10.6.2 g4py can not be built separately http://geant4-data.web.cern.ch/geant4-data/ReleaseNotes/Patch4.10.6-2.txt Also, it appears that g4py itself is now deprecated, it was moved to environments/g4py/tests/g4pytest in the source distribution. The only remaining imported module is Geant4, hence python package name `pythonPackages.geant4`, the capitalization matches the one of the non-python attribute.
@GrahamcOfBorg build geant4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few things I don't understand about changes to the build. But, clearly, the python bindings aren't something that I use day to day, so I might just not be familiar enough with them. Can you please clarify?
@@ -44,6 +53,16 @@ stdenv.mkDerivation rec { | |||
sha256 = "0vznm3pjlbihjy1wsxc4gj229k0dzc283wvil2xghyl08vwdpnpc"; | |||
}; | |||
|
|||
boost_python_lib = "python${builtins.replaceStrings ["."] [""] python3.pythonVersion}"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a widely known thing. But it's the first time I've encountered these particular "make boost work with python" incantations. Can you add a comment explaining? Or is this just something that everyone who needs to know already knows / explained elsewhere?
Specifically, I'm curious because this is different from the previous version in the g4py/default.nix file:
postPatch = ''
cd environments/g4py
'';
preConfigure = ''
# Fix for boost 1.67+
substituteInPlace CMakeLists.txt \
--replace "find_package(Boost)" "find_package(Boost 1.40 REQUIRED COMPONENTS python${builtins.replaceStrings ["."] [""] python.pythonVersion})"
for f in `find . -name CMakeLists.txt`; do
substituteInPlace "$f" \
--replace "boost_python" "\''${Boost_LIBRARIES}"
done
'';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a known breaking change in boost. With respect to upstream this is https://bugzilla-geant4.kek.jp/show_bug.cgi?id=2059
"-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}" | ||
"-DGEANT4_USE_SYSTEM_CLHEP=${if clhep != null then "ON" else "OFF"}" | ||
"-DGEANT4_USE_SYSTEM_EXPAT=${if expat != null then "ON" else "OFF"}" | ||
"-DGEANT4_USE_SYSTEM_ZLIB=${if zlib != null then "ON" else "OFF"}" | ||
"-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}" | ||
] ++ stdenv.lib.optionals (enableMultiThreading && enablePython) [ | ||
"-DGEANT4_BUILD_TLS_MODEL=global-dynamic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment explaining why this is required? Does the thread local storage just not work unless it's flagged as global-dynamic? This also isn't in the original file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes building with both MT and Python. This is taken from the 10.6.2 release notes (link in the commit message, see first bullet). If you don't do this, the build won't configure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me then.
Starting geant4 10.6.2 g4py can not be built separately
http://geant4-data.web.cern.ch/geant4-data/ReleaseNotes/Patch4.10.6-2.txt
Also, it appears that g4py itself is now deprecated, it was moved
to environments/g4py/tests/g4pytest in the source distribution. The only
remaining imported module is Geant4, hence python package name
pythonPackages.geant4
, the capitalization matches the one of the non-pythonattribute.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)