From 6cb654e501e03a49d3380e4decd17e62b0d71c6e Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Tue, 6 Feb 2018 22:10:02 -0500 Subject: [PATCH] octopus: Initial packaging --- pkgs/all-packages.nix | 4 +++ pkgs/octopus/default.nix | 59 ++++++++++++++++++++++++++++++++++++++++ pkgs/octopus/libxc3.nix | 24 ++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 pkgs/octopus/default.nix create mode 100644 pkgs/octopus/libxc3.nix diff --git a/pkgs/all-packages.nix b/pkgs/all-packages.nix index 7af3ffb..3e29833 100644 --- a/pkgs/all-packages.nix +++ b/pkgs/all-packages.nix @@ -8,8 +8,12 @@ self: super: pkgs: with pkgs; { #firedrake = callPackage ./firedrake { }; + libxc3 = callPackage ./octopus/libxc3.nix { }; + #meraculous = callPackage ./meraculous.nix { }; + octopus = callPackage ./octopus { }; + #openfoam = callPackage ./openfoam.nix { }; openslide = callPackage ./openslide { }; diff --git a/pkgs/octopus/default.nix b/pkgs/octopus/default.nix new file mode 100644 index 0000000..8828352 --- /dev/null +++ b/pkgs/octopus/default.nix @@ -0,0 +1,59 @@ +# The following optional dependencies are not currently available +# +# pfft, pnfft, etdf_io, berkeleygw, sparskit, blacs elpa, parpack, +# feast, libfm (think this is actually scafacos) poke, parmetis +# (requires metis) +# +# The following optional dependencies are not suitable for given reason +# +# nlopt (only provides libnlopt_cxx which requires c++ compiler for linking) +# + +{ stdenv, fetchurl, overrideCC, gcc5, gfortran5, perl, openmpi +, libxc3, blas, liblapack, gsl, fftw, netcdffortran +, arpack, libyaml }: + + +(overrideCC stdenv gcc5).mkDerivation rec { + version = "7.2"; + name = "octopus-${version}"; + + src = fetchurl { + url = "http://www.tddft.org/programs/octopus/down.php?file=${version}/octopus-${version}.tar.gz"; + sha256 = "03zzmq72zdnjkhifbmlxs7ig7x6sf6mv8zv9mxhakm9hzwa9yn7m"; + }; + + buildInputs = [ + gfortran5 + perl + openmpi + libxc3 + blas + liblapack + gsl + fftw + netcdffortran + arpack + libyaml + ]; + + # Extend netcdf library combo test to include just -lnetcdff + postPatch = '' + patchShebangs build + sed -i -e 's/in "" -lnetcdf "-lnetcdff -lnetcdf";/in "" -lnetcdf "-lnetcdff -lnetcdf" -lnetcdff;/' configure + ''; + + configureFlags = [ + "--enable-mpi" + "--with-libxc-prefix=${libxc3}" + "--with-fftw-prefix=${fftw.dev}" + "--with-netcdf-prefix=${netcdffortran}" + ]; + + meta = with stdenv.lib; { + homepage = http://octopus-code.org/wiki/Main_Page; + description = "Octopus is a scientific program aimed at the ab initio virtual experimentation."; + platforms = platforms.all; + license = licenses.gpl2; + }; +} diff --git a/pkgs/octopus/libxc3.nix b/pkgs/octopus/libxc3.nix new file mode 100644 index 0000000..50f1155 --- /dev/null +++ b/pkgs/octopus/libxc3.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, gfortran, perl }: + +stdenv.mkDerivation rec { + version = "3.0.1"; + name = "libxc-${version}"; + + src = fetchurl { + url = "http://www.tddft.org/programs/octopus/down.php?file=libxc/${version}/libxc-${version}.tar.gz"; + sha256 = "1xyac89yx03vm86rvk07ps1d39xss3amw46a1k53mv30mgr94rl3"; + }; + + buildInputs = [ gfortran perl ]; + + postPatch = '' + patchShebangs src testsuite + ''; + + meta = with stdenv.lib; { + homepage = http://octopus-code.org/wiki/Libxc; + description = "Libxc is a library of exchange-correlation functionals for density-functional theory."; + platforms = platforms.all; + license = licenses.gpl3; + }; +}