open-mpi / hwloc

Hardware locality (hwloc)
https://www.open-mpi.org/projects/hwloc
Other
565 stars 173 forks source link

`cannot find -lhwloc` during hwloc 2.4.1 build #472

Closed cwpearson closed 3 years ago

cwpearson commented 3 years ago

What version of hwloc are you using?

Attempting to build hwloc 2.4.1

Which operating system and hardware are you running on?

$ uname -a
Linux <name> 3.10.0-1160.11.1.el7.x86_64 #1 SMP Mon Nov 30 13:05:31 EST 2020 x86_64 x86_64 x86_64 GNU/Linux

Details of the problem

During build, the error /usr/bin/ld: cannot find -lhwloc is encountered. The full output of configure and build are below

$ ./configure --prefix=$HOME/software/hwloc-2.4.1

###
### Configuring hwloc distribution tarball
### Startup tests
###
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '115242' is supported by ustar format... yes
checking whether GID '115242' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... yes
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for gcc option to accept ISO C99... none needed
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for X... libraries , headers

###
### Configuring hwloc core
###
checking hwloc building mode... standalone
configure: hwloc builddir: /ascldap/users/cwpears/software/hwloc-2.4.1-src
configure: hwloc srcdir: /ascldap/users/cwpears/software/hwloc-2.4.1-src
checking for hwloc version... 2.4.1
checking if want hwloc maintainer support... disabled
checking for hwloc directory prefix... (none)
checking for hwloc symbol prefix... hwloc_
checking for gcc option to accept ISO C99... (cached) none needed
checking for the C compiler vendor... gnu
checking size of void *... 8
checking which OS support to include... Linux
checking which CPU support to include... x86_64
checking size of unsigned long... 8
checking size of unsigned int... 4
checking for __attribute__... yes
checking for __attribute__(aligned)... yes
checking for __attribute__(always_inline)... yes
checking for __attribute__(cold)... yes
checking for __attribute__(const)... yes
checking for __attribute__(deprecated)... yes
checking for __attribute__(format)... yes
checking for __attribute__(hot)... yes
checking for __attribute__(malloc)... yes
checking for __attribute__(may_alias)... yes
checking for __attribute__(no_instrument_function)... yes
checking for __attribute__(nonnull)... yes
checking for __attribute__(noreturn)... yes
checking for __attribute__(packed)... yes
checking for __attribute__(pure)... yes
checking for __attribute__(sentinel)... yes
checking for __attribute__(unused)... yes
checking for __attribute__(warn_unused_result)... yes
checking for __attribute__(weak_alias)... yes
checking if gcc supports -fvisibility=hidden... yes
checking whether to enable symbol visibility... yes (via -fvisibility=hidden)
configure: WARNING: "-fvisibility=hidden" has been added to the hwloc CFLAGS
checking whether the C compiler rejects function calls with too many arguments... yes
checking whether the C compiler rejects function calls with too few arguments... yes
checking whether to enable "picky" compiler mode... no (default)
checking for unistd.h... (cached) yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking for strings.h... (cached) yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking for strcasecmp... yes
checking whether strcasecmp is declared... yes
checking whether function strcasecmp has a complete prototype... yes
checking for strncasecmp... yes
checking whether strncasecmp is declared... yes
checking whether function strncasecmp has a complete prototype... yes
checking for strftime... yes
checking for setlocale... yes
checking for stdint.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes

**** Linux-specific checks
checking whether sched_getcpu is declared... yes
checking whether sched_setaffinity is declared... yes
checking whether function sched_setaffinity has a complete prototype... yes
checking for old prototype of sched_setaffinity... no
checking for working CPU_SET... yes
checking for working CPU_SET_S... yes
checking for working syscall with 6 parameters... yes
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for udev_device_new_from_subsystem_sysname in -ludev... yes
**** end of Linux-specific checks

checking whether pthread_setaffinity_np is declared... yes
checking whether pthread_getaffinity_np is declared... yes
checking whether fabsf is declared... yes
checking for fabsf in -lm... yes
checking whether modff is declared... yes
checking for modff in -lm... yes
checking whether _SC_NPROCESSORS_ONLN is declared... yes
checking whether _SC_NPROCESSORS_CONF is declared... yes
checking whether _SC_NPROC_ONLN is declared... no
checking whether _SC_NPROC_CONF is declared... no
checking whether _SC_PAGESIZE is declared... yes
checking whether _SC_PAGE_SIZE is declared... yes
checking whether _SC_LARGE_PAGESIZE is declared... no
checking mach/mach_init.h usability... no
checking mach/mach_init.h presence... no
checking for mach/mach_init.h... no
checking mach_init.h usability... no
checking mach_init.h presence... no
checking for mach_init.h... no
checking mach/mach_host.h usability... no
checking mach/mach_host.h presence... no
checking for mach/mach_host.h... no
checking whether strtoull is declared... yes
checking for ssize_t... yes
checking whether snprintf is declared... yes
checking whether _strdup is declared... no
checking whether _putenv is declared... no
checking whether snprintf is correct... yes
checking whether getprogname is declared... no
checking whether getexecname is declared... no
checking for program_invocation_name... yes
checking for __progname... yes
checking for pthread_t... yes
checking for bash... /bin/sh
checking for ffs... yes
checking whether ffs is declared... yes
checking whether function ffs has a complete prototype... yes
checking for ffsl... yes
checking whether ffsl is declared... yes
checking whether function ffsl has a complete prototype... yes
checking for fls... no
checking for flsl... no
checking for clz... no
checking for clzl... no
checking for openat... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for getpagesize... yes
checking for memalign... yes
checking for posix_memalign... yes
checking sys/utsname.h usability... yes
checking sys/utsname.h presence... yes
checking for sys/utsname.h... yes
checking for uname... yes
checking valgrind/valgrind.h usability... no
checking valgrind/valgrind.h presence... no
checking for valgrind/valgrind.h... no
checking whether RUNNING_ON_VALGRIND is declared... no
checking for PCIACCESS... no
checking pciaccess.h usability... no
checking pciaccess.h presence... no
checking for pciaccess.h... no
checking CL/cl_ext.h usability... no
checking CL/cl_ext.h presence... no
checking for CL/cl_ext.h... no
checking cuda.h usability... no
checking cuda.h presence... no
checking for cuda.h... no
checking cuda_runtime_api.h usability... no
checking cuda_runtime_api.h presence... no
checking for cuda_runtime_api.h... no
checking nvml.h usability... no
checking nvml.h presence... no
checking for nvml.h... no
checking rocm_smi/rocm_smi.h usability... no
checking rocm_smi/rocm_smi.h presence... no
checking for rocm_smi/rocm_smi.h... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking X11/Xlib.h usability... yes
checking X11/Xlib.h presence... yes
checking for X11/Xlib.h... yes
checking for XOpenDisplay in -lX11... yes
checking NVCtrl/NVCtrl.h usability... no
checking NVCtrl/NVCtrl.h presence... no
checking for NVCtrl/NVCtrl.h... no
checking for LIBXML2... yes
checking libxml/parser.h usability... yes
checking libxml/parser.h presence... yes
checking for libxml/parser.h... yes
checking for xmlNewDoc... yes
checking for final LIBXML2 support... yes
checking for x86 cpuid... yes
checking for pthread_mutex_lock... yes
checking if plugin support is enabled... no
checking components to build statically...  noos xml synthetic xml_nolibxml linux xml_libxml x86
checking components to build as plugins...
checking for diff... /usr/bin/diff

###
### Configuring hwloc documentation
###
checking if this is a developer build... no (doxygen generation is optional)
checking for doxygen... /usr/bin/doxygen
checking for pdflatex... /usr/bin/pdflatex
checking for makeindex... /usr/bin/makeindex
checking for fig2dev... no
checking for gs... /usr/bin/gs
checking for epstopdf... /usr/bin/epstopdf
checking if can build doxygen docs... no
checking for w3m... no
checking for lynx... no
checking if can build top-level README... no
checking if will build doxygen docs... no
checking if will install doxygen docs... yes

###
### Configuring hwloc command line utilities
###
checking for gethostbyname... (cached) yes
checking for connect... (cached) yes
checking for remove... (cached) yes
checking for shmat... (cached) yes
checking for IceConnectionNumber in -lICE... (cached) yes
checking for X11/Xlib.h... (cached) yes
checking for XOpenDisplay in -lX11... (cached) yes
checking for X11/Xutil.h... yes
checking X11/keysym.h usability... yes
checking X11/keysym.h presence... yes
checking for X11/keysym.h... yes
checking for CAIRO... yes
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for cairo_fill... yes
checking for final CAIRO support... yes
checking whether lstopo Cairo/X11 interactive graphical output is supported... yes
checking for wchar_t... yes
checking for putwc... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for setlocale... (cached) yes
checking for uselocale... yes
checking xlocale.h usability... yes
checking xlocale.h presence... yes
checking for xlocale.h... yes
checking for setlocale... (cached) yes
checking for uselocale... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking termcap support using ncurses and ... no
checking termcap support using ncurses and -ltermcap... yes
checking whether diff accepts -u... yes
checking whether diff accepts -w... yes
checking whether bind is declared... yes
checking for bind in -lsocket... no
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for clock_gettime... yes

###
### Configuring tests
###
checking for pthread_self in -lpthread... yes
checking for NUMA... yes
checking numa.h usability... yes
checking numa.h presence... yes
checking for numa.h... yes
checking for numa_available... yes
checking for final NUMA support... yes
checking for stdlib.h... (cached) yes
checking for mkstemp... yes
checking infiniband/verbs.h usability... yes
checking infiniband/verbs.h presence... yes
checking for infiniband/verbs.h... yes
checking for ibv_open_device in -libverbs... yes
checking for xmllint... xmllint
checking for bunzip2... bunzip2
checking if CXX works... yes
checking whether diff accepts -u... yes

###
### Performing final hwloc configuration
###
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating hwloc/Makefile
config.status: creating doc/Makefile
config.status: creating doc/examples/Makefile
config.status: creating doc/doxygen-config.cfg
config.status: creating utils/Makefile
config.status: creating utils/hwloc/Makefile
config.status: creating utils/lstopo/Makefile
config.status: creating hwloc.pc
config.status: creating netloc/Makefile
config.status: creating utils/netloc/infiniband/Makefile
config.status: creating utils/netloc/draw/Makefile
config.status: creating utils/netloc/scotch/Makefile
config.status: creating utils/netloc/mpi/Makefile
config.status: creating netloc.pc
config.status: creating netlocscotch.pc
config.status: creating tests/Makefile
config.status: creating tests/hwloc/Makefile
config.status: creating tests/hwloc/linux/Makefile
config.status: creating tests/hwloc/linux/allowed/Makefile
config.status: creating tests/hwloc/linux/gather/Makefile
config.status: creating tests/hwloc/x86/Makefile
config.status: creating tests/hwloc/x86+linux/Makefile
config.status: creating tests/hwloc/xml/Makefile
config.status: creating tests/hwloc/ports/Makefile
config.status: creating tests/hwloc/rename/Makefile
config.status: creating tests/hwloc/linux/allowed/test-topology.sh
config.status: creating tests/hwloc/linux/gather/test-gather-topology.sh
config.status: creating tests/hwloc/linux/test-topology.sh
config.status: creating tests/hwloc/x86/test-topology.sh
config.status: creating tests/hwloc/x86+linux/test-topology.sh
config.status: creating tests/hwloc/xml/test-topology.sh
config.status: creating tests/hwloc/wrapper.sh
config.status: creating utils/hwloc/hwloc-compress-dir
config.status: creating utils/hwloc/hwloc-gather-topology
config.status: creating utils/hwloc/test-hwloc-annotate.sh
config.status: creating utils/hwloc/test-hwloc-calc.sh
config.status: creating utils/hwloc/test-hwloc-compress-dir.sh
config.status: creating utils/hwloc/test-hwloc-diffpatch.sh
config.status: creating utils/hwloc/test-hwloc-distrib.sh
config.status: creating utils/hwloc/test-hwloc-info.sh
config.status: creating utils/hwloc/test-fake-plugin.sh
config.status: creating utils/hwloc/test-parsing-flags.sh
config.status: creating utils/hwloc/test-hwloc-dump-hwdata/Makefile
config.status: creating utils/hwloc/test-hwloc-dump-hwdata/test-hwloc-dump-hwdata.sh
config.status: creating utils/lstopo/test-lstopo.sh
config.status: creating utils/lstopo/test-lstopo-shmem.sh
config.status: creating utils/netloc/infiniband/netloc_ib_gather_raw
config.status: creating contrib/hwloc-ps.www/Makefile
config.status: creating contrib/systemd/Makefile
config.status: creating contrib/completion/Makefile
config.status: creating contrib/misc/Makefile
config.status: creating contrib/windows/Makefile
config.status: creating contrib/windows/test-windows-version.sh
config.status: creating tests/netloc/Makefile
config.status: creating tests/netloc/tests.sh
config.status: creating include/private/autogen/config.h
config.status: creating include/hwloc/autogen/config.h
config.status: linking hwloc/topology-solaris.c to tests/hwloc/ports/topology-solaris.c
config.status: linking hwloc/topology-solaris-chiptype.c to tests/hwloc/ports/topology-solaris-chiptype.c
config.status: linking hwloc/topology-aix.c to tests/hwloc/ports/topology-aix.c
config.status: linking hwloc/topology-windows.c to tests/hwloc/ports/topology-windows.c
config.status: linking hwloc/topology-darwin.c to tests/hwloc/ports/topology-darwin.c
config.status: linking hwloc/topology-freebsd.c to tests/hwloc/ports/topology-freebsd.c
config.status: linking hwloc/topology-netbsd.c to tests/hwloc/ports/topology-netbsd.c
config.status: linking hwloc/topology-hpux.c to tests/hwloc/ports/topology-hpux.c
config.status: linking hwloc/topology-bgq.c to tests/hwloc/ports/topology-bgq.c
config.status: linking hwloc/topology-opencl.c to tests/hwloc/ports/topology-opencl.c
config.status: linking hwloc/topology-cuda.c to tests/hwloc/ports/topology-cuda.c
config.status: linking hwloc/topology-nvml.c to tests/hwloc/ports/topology-nvml.c
config.status: linking hwloc/topology-rsmi.c to tests/hwloc/ports/topology-rsmi.c
config.status: linking hwloc/topology-gl.c to tests/hwloc/ports/topology-gl.c
config.status: linking utils/lstopo/lstopo-windows.c to tests/hwloc/ports/lstopo-windows.c
config.status: linking utils/lstopo/lstopo-android.c to tests/hwloc/ports/lstopo-android.c
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing chmoding-scripts commands

-----------------------------------------------------------------------------
Hwloc optional build support status (more details can be found above):

Probe / display I/O devices: PCI(linux) LinuxIO
Graphical output:            yes (Cairo)
XML input / output:          full
Netloc functionality:        no
Plugin support:              no
-----------------------------------------------------------------------------
$ make
Making all in include
make[1]: Entering directory `<...>/hwloc-2.4.1-src/include'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `<...>/hwloc-2.4.1-src/include'
Making all in hwloc
make[1]: Entering directory `<...>/hwloc-2.4.1-src/hwloc'
  CC       topology.lo
  CC       traversal.lo
  CC       distances.lo
  CC       memattrs.lo
  CC       cpukinds.lo
  CC       components.lo
  CC       bind.lo
  CC       bitmap.lo
  CC       pci-common.lo
  CC       diff.lo
  CC       shmem.lo
  CC       misc.lo
  CC       base64.lo
  CC       topology-noos.lo
  CC       topology-synthetic.lo
  CC       topology-xml.lo
  CC       topology-xml-nolibxml.lo
  CC       topology-xml-libxml.lo
  CC       topology-linux.lo
  CC       topology-hardwired.lo
  CC       topology-x86.lo
  CCLD     libhwloc.la
/usr/bin/ld: cannot find -lhwloc
collect2: error: ld returned 1 exit status
make[1]: *** [libhwloc.la] Error 1
make[1]: Leaving directory `<...>/hwloc-2.4.1-src/hwloc'
make: *** [all-recursive] Error 1
cwpearson commented 3 years ago

Turns out my environment was introducing a spurious link flag. Apologies.