diff --git a/pkgs/all-packages.nix b/pkgs/all-packages.nix index 1001a98..56a8f8c 100644 --- a/pkgs/all-packages.nix +++ b/pkgs/all-packages.nix @@ -8,11 +8,16 @@ self: super: pkgs: with pkgs; { #firedrake = callPackage ./firedrake { }; - libxc3 = callPackage ./octopus/libxc3.nix { }; + inherit (callPackages ./octopus/libxc.nix { }) libxc301 libxc404; + libxc3 = libxc301; + libxc4 = libxc404; + libxc = libxc4; #meraculous = callPackage ./meraculous.nix { }; - octopus = callPackage ./octopus { }; + inherit (callPackages ./octopus/octopus.nix { }) octopus72; + octopus7 = octopus72; + octopus = octopus7; openfoam = callPackage ./openfoam.nix { }; diff --git a/pkgs/octopus/default.nix b/pkgs/octopus/default.nix deleted file mode 100644 index 8828352..0000000 --- a/pkgs/octopus/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -# 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/libxc.nix b/pkgs/octopus/libxc.nix new file mode 100644 index 0000000..419d6b5 --- /dev/null +++ b/pkgs/octopus/libxc.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchurl, gfortran, perl }: + +let + common = scripts: version: sha256: stdenv.mkDerivation rec { + inherit version; + name = "libxc-${version}"; + + src = fetchurl { + url = "http://www.tddft.org/programs/octopus/down.php?file=libxc/${version}/libxc-${version}.tar.gz"; + inherit sha256; + }; + + buildInputs = [ gfortran perl ]; + + postPatch = '' + patchShebangs ${scripts} + ''; + + 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; + }; + }; + +in { + libxc404 = common "scripts" "4.0.4" "1l43wcxn51ivy5wzdwfvvhim6vql82rw8fy5wk6s0p54xikhsgzn"; + libxc301 = common "src testsuite" "3.0.1" "1xyac89yx03vm86rvk07ps1d39xss3amw46a1k53mv30mgr94rl3"; +} diff --git a/pkgs/octopus/libxc3.nix b/pkgs/octopus/libxc3.nix deleted file mode 100644 index 50f1155..0000000 --- a/pkgs/octopus/libxc3.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ 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; - }; -} diff --git a/pkgs/octopus/octopus.nix b/pkgs/octopus/octopus.nix new file mode 100644 index 0000000..2947eeb --- /dev/null +++ b/pkgs/octopus/octopus.nix @@ -0,0 +1,63 @@ +# 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 }: + +let + common = version: sha256: (overrideCC stdenv gcc5).mkDerivation rec { + inherit version; + name = "octopus-${version}"; + + src = fetchurl { + url = "http://www.tddft.org/programs/octopus/down.php?file=${version}/octopus-${version}.tar.gz"; + inherit sha256; + }; + + 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; + }; + }; + +in { + octopus72 = common "7.2" "03zzmq72zdnjkhifbmlxs7ig7x6sf6mv8zv9mxhakm9hzwa9yn7m"; +}