From dc49b59e407996037ee3116f110f04de7cf9bf0b Mon Sep 17 00:00:00 2001 From: Adrien Devresse Date: Mon, 9 Oct 2017 13:38:42 +0200 Subject: [PATCH] Update STEPS build recipe fir BGQ and add all necessary components for pylab into default python environment --- bbp/hpc/steps/default.nix | 14 ++++++- bbp/modules/default.nix | 5 +++ bluegene/bg-pythonPackages/default.nix | 7 +++- .../bg-pythonPackages/matplotlib/default.nix | 40 +++++++++++++++++++ .../bg-pythonPackages/python-packages.nix | 4 +- 5 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 bluegene/bg-pythonPackages/matplotlib/default.nix diff --git a/bbp/hpc/steps/default.nix b/bbp/hpc/steps/default.nix index a643d26c31..3d7f42bfc8 100644 --- a/bbp/hpc/steps/default.nix +++ b/bbp/hpc/steps/default.nix @@ -58,16 +58,28 @@ stdenv.mkDerivation rec { preConfigure = '' # 42 dude ! export CC=mpicc - export CXX=mpicxx + export CXX=mpic++ export CXXFLAGS="-pthread -D__STDC_CONSTANT_MACROS" + + '' + (stdenv.lib.optionalString) (stdenv ? isBlueGene) '' + echo "enable BGQ specific tuning " ''; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=mpic++" "-DCMAKE_C_COMPILER=mpicc" "-DPETSC_EXECUTABLE_RUNS=TRUE" + ] ++ (stdenv.lib.optionals) (stdenv ? isBlueGene) [ + "-DTARGET_NATIVE_ARCH=OFF" ]; + makeFlags = [ "VERBOSE=1" ]; + + postInstall = '' + mkdir -p $out/${python.sitePackages} + ln -s $out/steps $out/${python.sitePackages}/steps + ''; + doCheck = false; checkPhase = ''export LD_LIBRARY_PATH="$PWD/src:$LD_LIBRARY_PATH" ctest -V''; diff --git a/bbp/modules/default.nix b/bbp/modules/default.nix index 7a01f68dfe..508682c6fd 100644 --- a/bbp/modules/default.nix +++ b/bbp/modules/default.nix @@ -2337,6 +2337,11 @@ with generic-modules; rec { pkgs.bgq-pythonPackages-gcc47.bg-numpy.crossDrv bgq-pythonPackages-gcc47.bg-mpi4py.crossDrv bgq-pythonPackages-gcc47.bg-h5py.crossDrv + bgq-pythonPackages-gcc47.pyparsing.crossDrv + bgq-pythonPackages-gcc47.bg-matplotlib.crossDrv + bgq-pythonPackages-gcc47.six.crossDrv + bgq-pythonPackages-gcc47.nose.crossDrv + pkgs.pythonPackages.enum pkgs.pythonPackages.pip pkgs.pythonPackages.virtualenv diff --git a/bluegene/bg-pythonPackages/default.nix b/bluegene/bg-pythonPackages/default.nix index 4acd07005c..265627e845 100644 --- a/bluegene/bg-pythonPackages/default.nix +++ b/bluegene/bg-pythonPackages/default.nix @@ -56,7 +56,7 @@ let }); - bg-h5py = pythonPkgs.h5py.override { + bg-h5py = pythonPkgs.h5py.override { mpi = mpiRuntime.crossDrv; mpi4py = bg-mpi4py; mpiSupport = false; @@ -66,6 +66,11 @@ let }; + bg-matplotlib = pythonPkgs.matplotlib.override { + numpy = bg-numpy; + }; + + }; diff --git a/bluegene/bg-pythonPackages/matplotlib/default.nix b/bluegene/bg-pythonPackages/matplotlib/default.nix new file mode 100644 index 0000000000..a3af25a2d2 --- /dev/null +++ b/bluegene/bg-pythonPackages/matplotlib/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, python, buildPythonPackage, pycairo +, which, dateutil, nose, numpy, pyparsing, tornado +, freetype, libpng, pkgconfig, mock, pytz, pygobject3 +, enableGhostscript ? false, ghostscript ? null, gtk3 +, enableGtk2 ? false, pygtk ? null, gobjectIntrospection +, enableGtk3 ? false, cairo +}: + +assert enableGhostscript -> ghostscript != null; +assert enableGtk2 -> pygtk != null; + +buildPythonPackage rec { + name = "matplotlib-1.4.3"; + + src = fetchurl { + url = "mirror://sourceforge/matplotlib/${name}.tar.gz"; + sha256 = "1dn05cvd0g984lzhh72wa0z93psgwshbbg93fkab6slx5m3l95av"; + }; + + XDG_RUNTIME_DIR = "/tmp"; + + buildInputs = [ python ] + ++ stdenv.lib.optional enableGhostscript ghostscript; + + propagatedBuildInputs = + [ dateutil nose numpy pyparsing tornado freetype + libpng mock pytz + ] + ++ stdenv.lib.optional enableGtk2 pygtk + ++ stdenv.lib.optionals enableGtk3 [ cairo pycairo gtk3 gobjectIntrospection pygobject3 ]; + + propagatedNativeBuildInputs = [ pkgconfig which ]; + + meta = with stdenv.lib; { + description = "python plotting library, making publication quality plots"; + homepage = "http://matplotlib.sourceforge.net/"; + maintainers = with maintainers; [ lovek323 ]; + platforms = platforms.unix; + }; +} diff --git a/bluegene/bg-pythonPackages/python-packages.nix b/bluegene/bg-pythonPackages/python-packages.nix index 543fa1dfaa..b2ff2727c2 100644 --- a/bluegene/bg-pythonPackages/python-packages.nix +++ b/bluegene/bg-pythonPackages/python-packages.nix @@ -7587,9 +7587,9 @@ let }; - matplotlib = callPackage ../../std-nixpkgs/pkgs/development/python-modules/matplotlib/default.nix { + matplotlib = callPackage ./matplotlib/default.nix { stdenv = if stdenv.isDarwin then pkgs.clangStdenv else pkgs.stdenv; - enableGhostscript = true; + enableGhostscript = false; };