diff options
Diffstat (limited to 'pkgs/applications/science')
4 files changed, 117 insertions, 5 deletions
diff --git a/pkgs/applications/science/chemistry/cp2k/default.nix b/pkgs/applications/science/chemistry/cp2k/default.nix new file mode 100644 index 00000000000..6bb99ce556d --- /dev/null +++ b/pkgs/applications/science/chemistry/cp2k/default.nix @@ -0,0 +1,117 @@ +{ lib, stdenv, fetchFromGitHub, python3, gfortran, blas, lapack +, fftw, libint, libvori, libxc, mpi, gsl, scalapack, openssh, makeWrapper +, libxsmm, spglib, which +} : + +let + cp2kVersion = "psmp"; + arch = "Linux-x86-64-gfortran"; + +in stdenv.mkDerivation rec { + pname = "cp2k"; + version = "8.2.0"; + + src = fetchFromGitHub { + owner = "cp2k"; + repo = "cp2k"; + rev = "v${version}"; + sha256 = "0kykq5p318hxjzd4gzqjwv9gqshbdvbg0gnjbd9bdfjx1r6jkjn3"; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ python3 which openssh makeWrapper ]; + buildInputs = [ + gfortran + fftw + gsl + libint + libvori + libxc + libxsmm + spglib + scalapack + blas + lapack + ]; + + propagatedBuildInputs = [ mpi ]; + propagatedUserEnvPkgs = [ mpi ]; + + makeFlags = [ + "ARCH=${arch}" + "VERSION=${cp2kVersion}" + ]; + + doCheck = true; + + enableParallelBuilding = true; + + postPatch = '' + patchShebangs tools exts/dbcsr/tools/build_utils exts/dbcsr/.cp2k + substituteInPlace exts/dbcsr/.cp2k/Makefile --replace '/usr/bin/env python3' '${python3}/bin/python' + ''; + + configurePhase = '' + cat > arch/${arch}.${cp2kVersion} << EOF + CC = mpicc + CPP = + FC = mpif90 + LD = mpif90 + AR = ar -r + DFLAGS = -D__FFTW3 -D__LIBXC -D__LIBINT -D__parallel -D__SCALAPACK \ + -D__MPI_VERSION=3 -D__F2008 -D__LIBXSMM -D__SPGLIB \ + -D__MAX_CONTR=4 -D__LIBVORI + CFLAGS = -fopenmp + FCFLAGS = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \ + -ftree-vectorize -funroll-loops -msse2 \ + -std=f2008 \ + -fopenmp -ftree-vectorize -funroll-loops \ + -I${libxc}/include -I${libxsmm}/include \ + -I${libint}/include + LIBS = -lfftw3 -lfftw3_threads \ + -lscalapack -lblas -llapack \ + -lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \ + -lint2 -lstdc++ -lvori \ + -lgomp -lpthread -lm \ + -fopenmp + LDFLAGS = \$(FCFLAGS) \$(LIBS) + EOF + ''; + + checkPhase = '' + export OMP_NUM_THREADS=1 + + export HYDRA_IFACE=lo # Fix to make mpich run in a sandbox + export OMPI_MCA_rmaps_base_oversubscribe=1 + export CP2K_DATA_DIR=data + + mpirun -np 2 exe/${arch}/libcp2k_unittest.${cp2kVersion} + ''; + + installPhase = '' + mkdir -p $out/bin $out/share/cp2k + + cp exe/${arch}/* $out/bin + + for i in cp2k cp2k_shell graph; do + wrapProgram $out/bin/$i.${cp2kVersion} \ + --set-default CP2K_DATA_DIR $out/share/cp2k + done + + wrapProgram $out/bin/cp2k.popt \ + --set-default CP2K_DATA_DIR $out/share/cp2k \ + --set OMP_NUM_THREADS 1 + + cp -r data/* $out/share/cp2k + ''; + + passthru = { inherit mpi; }; + + meta = with lib; { + description = "Quantum chemistry and solid state physics program"; + homepage = "https://www.cp2k.org"; + license = licenses.gpl2Plus; + maintainers = [ maintainers.sheepforce ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/applications/science/physics/xflr5/default.nix b/pkgs/applications/science/physics/xflr5/default.nix index 5ae56528f96..85e20f38b66 100644 --- a/pkgs/applications/science/physics/xflr5/default.nix +++ b/pkgs/applications/science/physics/xflr5/default.nix @@ -9,8 +9,6 @@ mkDerivation rec { sha256 = "02x3r9iv3ndwxa65mxn9m5dlhcrnjiq7cffi6rmb456gs3v3dnav"; }; - enableParallelBuilding = true; - nativeBuildInputs = [ qmake ]; meta = with lib; { diff --git a/pkgs/applications/science/robotics/apmplanner2/default.nix b/pkgs/applications/science/robotics/apmplanner2/default.nix index 0f5e7e6daa8..b65c2352139 100644 --- a/pkgs/applications/science/robotics/apmplanner2/default.nix +++ b/pkgs/applications/science/robotics/apmplanner2/default.nix @@ -30,8 +30,6 @@ mkDerivation rec { --replace /usr $out ''; - enableParallelBuilding = true; - meta = { description = "Ground station software for autonomous vehicles"; longDescription = '' diff --git a/pkgs/applications/science/robotics/qgroundcontrol/default.nix b/pkgs/applications/science/robotics/qgroundcontrol/default.nix index 1b9304d49e7..2759723841c 100644 --- a/pkgs/applications/science/robotics/qgroundcontrol/default.nix +++ b/pkgs/applications/science/robotics/qgroundcontrol/default.nix @@ -17,7 +17,6 @@ mkDerivation rec { gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad wayland ]; - enableParallelBuilding = true; buildInputs = [ SDL2 ] ++ gstInputs ++ qtInputs; nativeBuildInputs = [ pkg-config qmake qttools ]; |