mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-10-07 04:57:26 +03:00
Merge pull request #308497 from guitargeek/root_clad
root: enable `clad` for automatic differentiation and clean CMake flags
This commit is contained in:
commit
a94aef18bd
@ -1,6 +1,7 @@
|
|||||||
{ stdenv
|
{ stdenv
|
||||||
, lib
|
, lib
|
||||||
, callPackage
|
, callPackage
|
||||||
|
, fetchgit
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, fetchpatch
|
, fetchpatch
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
@ -68,6 +69,12 @@ stdenv.mkDerivation rec {
|
|||||||
hash = "sha256-MA237RtnjtL7ljXKZ1khoZRcfCED2oQAM7STCR9VcAw=";
|
hash = "sha256-MA237RtnjtL7ljXKZ1khoZRcfCED2oQAM7STCR9VcAw=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clad_src = fetchgit {
|
||||||
|
url = "https://github.com/vgvassilev/clad";
|
||||||
|
rev = "refs/tags/v1.4"; # Make sure that this is the same tag as in the ROOT build files!
|
||||||
|
hash = "sha256-OI9PaS7kQ/ewD5Soe3gG5FZdlR6qG6Y3mfHwi5dj1sI=";
|
||||||
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
|
nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
@ -131,6 +138,23 @@ stdenv.mkDerivation rec {
|
|||||||
substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \
|
substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \
|
||||||
--replace 'set(lcgpackages ' '#set(lcgpackages '
|
--replace 'set(lcgpackages ' '#set(lcgpackages '
|
||||||
|
|
||||||
|
# We have to bypass the connection check, because it would disable clad.
|
||||||
|
# This should probably be fixed upstream with a flag to disable the
|
||||||
|
# connectivity check!
|
||||||
|
substituteInPlace CMakeLists.txt \
|
||||||
|
--replace 'if(NO_CONNECTION)' 'if(FALSE)'
|
||||||
|
substituteInPlace interpreter/cling/tools/plugins/CMakeLists.txt \
|
||||||
|
--replace 'if(NOT DEFINED NO_CONNECTION OR NOT NO_CONNECTION)' 'if(TRUE)'
|
||||||
|
# Make sure that clad is not downloaded when building
|
||||||
|
substituteInPlace interpreter/cling/tools/plugins/clad/CMakeLists.txt \
|
||||||
|
--replace 'UPDATE_COMMAND ""' 'SOURCE_DIR ${clad_src} DOWNLOAD_COMMAND "" UPDATE_COMMAND ""'
|
||||||
|
# Make sure that clad is finding the right llvm version
|
||||||
|
substituteInPlace interpreter/cling/tools/plugins/clad/CMakeLists.txt \
|
||||||
|
--replace '-DLLVM_DIR=''${LLVM_BINARY_DIR}' '-DLLVM_DIR=${llvm_13.dev}/lib/cmake/llvm'
|
||||||
|
# Fix that will also be upstream in ROOT 6.32. TODO: remove it when updating to 6.32
|
||||||
|
substituteInPlace interpreter/cling/tools/plugins/clad/CMakeLists.txt \
|
||||||
|
--replace 'set(_CLAD_LIBRARY_PATH ''${clad_install_dir}/plugins/lib)' 'set(_CLAD_LIBRARY_PATH ''${CMAKE_CURRENT_BINARY_DIR}/clad-prefix/src/clad-build/lib''${LLVM_LIBDIR_SUFFIX})'
|
||||||
|
|
||||||
substituteInPlace interpreter/llvm-project/clang/tools/driver/CMakeLists.txt \
|
substituteInPlace interpreter/llvm-project/clang/tools/driver/CMakeLists.txt \
|
||||||
--replace 'add_clang_symlink(''${link} clang)' ""
|
--replace 'add_clang_symlink(''${link} clang)' ""
|
||||||
|
|
||||||
@ -151,40 +175,18 @@ stdenv.mkDerivation rec {
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-Drpath=ON"
|
|
||||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||||
"-DCMAKE_INSTALL_LIBDIR=lib"
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
||||||
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
"-DCMAKE_INSTALL_INCLUDEDIR=include"
|
||||||
"-Dbuiltin_llvm=OFF"
|
"-Dbuiltin_llvm=OFF"
|
||||||
"-Dbuiltin_freetype=OFF"
|
|
||||||
"-Dbuiltin_gtest=OFF"
|
|
||||||
"-Dbuiltin_nlohmannjson=OFF"
|
|
||||||
"-Dbuiltin_openui5=ON"
|
|
||||||
"-Dclad=OFF"
|
|
||||||
"-Ddavix=ON"
|
|
||||||
"-Ddcache=OFF"
|
|
||||||
"-Dfail-on-missing=ON"
|
"-Dfail-on-missing=ON"
|
||||||
"-Dfftw3=OFF"
|
|
||||||
"-Dfitsio=OFF"
|
"-Dfitsio=OFF"
|
||||||
"-Dfortran=OFF"
|
|
||||||
"-Dgnuinstall=ON"
|
"-Dgnuinstall=ON"
|
||||||
"-Dimt=ON"
|
|
||||||
"-Dgviz=OFF"
|
|
||||||
"-Dhttp=ON"
|
|
||||||
"-Dmysql=OFF"
|
"-Dmysql=OFF"
|
||||||
"-Dodbc=OFF"
|
|
||||||
"-Dopengl=ON"
|
|
||||||
"-Dpgsql=OFF"
|
"-Dpgsql=OFF"
|
||||||
"-Dpythia8=OFF"
|
|
||||||
"-Droot7=ON"
|
|
||||||
"-Dsqlite=OFF"
|
"-Dsqlite=OFF"
|
||||||
"-Dssl=ON"
|
|
||||||
"-Dtmva=ON"
|
|
||||||
"-Dtmva-pymva=OFF"
|
"-Dtmva-pymva=OFF"
|
||||||
"-Dvdt=OFF"
|
"-Dvdt=OFF"
|
||||||
"-Dwebgui=ON"
|
|
||||||
"-Dxml=ON"
|
|
||||||
"-Dxrootd=ON"
|
|
||||||
]
|
]
|
||||||
++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
|
++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
|
||||||
++ lib.optionals stdenv.isDarwin [
|
++ lib.optionals stdenv.isDarwin [
|
||||||
@ -195,6 +197,9 @@ stdenv.mkDerivation rec {
|
|||||||
"-Druntime_cxxmodules=OFF"
|
"-Druntime_cxxmodules=OFF"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# suppress warnings from compilation of the vendored clang to avoid running into log limits on the Hydra
|
||||||
|
NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-Wno-shadow" "-Wno-maybe-uninitialized" ];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
|
for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
|
||||||
wrapProgram "$out/bin/$prog" \
|
wrapProgram "$out/bin/$prog" \
|
||||||
@ -251,7 +256,7 @@ stdenv.mkDerivation rec {
|
|||||||
setupHook = ./setup-hook.sh;
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://root.cern.ch/";
|
homepage = "https://root.cern/";
|
||||||
description = "A data analysis framework";
|
description = "A data analysis framework";
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = [ maintainers.guitargeek maintainers.veprbl ];
|
maintainers = [ maintainers.guitargeek maintainers.veprbl ];
|
||||||
|
@ -12,8 +12,8 @@ thisroot () {
|
|||||||
|
|
||||||
postHooks+=(thisroot)
|
postHooks+=(thisroot)
|
||||||
|
|
||||||
addRootInludePath() {
|
addRootIncludePath() {
|
||||||
addToSearchPath ROOT_INCLUDE_PATH $1/include
|
addToSearchPath ROOT_INCLUDE_PATH $1/include
|
||||||
}
|
}
|
||||||
|
|
||||||
addEnvHooks "$targetOffset" addRootInludePath
|
addEnvHooks "$targetOffset" addRootIncludePath
|
||||||
|
@ -48,7 +48,7 @@ diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake
|
|||||||
#---Set Linker flags----------------------------------------------------------------------
|
#---Set Linker flags----------------------------------------------------------------------
|
||||||
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION}")
|
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION}")
|
||||||
else (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
else (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
||||||
MESSAGE(FATAL_ERROR "There is no setup for this this Apple system up to now. Don't know waht to do. Stop cmake at this point.")
|
MESSAGE(FATAL_ERROR "There is no setup for this this Apple system up to now. Don't know what to do. Stop cmake at this point.")
|
||||||
endif (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
endif (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
||||||
diff a/config/root-config.in b/config/root-config.in
|
diff a/config/root-config.in b/config/root-config.in
|
||||||
--- a/config/root-config.in
|
--- a/config/root-config.in
|
||||||
|
Loading…
Reference in New Issue
Block a user