bsc-performance-tools / extrae

Instrumentation framework to generate execution traces of the most used parallel runtimes.
https://tools.bsc.es/extrae
GNU Lesser General Public License v2.1
58 stars 35 forks source link

undefined reference to symbol 'pfm_get_pmu_info' #68

Open Alessandro-Barbieri opened 2 years ago

Alessandro-Barbieri commented 2 years ago

configured with ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --datarootdir=/usr/share --disable-silent-rules --disable-static --docdir=/usr/share/doc/extrae-4.0.1 --htmldir=/usr/share/doc/extrae-4.0.1/html --with-sysroot=/ --libdir=/usr/lib64 --disable-mic --disable-pmapi --disable-static --enable-shared --without-cupti --without-gm --without-mx --datadir=/var/tmp/portage/sys-cluster/extrae-4.0.1/temp --datarootdir=/var/tmp/portage/sys-cluster/extrae-4.0.1/temp --with-librt=/usr --with-mpi=/usr --with-papi=/usr --with-unwind=/usr --disable-doc --disable-heterogeneous --disable-inotify --enable-instrument_dynamic-memory --enable-instrument_io --enable-instrument_syscall --disable-merge-in-trace --disable-nanos --disable-online --enable-openmp --enable-parallel-merge --disable-pebs-sampling --disable-peruse --enable-posix-clock --disable-pthread --disable-sampling --enable-single-mpi-lib --disable-smpss --enable-xml --without-java-aspectj-weaver --without-java-aspectj --without-clustering --without-boost --without-dyninst --without-dwarf --without-elf --without-java-jdk --without-memkind --without-synapse --without-opencl --without-openshmem --without-fft --without-spectral

the build fails with

/bin/sh ../../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -I../../include -I../../src/common -I../../src/tracer -I../../src/tracer/wrappers/API -I../../src/tracer/clocks -I../../src/tracer/hwc -O -g -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -fno-optimize-sibling-calls -Wall -W   -L/usr/lib64  -R/usr/lib64 -lpapi -lpfm  -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -o extrae-cmd extrae_cmd-extrae-cmd.o extrae_cmd-extrae-cmd-init.o extrae_cmd-extrae-cmd-emit.o extrae_cmd-extrae-cmd-fini.o ../../src/tracer/libseqtrace.la ../../src/merger/libmpi2prv.la -lm -L/usr/lib64 -R/usr/lib64 -lbfd -L/usr/lib64 -R/usr/lib64 -liberty   
libtool: link: x86_64-pc-linux-gnu-gcc -I../../include -I../../src/common -I../../src/tracer -I../../src/tracer/wrappers/API -I../../src/tracer/clocks -I../../src/tracer/hwc -O -g -O2 -pipe -march=x86-64 -frecord-gcc-switches -fno-diagnostics-color -fmessage-length=0 -fno-optimize-sibling-calls -Wall -W -Wl,-O1 -Wl,--defsym=__gentoo_check_ldflags__=0 -o .libs/extrae-cmd extrae_cmd-extrae-cmd.o extrae_cmd-extrae-cmd-init.o extrae_cmd-extrae-cmd-emit.o extrae_cmd-extrae-cmd-fini.o  -L/usr/lib64 -Wl,--as-needed ../../src/tracer/.libs/libseqtrace.so -lpapi -lpfm -lunwind -lxml2 -ldl -lrt ../../src/merger/.libs/libmpi2prv.a -lm -lbfd -liberty -Wl,-rpath -Wl,/usr/lib64
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: ../../src/merger/.libs/libmpi2prv.a(libmpi2prv_la-HardwareCounters.o): undefined reference to symbol 'pfm_get_pmu_info'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libpfm.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

See https://bugs.gentoo.org/849617 log https://bugs.gentoo.org/attachment.cgi?id=782648

emercadal commented 2 years ago

This seems indeed a misdeclaration of the extrae_cmd_LDADD variable. Adding @PAPI_LIBS@ without testing PAPI availability first may raise further problems. A possible fix would be to change src/cmd-lineMakefile.am l.30 and l.36 extrae_cmd_LDFLAGS to extrae_cmd_LDADD without changing its contents.