UCL-RITS / rcps-buildscripts

Scripts to automate package builds on RC Platforms
MIT License
39 stars 27 forks source link

Install Request: CP2K v2023.1 (latest version) [IN05824831] #511

Open balston opened 1 year ago

balston commented 1 year ago

Download from: https://github.com/cp2k/cp2k/releases/

Request is initially for Young and for CPU and GPU versions.

The latest CP2K needs a more recent version of OpenMPI than we currently have - 4.1.4. This means we will need to use Spack to build CP2K.

balston commented 1 year ago

A test build using Spack, GCC 12.x and OpenMPI 4.1.4 is under way but not completed.

balston commented 1 year ago

It looks like Spack doesn't yet include version 2023.1. Here is the output from running;

spack info cp2k

in my test Spack site:

MakefilePackage:   cp2k

Description:
    CP2K is a quantum chemistry and solid state physics software package
    that can perform atomistic simulations of solid state, liquid,
    molecular, periodic, material, crystal, and biological systems

Homepage: https://www.cp2k.org

Preferred version:  
    2022.1    https://github.com/cp2k/cp2k/releases/download/v2022.1.0/cp2k-2022.1.tar.bz2

Safe versions:  
    master    [git] https://github.com/cp2k/cp2k.git on branch master
    2022.1    https://github.com/cp2k/cp2k/releases/download/v2022.1.0/cp2k-2022.1.tar.bz2
    9.1       https://github.com/cp2k/cp2k/releases/download/v9.1.0/cp2k-9.1.tar.bz2
    8.2       https://github.com/cp2k/cp2k/releases/download/v8.2.0/cp2k-8.2.tar.bz2
    8.1       https://github.com/cp2k/cp2k/releases/download/v8.1.0/cp2k-8.1.tar.bz2
    7.1       https://github.com/cp2k/cp2k/releases/download/v7.1.0/cp2k-7.1.tar.bz2
    6.1       https://github.com/cp2k/cp2k/releases/download/v6.1.0/cp2k-6.1.tar.bz2
    5.1       https://github.com/cp2k/cp2k/releases/download/v5.1.0/cp2k-5.1.tar.bz2
    4.1       https://github.com/cp2k/cp2k/releases/download/v4.1.0/cp2k-4.1.tar.bz2
    3.0       https://github.com/cp2k/cp2k/releases/download/v3.0.0/cp2k-3.0.tar.bz2

Deprecated versions:  
    None

Variants:
    Name [Default]             When          Allowed values          Description
    =======================    ==========    ====================    =======================

    build_system [makefile]    --            makefile                Build systems supported
                                                                     by the package
    cosma [off]                --            on, off                 Use COSMA for p?gemm
    cuda [off]                 --            on, off                 Build with CUDA
    cuda_arch [none]           [+cuda]       none, 32, 75, 11,       CUDA architecture
                                             72, 87, 70, 30, 86,     
                                             53, 13, 21, 60, 12,     
                                             37, 52, 62, 89, 80,     
                                             10, 90, 50, 20, 35,     
                                             61                      
    cuda_arch_35_k20x [off]    [+cuda]       on, off                 CP2K (resp. DBCSR) has
                                                                     specific parameter sets
                                                                     for different GPU
                                                                     models. Enable this
                                                                     when building with
                                                                     cuda_arch=35 for a K20x
                                                                     instead of a K40
    cuda_blas [off]            [@:7+cuda]    on, off                 Use CUBLAS for general
                                                                     matrix operations in
                                                                     DBCSR
    cuda_fft [off]             [+cuda]       on, off                 Use CUDA also for FFTs
                                                                     in the PW part of CP2K
    elpa [off]                 [@8.3:]       on, off                 Enable optimised
                                                                     diagonalisation
                                                                     routines from ELPA
    libint [on]                --            on, off                 Use libint, required
                                                                     for HFX (and possibly
                                                                     others)
    libvori [off]              --            on, off                 Enable support for
                                                                     Voronoi integration and
                                                                     BQB compression
    libxc [on]                 --            on, off                 Support additional
                                                                     functionals via libxc
    lmax [5]                   --            4, 5, 6, 7              Maximum supported
                                                                     angular momentum (HFX
                                                                     and others)
    mpi [on]                   --            on, off                 Enable MPI support
    openmp [on]                --            on, off                 Enable OpenMP support
    pexsi [off]                --            on, off                 Enable the alternative
                                                                     PEXSI methodfor density
                                                                     matrix evaluation
    plumed [off]               --            on, off                 Enable PLUMED support
    sirius [off]               --            on, off                 Enable planewave
                                                                     electronic structure
                                                                     calculations via SIRIUS
    smm [libxsmm]              --            libxsmm, libsmm,        Library for small
                                             blas                    matrix multiplications
    spglib [off]               --            on, off                 Enable support for
                                                                     spglib

Build Dependencies:
    amdfftw
    blas
    cosma
    cray-fftw
    cray-libsci
    cuda
    elpa
    fftw
    fftw-api
    lapack
    libint
    libvori
    libxc
    libxsmm
    mpi
    openblas
    pexsi
    pkgconfig
    plumed
    py-numpy
    python
    scalapack
    sirius
    spglib
    wannier90

Link Dependencies:
    amdfftw
    blas
    cosma
    cray-fftw
    cray-libsci
    cuda
    elpa
    fftw
    fftw-api
    lapack
    libint
    libxc
    libxsmm
    mpi
    openblas
    pexsi
    plumed
    scalapack
    sirius
    spglib

Run Dependencies:
    None
balston commented 1 year ago

Building CP2K 2022.1 with all options set to defaults in my test Spack site using:

spack install -v cp2k %gcc@12.2.0 2>&1 | tee cp2k_CPU-build.log
balston commented 1 year ago

This errored while downloading the CP2K source after a couple of hours:

==> Installing cp2k-2022.1-66m334dgfaw7j6evl3c4dihsb5t7p4gc
==> No binary for cp2k-2022.1-66m334dgfaw7j6evl3c4dihsb5t7p4gc found: installing from source
==> Cannot find version 2022.1 in url_list
==> Error: FetchError: All fetchers failed for spack-stage-cp2k-2022.1-66m334dgfaw7j6evl3c4dihsb5t7p4gc

/lustre/scratch/ccaabaa/apps/spack-test/spack/lib/spack/spack/package_base.py:1448, in do_fetch:
       1445
       1446        self.stage.create()
       1447        err_msg = None if not self.manual_download else self.download_instr
  >>   1448        start_time = time.time()
       1449        self.stage.fetch(mirror_only, err_msg=err_msg)
       1450        self._fetch_time = time.time() - start_time
       1451
balston commented 1 year ago

After some investigation it appears that Spack is using the wrong URL for the 2022.1 source code download. It has:

https://github.com/cp2k/cp2k/releases/download/v2022.1.0/cp2k-2022.1.tar.bz2

This is the location reported by the spack info cp2k command but the actual locating is:

https://github.com/cp2k/cp2k/releases/download/v2022.1/cp2k-2022.1.tar.bz2

v2022.1 instead of v2022.1.0.

balston commented 1 year ago

I've used:

spack edit cp2k

to make a change to CP2K's package.py as follows:

    homepage = "https://www.cp2k.org"
    url = "https://github.com/cp2k/cp2k/releases/download/v3.0.0/cp2k-3.0.tar.bz2"

changed to:

    homepage = "https://www.cp2k.org"
    url = "https://github.com/cp2k/cp2k/releases/download/v3.0/cp2k-3.0.tar.bz2"

Now running:

spack info cp2k

shows:

Preferred version:
    2022.1    https://github.com/cp2k/cp2k/releases/download/v2022.1/cp2k-2022.1.tar.bz2

for version 2022.1 which is now the correct URL.

balston commented 1 year ago

I'm re-running my build and it has downloaded the CP2K source code this time.

balston commented 1 year ago

Build finished without any obvious errors.

balston commented 1 year ago

Running:

spack find --deps cp2k

shows:

-- linux-rhel7-cascadelake / gcc@12.2.0 -------------------------
cp2k@2022.1
    fftw@3.3.10
    libint@2.6.0
        autoconf@2.69
            m4@1.4.19
                libsigsegv@2.13
        automake@1.16.5
        boost@1.80.0
            zstd@1.5.2
        gmp@6.2.1
        libtool@2.4.7
    libxc@5.1.7
        perl@5.36.0
            berkeley-db@18.1.40
    libxsmm@1.17
    netlib-scalapack@2.2.0
        cmake@3.25.0
    openblas@0.3.21
    openmpi@4.1.4
        hwloc@2.8.0
            libpciaccess@0.16
                util-macros@1.19.3
            libxml2@2.10.3
        numactl@2.0.14
        openssh@9.1p1
            krb5@1.20.1
                bison@3.8.2
            libedit@3.1-20210216
        pmix@4.1.2
            libevent@2.1.12
        zlib@1.2.13
    pkgconf@1.8.0
    python@3.10.8
        bzip2@1.0.8
            diffutils@3.8
        expat@2.4.8
            libbsd@0.11.5
                libmd@1.0.4
        gdbm@1.23
        gettext@0.21.1
            libiconv@1.16
            tar@1.34
                pigz@2.7
        libffi@3.4.2
        libxcrypt@4.4.33
        ncurses@6.3
        openssl@1.1.1s
            ca-certificates-mozilla@2022-10-11
        readline@8.1.2
        sqlite@3.40.0
        util-linux-uuid@2.38.1
        xz@5.2.7

==> 1 installed package
cschran commented 1 year ago

Just checking: Is this version now available? I can't find it under beta-modules yet.

heatherkellyucl commented 1 year ago

@cschran No, this version will be in our first Spack deployment of packages, but we need to build the rest of the initial set of packages alongside this one.