8 , pythonPackages ? null
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";
19 stdenv.mkDerivation rec {
23 src = fetchFromGitHub {
27 sha256 = "0dw88ga50x3jwyfgcarn4azlhiarggvdg262hilm7rbrvlpyvha0";
30 nativeBuildInputs = [ cmake ];
32 buildInputs = [ fftw fftwFloat ]
33 ++ lib.optional enablePython pythonPackages.python
34 ++ lib.optional stdenv.isDarwin llvmPackages.openmp
37 propagatedBuildInputs = lib.optional enablePython [
43 checkInputs = lib.optional enablePython [ pythonPackages.scipy pythonPackages.pytestcov ];
46 mkdir -p build/external/src
47 cp -r ${great-cmake-cookoff} build/external/src/GreatCMakeCookOff
48 chmod -R 777 build/external/src/GreatCMakeCookOff
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 ""}
58 postInstall = 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
64 description = "GPU Accelerated Library for Analysing Radio Interferometer Observations";
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.
73 homepage = "https://mtazzari.github.io/galario/";
74 license = licenses.lgpl3;
75 maintainers = [ maintainers.smaret ];
76 platforms = platforms.all;