git.iko.soy/typeable/nixpkgs
on master help sign in
galario: init at 1.2.1

Co-Authored-By: Daniel Schaefer <git@danielschaefer.me>

commit4ea8f051ac2bf8edfdc5e712191fb6e34212a95b authorSébastien Maret <sebastien.maret@icloud.com> dateTue 5 Mar 2019, 14:43 (8 years ago) parentca44e95
3 files changed+85
pkgs/development/libraries/galario/default.nix+78 pkgs/top-level/all-packages.nix+2 pkgs/top-level/python-packages.nix+5
pkgs/development/libraries/galario/default.nixnew file+78
@@ -0,0 +1,78 @@
1+{ stdenv
2+, fetchzip
3+, fetchFromGitHub
4+, cmake
5+, fftw
6+, fftwFloat
7+, enablePython ? false
8+, pythonPackages
9+, llvmPackages
10+}:
11+let
12+ # CMake recipes are needed to build galario
13+ # Build process would usually download them
14+ great-cmake-cookoff = fetchzip {
15+ url = "https://github.com/UCL/GreatCMakeCookOff/archive/v2.1.9.tar.gz";
16+ sha256 = "1yd53b5gx38g6f44jmjk4lc4igs3p25z6616hfb7aq79ly01q0w2";
17+ };
18+in
19+stdenv.mkDerivation rec {
20+ pname = "galario";
21+ version = "1.2.1";
22+
23+ src = fetchFromGitHub {
24+ owner = "mtazzari";
25+ repo = pname;
26+ rev = "v${version}";
27+ sha256 = "1akz7md7ly16a89zr880c265habakqdg9sj8iil90klqa0i21w6g";
28+ };
29+
30+ nativeBuildInputs = [ cmake ];
31+
32+ buildInputs = [ fftw fftwFloat ]
33+ ++ stdenv.lib.optional enablePython pythonPackages.python
34+ ++ stdenv.lib.optional stdenv.isDarwin llvmPackages.openmp
35+ ;
36+
37+ propagatedBuildInputs = stdenv.lib.optional enablePython [
38+ pythonPackages.numpy
39+ pythonPackages.cython
40+ pythonPackages.pytest
41+ ];
42+
43+ checkInputs = stdenv.lib.optional enablePython pythonPackages.scipy;
44+
45+ preConfigure = ''
46+ mkdir -p build/external/src
47+ cp -r ${great-cmake-cookoff} build/external/src/GreatCMakeCookOff
48+ chmod -R 777 build/external/src/GreatCMakeCookOff
49+ '';
50+
51+ preCheck = ''
52+ ${if stdenv.isDarwin then "export DYLD_LIBRARY_PATH=$(pwd)/src/" else "export LD_LIBRARY_PATH=$(pwd)/src/"}
53+ ${if enablePython then "sed -i -e 's|^#!.*|#!${stdenv.shell}|' python/py.test.sh" else ""}
54+ '';
55+
56+ doCheck = true;
57+
58+ postInstall = stdenv.lib.optionalString (stdenv.isDarwin && enablePython) ''
59+ install_name_tool -change libgalario.dylib $out/lib/libgalario.dylib $out/lib/python*/site-packages/galario/double/libcommon.so
60+ install_name_tool -change libgalario_single.dylib $out/lib/libgalario_single.dylib $out/lib/python*/site-packages/galario/single/libcommon.so
61+ '';
62+
63+ meta = with stdenv.lib; {
64+ description = "GPU Accelerated Library for Analysing Radio Interferometer Observations";
65+ longDescription = ''
66+ Galario is a library that exploits the computing power of modern
67+ graphic cards (GPUs) to accelerate the comparison of model
68+ predictions to radio interferometer observations. Namely, it
69+ speeds up the computation of the synthetic visibilities given a
70+ model image (or an axisymmetric brightness profile) and their
71+ comparison to the observations.
72+ '';
73+ homepage = "https://mtazzari.github.io/galario/";
74+ license = licenses.lgpl3;
75+ maintainers = [ maintainers.smaret ];
76+ platforms = platforms.all;
77+ };
78+}
pkgs/top-level/all-packages.nix+2
@@ -24519,6 +24519,8 @@ in
2451924519
2452024520 fityk = callPackage ../applications/science/misc/fityk { };
2452124521
24522+ galario = callPackage ../development/libraries/galario { };
24523+
2452224524 gildas = callPackage ../applications/science/astronomy/gildas { };
2452324525
2452424526 gplates = callPackage ../applications/science/misc/gplates {
pkgs/top-level/python-packages.nix+5
@@ -3601,6 +3601,11 @@ in {
36013601
36023602 futures = callPackage ../development/python-modules/futures { };
36033603
3604+ galario = toPythonModule (pkgs.galario.override {
3605+ enablePython = true;
3606+ pythonPackages = self;
3607+ });
3608+
36043609 gcovr = callPackage ../development/python-modules/gcovr { };
36053610
36063611 gdal = toPythonModule (pkgs.gdal.override {