diff options
author | Adrian Kummerlaender | 2019-10-21 18:42:24 +0200 |
---|---|---|
committer | Adrian Kummerlaender | 2019-10-21 18:48:38 +0200 |
commit | 82a44e0d64afb8818ea98d68dc08108885d503c2 (patch) | |
tree | 6e8f08acd83b2886cd296ed3831acc83e309906c /shell.nix | |
download | boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.tar boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.tar.gz boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.tar.bz2 boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.tar.lz boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.tar.xz boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.tar.zst boltzgen-82a44e0d64afb8818ea98d68dc08108885d503c2.zip |
Pull in basics from symlbm_playground
It's time to extract the generator-part of my GPU LBM playground and turn it
into a nice reusable library. The goal is to produce a framework that can be
used to generate collision and streaming programs from symbolic descriptions.
i.e. it should be possible to select a LB model, the desired boundary
conditions as well as a data structure / streaming model and use this
information to automatically generate matching OpenCL / CUDA / C++
programs.
Diffstat (limited to 'shell.nix')
-rw-r--r-- | shell.nix | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..b91c772 --- /dev/null +++ b/shell.nix @@ -0,0 +1,62 @@ +{ pkgs ? import <nixpkgs> { }, ... }: + +pkgs.stdenvNoCC.mkDerivation rec { + name = "boltzgen-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 python37Packages.pybind11 + libGLU_combined + ]; + # Enable OpenGL integration and fix build + preBuild = '' + python configure.py --cl-enable-gl + export HOME=/tmp/pyopencl + ''; + }); + }; + in pkgs.python3.override { inherit packageOverrides; }; + + pyevtk = pkgs.python3.pkgs.buildPythonPackage rec { + pname = "PyEVTK"; + version = "1.2.1"; + + src = pkgs.fetchFromGitHub { + owner = "paulo-herrera"; + repo = "PyEVTK"; + rev = "v1.2.1"; + sha256 = "1p2459dqvgakywvy5d31818hix4kic6ks9j4m582ypxyk5wj1ksz"; + }; + + buildInputs = with pkgs.python37Packages; [ + numpy + ]; + + doCheck = false; + }; + + local-python = custom-python.withPackages (python-packages: with python-packages; [ + numpy + sympy + pyopencl + pyopengl + pyrr + Mako + pyevtk + ]); + + in [ + local-python + pkgs.opencl-info + ]; + + shellHook = '' + export NIX_SHELL_NAME="${name}" + export PYOPENCL_COMPILER_OUTPUT=1 + export PYTHONPATH="$PWD/boltzgen:$PYTHONPATH" + ''; +} |