[CP2K-user] Compile error: /usr/bin/ld: cannot find -lhwloc

Solal Amouyal solal.... at gmail.com
Mon Sep 16 09:11:30 UTC 2019


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:*

$ make ARCH=Linux-x86-64-gfortran VERSION=popt
...
...
mpif90 -D__F2008 -D__FFTW3 -D__LIBINT -D__LIBXC -D__MPI_VERSION=3 
-D__LIBINT_MAX_AM=7 -D__LIBDERIV_MAX_AM1=6 -D__MAX_CONTR=4 -D__parallel 
-D__SCALAPACK  -O2 -ffast-math -ffree-form -ffree-line-length-none 
-ftree-vectorize -funroll-loops -mtune=native -std=f2008 
-I/root/tmp/fftw-3.3.5/include -I/root/tmp/libint-1.1.4/include 
-I/root/tmp/libxc/include  -D__COMPILE_ARCH="\"Linux-x86-64-gfortran\"" 
-D__COMPILE_DATE="\"Mon Sep 16 11:46:43 IDT 2019\"" 
-D__COMPILE_HOST="\"arthemis.localdomain\"" 
-D__COMPILE_REVISION="\"svn:18464\"" 
-D__DATA_DIR="\"/root/tmp/cp2k-6.1.0/share/cp2k-6.1.0/data\"" -static 
-L/root/tmp/cp2k-6.1.0/share/cp2k-6.1.0/lib/Linux-x86-64-gfortran/popt -o 
/root/tmp/cp2k-6.1.0/share/cp2k-6.1.0/exe/Linux-x86-64-gfortran/dbcsr_example_1.popt 
dbcsr_example_1.o  -ldbcsr -ldbcsrmm -ldbcsrops -ldbcsrbblock -ldbcsrbdist 
-ldbcsrbase -ldbcsrdata -lcp2kmpiwrap -lmicsmm -lclsmm -lcp2kacc 
-lcp2kaccmic -lcp2kaccopencl -lcp2kbase 
/root/tmp/scalapack-2.0.2/lib/libscalapack.a /root/tmp/blas/lib/liblapack.a 
/root/tmp/blas/lib/libblas.a /root/tmp/fftw-3.3.5/lib/libfftw3.a 
/root/tmp/libxc/lib/libxcf03.a /root/tmp/libxc/lib/libxc.a 
/root/tmp/libint-1.1.4/lib/libderiv.a /root/tmp/libint-1.1.4/lib/libint.a 
-ldl
/usr/bin/ld: cannot find -lhwloc

*What I've tried:*

   - Linking explicity libhwloc
      -  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
      - This only an additional error message: /usr/bin/ld: cannot find 
      -lhwloc
   - Add the path to LD_LIBRAR_PATH
      - 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
      - No change
   - Execute ldd command to all lib* to make sure libhwloc is well linked. 

Any help is appreciated. Thanks





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20190916/5a808d48/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Linux-x86-64-gfortran.popt
Type: application/octet-stream
Size: 1925 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20190916/5a808d48/attachment.obj>


More information about the CP2K-user mailing list