summaryrefslogtreecommitdiff
path: root/shell.nix
diff options
context:
space:
mode:
authorAdrian Kummerlaender2021-03-27 22:35:43 +0100
committerAdrian Kummerlaender2021-03-27 22:35:43 +0100
commit75ef8db0d058158c10951a4184186f8c6cc27acc (patch)
tree03a33785b65472fc5eff9cc5d2c03379747b83d4 /shell.nix
downloadinteracticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar
interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.gz
interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.bz2
interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.lz
interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.xz
interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.tar.zst
interacticle-75ef8db0d058158c10951a4184186f8c6cc27acc.zip
Initial public commit of this basic MD code
Simulation of interacting particles
Diffstat (limited to 'shell.nix')
-rw-r--r--shell.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
new file mode 100644
index 0000000..625f7ea
--- /dev/null
+++ b/shell.nix
@@ -0,0 +1,46 @@
+{ pkgs ? import <nixpkgs> { }, ... }:
+
+pkgs.stdenvNoCC.mkDerivation rec {
+ name = "pycl-env";
+ env = pkgs.buildEnv { name = name; paths = buildInputs; };
+
+ buildInputs = let
+ custom-python = let
+ packageOverrides = self: super: {
+ pyopencl = super.pyopencl.overridePythonAttrs(old: rec {
+ buildInputs = with pkgs; [
+ opencl-headers ocl-icd
+ python38Packages.pybind11
+ libGL
+ libGLU
+ ];
+ # Enable OpenGL integration and fix build
+ preBuild = ''
+ python configure.py --cl-enable-gl
+ export HOME=/tmp/pyopencl
+ '';
+ });
+ };
+ in pkgs.python3.override { inherit packageOverrides; };
+
+ local-python = custom-python.withPackages (python-packages: with python-packages; [
+ numpy
+ scipy
+ pyopencl setuptools
+ pyopengl pyrr
+ matplotlib
+ ]);
+
+ in [
+ local-python
+ pkgs.opencl-info
+ pkgs.universal-ctags
+ ];
+
+ shellHook = ''
+ export NIX_SHELL_NAME="${name}"
+ export PYTHONPATH="$PWD/interacticle:$PYTHONPATH"
+ export PYOPENCL_COMPILER_OUTPUT=1
+ export PYTHONDONTWRITEBYTECODE=1
+ '';
+}