Loading pkgs/applications/science/molecular-dynamics/lammps/default.nix +9 −5 Original line number Diff line number Diff line Loading @@ -75,8 +75,9 @@ stdenv.mkDerivation (finalAttrs: { inherit extraBuildInputs; }; cmakeFlags = [ (lib.cmakeBool "BUILD_SHARED_LIBS" true) ] ++ (builtins.map (p: "-DPKG_${p}=ON") (builtins.attrNames (lib.filterAttrs (n: v: v) packages))) ++ (lib.mapAttrsToList (n: v: lib.cmakeBool "PKG_${n}" v) packages) ++ (lib.mapAttrsToList (n: v: "-D${n}=${v}") extraCmakeFlags) ; Loading @@ -99,7 +100,7 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/share/vim-plugins/lammps $out/share/nvim/site ''; meta = with lib; { meta = { description = "Classical Molecular Dynamics simulation code"; longDescription = '' LAMMPS is a classical molecular dynamics simulation code designed to Loading @@ -109,13 +110,16 @@ stdenv.mkDerivation (finalAttrs: { under the terms of the GNU Public License (GPL). ''; homepage = "https://www.lammps.org"; license = licenses.gpl2Only; platforms = platforms.linux; license = lib.licenses.gpl2Only; platforms = lib.platforms.linux; # compiling lammps with 64 bit support blas and lapack might cause runtime # segfaults. In anycase both blas and lapack should have the same #bits # support. broken = (blas.isILP64 && lapack.isILP64); maintainers = [ maintainers.costrouc maintainers.doronbehar ]; maintainers = with lib.maintainers; [ costrouc doronbehar ]; mainProgram = "lmp"; }; }) pkgs/development/python-modules/lammps/default.nix 0 → 100644 +46 −0 Original line number Diff line number Diff line { lib, lammps, stdenv, buildPythonPackage, }: let LAMMPS_SHARED_LIB = "${lib.getLib lammps}/lib/liblammps${stdenv.hostPlatform.extensions.library}"; in buildPythonPackage { inherit (lammps) pname version src; env = { inherit LAMMPS_SHARED_LIB; }; preConfigure = '' cd python # Upstream assumes that the shared library is located in the same directory # as the core.py file. We want to separate the shared library (built by # cmake) and the Python library, so we perform this substitution: substituteInPlace lammps/core.py \ --replace-fail \ "from inspect import getsourcefile" \ "getsourcefile = lambda f: \"${LAMMPS_SHARED_LIB}\"" ''; pythonImportsCheck = [ "lammps" "lammps.pylammps" ]; # We could potentially run other examples, but some of them are so old that # they don't run with nowadays' LAMMPS. This one is simple enough and recent # enough and it works. checkPhase = '' python examples/mc.py examples/in.mc ''; meta = { description = "Python Bindings for LAMMPS"; homepage = "https://docs.lammps.org/Python_head.html"; inherit (lammps.meta) license; maintainers = with lib.maintainers; [ doronbehar ]; }; } pkgs/top-level/python-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -6744,6 +6744,10 @@ self: super: with self; { lakeside = callPackage ../development/python-modules/lakeside { }; lammps = callPackage ../development/python-modules/lammps { inherit (pkgs) lammps; }; lancedb = callPackage ../development/python-modules/lancedb { }; langchain = callPackage ../development/python-modules/langchain { }; Loading Loading
pkgs/applications/science/molecular-dynamics/lammps/default.nix +9 −5 Original line number Diff line number Diff line Loading @@ -75,8 +75,9 @@ stdenv.mkDerivation (finalAttrs: { inherit extraBuildInputs; }; cmakeFlags = [ (lib.cmakeBool "BUILD_SHARED_LIBS" true) ] ++ (builtins.map (p: "-DPKG_${p}=ON") (builtins.attrNames (lib.filterAttrs (n: v: v) packages))) ++ (lib.mapAttrsToList (n: v: lib.cmakeBool "PKG_${n}" v) packages) ++ (lib.mapAttrsToList (n: v: "-D${n}=${v}") extraCmakeFlags) ; Loading @@ -99,7 +100,7 @@ stdenv.mkDerivation (finalAttrs: { ln -s $out/share/vim-plugins/lammps $out/share/nvim/site ''; meta = with lib; { meta = { description = "Classical Molecular Dynamics simulation code"; longDescription = '' LAMMPS is a classical molecular dynamics simulation code designed to Loading @@ -109,13 +110,16 @@ stdenv.mkDerivation (finalAttrs: { under the terms of the GNU Public License (GPL). ''; homepage = "https://www.lammps.org"; license = licenses.gpl2Only; platforms = platforms.linux; license = lib.licenses.gpl2Only; platforms = lib.platforms.linux; # compiling lammps with 64 bit support blas and lapack might cause runtime # segfaults. In anycase both blas and lapack should have the same #bits # support. broken = (blas.isILP64 && lapack.isILP64); maintainers = [ maintainers.costrouc maintainers.doronbehar ]; maintainers = with lib.maintainers; [ costrouc doronbehar ]; mainProgram = "lmp"; }; })
pkgs/development/python-modules/lammps/default.nix 0 → 100644 +46 −0 Original line number Diff line number Diff line { lib, lammps, stdenv, buildPythonPackage, }: let LAMMPS_SHARED_LIB = "${lib.getLib lammps}/lib/liblammps${stdenv.hostPlatform.extensions.library}"; in buildPythonPackage { inherit (lammps) pname version src; env = { inherit LAMMPS_SHARED_LIB; }; preConfigure = '' cd python # Upstream assumes that the shared library is located in the same directory # as the core.py file. We want to separate the shared library (built by # cmake) and the Python library, so we perform this substitution: substituteInPlace lammps/core.py \ --replace-fail \ "from inspect import getsourcefile" \ "getsourcefile = lambda f: \"${LAMMPS_SHARED_LIB}\"" ''; pythonImportsCheck = [ "lammps" "lammps.pylammps" ]; # We could potentially run other examples, but some of them are so old that # they don't run with nowadays' LAMMPS. This one is simple enough and recent # enough and it works. checkPhase = '' python examples/mc.py examples/in.mc ''; meta = { description = "Python Bindings for LAMMPS"; homepage = "https://docs.lammps.org/Python_head.html"; inherit (lammps.meta) license; maintainers = with lib.maintainers; [ doronbehar ]; }; }
pkgs/top-level/python-packages.nix +4 −0 Original line number Diff line number Diff line Loading @@ -6744,6 +6744,10 @@ self: super: with self; { lakeside = callPackage ../development/python-modules/lakeside { }; lammps = callPackage ../development/python-modules/lammps { inherit (pkgs) lammps; }; lancedb = callPackage ../development/python-modules/lancedb { }; langchain = callPackage ../development/python-modules/langchain { }; Loading