Hi Solal,
fairly recent versions of Spack started archiving the CP2K arch file
used for building CP2K.
Use `spack find -p cp2k` to get the Spack directory for your build of
CP2K. Inside this directory there is a subdirectory
`.spack/archived-files/cp2k/arch/` which contains the arch file
generated in Spack's build process. You should be able to use this arch
file build your own version of CP2K with the libraries provided by Spack.
From the command line you sent I can't reproduce what you did, and it
is therefore also difficult to say what you're missing. But it seems
that you started to build your own stuff in `/root/tmp`. If you're going
this road I'd recommend to use the toolchain scripts in
`tools/toolchain` instead to build both the libraries and a matching
arch file.
Best regards,
Tiziano
On 16.09.19 11:11, Solal Amouyal wrote:
> Hi,
>
> I am trying to install cp2k locally. I have successfully installed cp2k
> using spack but as I need to modify parts of the source code, a local
> installation makes things easier.
>
> *Some system information:*
>
> $ lsb_release -a:
> LSB Version: :core-4.1-amd64:core-4.1-ia32:core-4.1-noarch
> Distributor ID: CentOS
> Description: CentOS Linux release 7.6.1810 (Core)
> Release: 7.6.1810
> Codename: Core
> $ uname -a:
> Linux arthemis.localdomain 5.0.10-1.el7.elrepo.x86_64 #1 SMP Sat Apr 27
> 08:40:16 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux
>
> *Compilers/libraries*:
>
> $ gfortran --version
> gcc (GCC) 9.2.0
> Copyright (C) 2019 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions. There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> $ mpif90 --showme
> /root/usr/bin/gfortran
> -I/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/openmpi-4.0.1-v5ndqdyuke2sz3umfee2sigg3ymt2qnd/include
> -fexceptions -pthread
> -I/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/openmpi-4.0.1-v5ndqdyuke2sz3umfee2sigg3ymt2qnd/lib
> -L/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/hwloc-1.11.11-relc7hrklipjovl3gbzppgxjb55pc24t/lib
> -L/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/zlib-1.2.11-j3zdmzqsbyenjda44kvkceohj352n5ga/lib
> -Wl,-rpath
> -Wl,/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/hwloc-1.11.11-relc7hrklipjovl3gbzppgxjb55pc24t/lib
> -Wl,-rpath
> -Wl,/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/zlib-1.2.11-j3zdmzqsbyenjda44kvkceohj352n5ga/lib
> -Wl,-rpath
> -Wl,/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/openmpi-4.0.1-v5ndqdyuke2sz3umfee2sigg3ymt2qnd/lib
> -L/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/openmpi-4.0.1-v5ndqdyuke2sz3umfee2sigg3ymt2qnd/lib
> -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi
>
> I am using Openmpi-4.0.1
>
> I am compiling with the following optional libraries: FFTW3, libint,
> libxc, Scalpack. Attached is the arch file.
>
> *Steps to reproduce error:*
> *What I've tried:*
>
> * Linking explicity libhwloc
> o based on the mpif90 --showme output, add:
> -L/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/hwloc-1.11.11-relc7hrklipjovl3gbzppgxjb55pc24t/lib
> -lhwloc
> o This only an additional error message: /usr/bin/ld: cannot find
> -lhwloc
> * Add the path to LD_LIBRAR_PATH
> o export
> LD_LIBRARY_PATH=/root/usr/spack/opt/spack/linux-centos7-x86_64/gcc-9.2.0/hwloc-1.11.11-relc7hrklipjovl3gbzppgxjb55pc24t/lib:$LD_LIBRARY_PATH
> o No change
> * Execute ldd command to all lib* to make sure libhwloc is well linked.
>
> Any help is appreciated. Thanks
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
cp2k+uns...@googlegroups.com
> <mailto:
cp2k+uns...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/cp2k/49b88030-4e3e-4279-8507-993f0fd18dbc%40googlegroups.com
> <
https://groups.google.com/d/msgid/cp2k/49b88030-4e3e-4279-8507-993f0fd18dbc%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Tiziano Müller
University of Zurich
Department of Chemistry
Winterthurerstrasse 190
CH-8057 Zürich
Tel: +41 44 63 54234
www.chem.uzh.ch
tiziano...@chem.uzh.ch