This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simple question about cross-compilation

Hi, I'm trying to cross-compile a program to run on arm versatile juno r2 development platform. 

The system where I'm compilling is:
Linux lfpm1993-virtual-machine 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

The host where the application will be run is:
Linux localhost 4.9.51 #1 SMP PREEMPT Tue Feb 13 06:21:18 UTC 2018 aarch64

To compile I executed this command:
./configure --host=aarch64-linux-gnu --prefix=/data/data/papi --with-ffsll --with-walltimer=cycle --with-tls=__thread --with-virtualtimer=perfctr --with-perf-events --with-arch=aarch64 --with-CPU=arm

Followed up, by running:
sudo make
sudo make install

After the instalattion, the binary files were place here, /data/data/papi, as expected.

Typing ls shows:
bin include lib share

I then executed:
adb connect 146.193.56.204
adb push /data/data/papi /data/data/papi
adb shell
cd data/data/papi/bin/

Typing ls shows:
1|juno:/data/data/papi/bin # ls
papi_avail papi_decode papi_native_avail
papi_clockres papi_error_codes papi_version
papi_command_line papi_event_chooser papi_xml_event_info
papi_component_avail papi_mem_info
papi_cost papi_multiplex_cost

And this part is where I can't make it work, if I try to execute for example, papi_avail:
./papi_avail

This is the output message:
/system/bin/sh: ./papi_avail: No such file or directory

Trying with sh:
1|juno:/data/data/papi/bin # sh ./papi_avail
./papi_avail[2]: syntax error: '�1' unexpected
./papi_avail[1]: ELF��2@@H�@8: not found

So, my question is what i did wrong and how can I solve it?

Thanks, for your help:
Luís Martins






Parents
  • Thanks Steven Miao for your reply it helped me more than you could've imagined, it made me found the anwer and get it working!

    It seems you are running android on arm versatile juno r2, and the aarch64-linux-gnu is linaro toolchian?

    Yes, it is! This are the toolchains I have currently installed:

    Quick solution is to compile a static version of papi. Most of tests and benchmark tools will use this solution to run on android system.

    The configure options I had avaiable were:



    This is the configuration commands I executed and the resulting logs:

    lfpm1993@lfpm1993-virtual-machine:~/Desktop/papi/src$ ./configure --host=aarch64-linux-gnu --prefix=/data/data/papi --with-static-lib=yes --with-shared-lib=no --with-static-tools --with-arch=aarch64 --with-CPU=arm --with-ffsll --with-walltimer=cycle --with-tls=__thread --with-virtualtimer=perfctr --with-perf-events
    checking for architecture... aarch64
    checking for OS... linux
    checking for OS version... 4.13.0-43-generic
    checking for perf_event workaround level... autodetect
    checking for if MIC should be used... no
    checking for aarch64-linux-gnu-xlc... no
    checking for aarch64-linux-gnu-icc... no
    checking for aarch64-linux-gnu-gcc... aarch64-linux-gnu-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... yes
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether aarch64-linux-gnu-gcc accepts -g... yes
    checking for aarch64-linux-gnu-gcc option to accept ISO C89... none needed
    checking for aarch64-linux-gnu-xlf... no
    checking for aarch64-linux-gnu-ifort... no
    checking for aarch64-linux-gnu-gfortran... no
    checking for aarch64-linux-gnu-f95... no
    checking for aarch64-linux-gnu-f90... no
    checking for aarch64-linux-gnu-f77... no
    checking for xlf... no
    checking for ifort... no
    checking for gfortran... no
    checking for f95... no
    checking for f90... no
    checking for f77... no
    checking whether we are using the GNU Fortran 77 compiler... no
    checking whether  accepts -g... no
    checking for mpicc... no
    checking for gawk... gawk
    checking how to run the C preprocessor... aarch64-linux-gnu-gcc -E
    checking whether ln -s works... yes
    checking whether make sets $(MAKE)... yes
    checking for aarch64-linux-gnu-ranlib... aarch64-linux-gnu-ranlib
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /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 ANSI C header files... (cached) yes
    checking for inline... inline
    checking whether time.h and sys/time.h may both be included... yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking c_asm.h usability... no
    checking c_asm.h presence... no
    checking for c_asm.h... no
    checking intrinsics.h usability... no
    checking intrinsics.h presence... no
    checking for intrinsics.h... no
    checking mach/mach_time.h usability... no
    checking mach/mach_time.h presence... no
    checking for mach/mach_time.h... no
    checking sched.h usability... yes
    checking sched.h presence... yes
    checking for sched.h... yes
    checking for gethrtime... no
    checking for read_real_time... no
    checking for time_base_to_time... no
    checking for clock_gettime... yes
    checking for mach_absolute_time... no
    checking for sched_getcpu... yes
    checking for dlopen and dlerror symbols in base system... not found
    checking for dlopen and dlerror symbols in -ldl... found
    checking for native compiler for header generation... gcc
    checking for debug build... 
    checking for -Wno-override-init... 1
    checking for CPU type... arm
    forcing use of pthread mutexes... 
    checking for ffsll... yes
    checking for working gettid... no
    checking for working syscall(SYS_gettid)... yes
    checking for which real time clock to use... cycle
    checking for high performance thread local storage... __thread
    checking for which virtual timer to use... perfctr
    checking for static user preset events... no
    checking for static PAPI preset events... yes
    checking for whether to build static library... yes
    checking for whether to build shared library... no
    checking for static compile of tests and utilities... yes
    checking for linking with papi shared library of tests and utilities... no
    checking platform... linux-pe
    checking for components to build... perf_event perf_event_uncore
    checking for PAPI event CSV filename to use... papi_events.csv
    configure: Compiling genpapifdef with gcc because cross compiling
    configure: Generating fpapi.h
    configure: Generating f77papi.h
    configure: Generating f90papi.h
    configure: Rules.pfm4_pe will be included in the generated Makefile
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating papi.pc
    config.status: creating components/Makefile_comp_tests.target
    config.status: creating testlib/Makefile.target
    config.status: creating utils/Makefile.target
    config.status: creating ctests/Makefile.target
    config.status: creating ftests/Makefile.target
    config.status: creating validation_tests/Makefile.target
    config.status: creating config.h
    
    lfpm1993@lfpm1993-virtual-machine:~/Desktop/papi/src$ sudo make
    make -C libpfm4 ARCH="aarch64" CC="aarch64-linux-gnu-gcc  -Wno-override-init"  lib
    make[1]: Entering directory '/home/lfpm1993/Desktop/papi/src/libpfm4'
    make -C lib
    make[2]: Entering directory '/home/lfpm1993/Desktop/papi/src/libpfm4/lib'
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_common.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_raw.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_perf_event.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_armv8.c
    rm -f libpfm.a
    ar cq libpfm.a pfmlib_common.o pfmlib_perf_event_pmu.o pfmlib_perf_event.o pfmlib_perf_event_raw.o pfmlib_arm_perf_event.o pfmlib_arm.o pfmlib_arm_armv8.o
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_common.c -o pfmlib_common.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c -o pfmlib_perf_event_pmu.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event.c -o pfmlib_perf_event.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_raw.c -o pfmlib_perf_event_raw.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_perf_event.c -o pfmlib_arm_perf_event.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm.c -o pfmlib_arm.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_armv8.c -o pfmlib_arm_armv8.lo
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I.  -shared -Wl,-soname -Wl,libpfm.so.4  -o libpfm.so.4.9.0 pfmlib_common.lo pfmlib_perf_event_pmu.lo pfmlib_perf_event.lo pfmlib_perf_event_raw.lo pfmlib_arm_perf_event.lo pfmlib_arm.lo pfmlib_arm_armv8.lo
    ln -sf libpfm.so.4.9.0 libpfm.so.4
    ln -sf libpfm.so.4.9.0 libpfm.so
    make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/libpfm4/lib'
    make[1]: Leaving directory '/home/lfpm1993/Desktop/papi/src/libpfm4'
    make
    make[1]: Entering directory '/home/lfpm1993/Desktop/papi/src'
    Host architecture   : Linux with perf_event kernel support and libpfm4
    Host CPU component  : perf_event
    Installation DESTDIR: 
    Installation PREFIX : /data/data/papi
    Installation EPREFIX: /data/data/papi
    Installation INCDIR : /data/data/papi/include
    Installation LIBDIR : /data/data/papi/lib
    Installation BINDIR : /data/data/papi/bin
    Installation MANDIR : /data/data/papi/share/man
    Installation DOCDIR : /data/data/papi/share/doc/papi
    Installation DATADIR: /data/data/papi/share/papi
    
    ar xv libpfm4/lib/libpfm.a
    x - pfmlib_common.o
    x - pfmlib_perf_event_pmu.o
    x - pfmlib_perf_event.o
    x - pfmlib_perf_event_raw.o
    x - pfmlib_arm_perf_event.o
    x - pfmlib_arm.o
    x - pfmlib_arm_armv8.o
    sh papi_events_table.sh papi_events.csv > papi_events_table.h
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_libpfm4_events.c -o papi_libpfm4_events.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi.c -o papi.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_internal.c -o papi_internal.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_hl.c -o papi_hl.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c extras.c -o extras.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c sw_multiplex.c -o sw_multiplex.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_fwrappers.c -o papi_fwrappers.o
    aarch64-linux-gnu-gcc -E -DFORTRANUNDERSCORE papi_fwrappers.c > papi_fwrappers_.c
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_fwrappers_.c -o papi_fwrappers_.o 
    aarch64-linux-gnu-gcc -E -DFORTRANDOUBLEUNDERSCORE papi_fwrappers.c > papi_fwrappers__.c
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_fwrappers__.c -o papi_fwrappers__.o
    aarch64-linux-gnu-gcc -E -DFORTRANCAPS papi_fwrappers.c > upper_PAPI_FWRAPPERS.c
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c upper_PAPI_FWRAPPERS.c -o upper_PAPI_FWRAPPERS.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c threads.c -o threads.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c cpus.c -o cpus.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c linux-memory.c -o linux-memory.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c linux-timer.c -o linux-timer.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c linux-common.c -o linux-common.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_preset.c -o papi_preset.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_vector.c -o papi_vector.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_memory.c -o papi_memory.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c components/perf_event/perf_event.c -o perf_event.o 
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c components/perf_event/pe_libpfm4_events.c -o pe_libpfm4_events.o 
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -Icomponents/perf_event/ -c components/perf_event_uncore/perf_event_uncore.c -o perf_event_uncore.o 
    rm -f libpapi.a
    ar  rv libpapi.a pfmlib_common.o pfmlib_perf_event_pmu.o pfmlib_perf_event.o pfmlib_perf_event_raw.o pfmlib_arm_perf_event.o pfmlib_arm.o pfmlib_arm_armv8.o papi_libpfm4_events.o papi.o papi_internal.o papi_hl.o extras.o sw_multiplex.o papi_fwrappers.o papi_fwrappers_.o papi_fwrappers__.o upper_PAPI_FWRAPPERS.o threads.o cpus.o linux-memory.o linux-timer.o linux-common.o  papi_preset.o papi_vector.o papi_memory.o perf_event.o pe_libpfm4_events.o perf_event_uncore.o
    ar: creating libpapi.a
    a - pfmlib_common.o
    a - pfmlib_perf_event_pmu.o
    a - pfmlib_perf_event.o
    a - pfmlib_perf_event_raw.o
    a - pfmlib_arm_perf_event.o
    a - pfmlib_arm.o
    a - pfmlib_arm_armv8.o
    a - papi_libpfm4_events.o
    a - papi.o
    a - papi_internal.o
    a - papi_hl.o
    a - extras.o
    a - sw_multiplex.o
    a - papi_fwrappers.o
    a - papi_fwrappers_.o
    a - papi_fwrappers__.o
    a - upper_PAPI_FWRAPPERS.o
    a - threads.o
    a - cpus.o
    a - linux-memory.o
    a - linux-timer.o
    a - linux-common.o
    a - papi_preset.o
    a - papi_vector.o
    a - papi_memory.o
    a - perf_event.o
    a - pe_libpfm4_events.o
    a - perf_event_uncore.o
    cd testlib;  make
    make[2]: Entering directory '/home/lfpm1993/Desktop/papi/src/testlib'
    aarch64-linux-gnu-gcc -I. -I.. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O1  -c test_utils.c
    ar  rv libtestlib.a test_utils.o
    ar: creating libtestlib.a
    a - test_utils.o
    aarch64-linux-gnu-gcc -I. -I.. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O1 -O0 -c do_loops.c
    aarch64-linux-gnu-gcc -I. -I.. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O1  -c clockcore.c
    make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/testlib'
    cd utils && make
    make[2]: Entering directory '/home/lfpm1993/Desktop/papi/src/utils'
    aarch64-linux-gnu-gcc -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O2  -I../testlib -I.. -I. -c papi_avail.c
    aarch64-linux-gnu-gcc -I../testlib -I.. -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O2  -c print_header.c
    aarch64-linux-gnu-gcc -ldl -static -o papi_avail papi_avail.o print_header.o ../libpapi.a
    ../libpapi.a(papi.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_hl.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_hl.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(extras.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(extras.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(extras.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(extras.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(sw_multiplex.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(sw_multiplex.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(linux-common.o): In function `_linux_init_locks':
    /home/lfpm1993/Desktop/papi/src/linux-common.c:44: undefined reference to `pthread_mutex_init'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.6':
    (.text+0x15e0): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.6':
    (.text+0x1600): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
    (.text+0x1674): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
    (.text+0x1694): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
    (.text+0x175c): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
    (.text+0x177c): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
    (.text+0x1818): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
    (.text+0x18c4): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
    (.text+0x1990): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
    (.text+0x19e0): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
    (.text+0x1ac8): undefined reference to `pthread_mutex_unlock'
    collect2: error: ld returned 1 exit status
    Makefile:19: recipe for target 'papi_avail' failed
    make[2]: *** [papi_avail] Error 1
    make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/utils'
    Makefile.inc:234: recipe for target 'utils' failed
    make[1]: *** [utils] Error 2
    make[1]: Leaving directory '/home/lfpm1993/Desktop/papi/src'
    Rules.pfm4_pe:42: recipe for target 'libpfm4/lib/libpfm.a' failed
    make: *** [libpfm4/lib/libpfm.a] Error 2


    Searching online I found that the solution for those errors could be the order of the flags:
    (https://stackoverflow.com/questions/35716010/no-reference-to-pthread-mutex-lock-with-lpthread-compiled)

    Messing around the Makefiles and adding -lpthreads, solved my problem.

    Thanks for all the help!
    Luís Martins





Reply
  • Thanks Steven Miao for your reply it helped me more than you could've imagined, it made me found the anwer and get it working!

    It seems you are running android on arm versatile juno r2, and the aarch64-linux-gnu is linaro toolchian?

    Yes, it is! This are the toolchains I have currently installed:

    Quick solution is to compile a static version of papi. Most of tests and benchmark tools will use this solution to run on android system.

    The configure options I had avaiable were:



    This is the configuration commands I executed and the resulting logs:

    lfpm1993@lfpm1993-virtual-machine:~/Desktop/papi/src$ ./configure --host=aarch64-linux-gnu --prefix=/data/data/papi --with-static-lib=yes --with-shared-lib=no --with-static-tools --with-arch=aarch64 --with-CPU=arm --with-ffsll --with-walltimer=cycle --with-tls=__thread --with-virtualtimer=perfctr --with-perf-events
    checking for architecture... aarch64
    checking for OS... linux
    checking for OS version... 4.13.0-43-generic
    checking for perf_event workaround level... autodetect
    checking for if MIC should be used... no
    checking for aarch64-linux-gnu-xlc... no
    checking for aarch64-linux-gnu-icc... no
    checking for aarch64-linux-gnu-gcc... aarch64-linux-gnu-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... yes
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether aarch64-linux-gnu-gcc accepts -g... yes
    checking for aarch64-linux-gnu-gcc option to accept ISO C89... none needed
    checking for aarch64-linux-gnu-xlf... no
    checking for aarch64-linux-gnu-ifort... no
    checking for aarch64-linux-gnu-gfortran... no
    checking for aarch64-linux-gnu-f95... no
    checking for aarch64-linux-gnu-f90... no
    checking for aarch64-linux-gnu-f77... no
    checking for xlf... no
    checking for ifort... no
    checking for gfortran... no
    checking for f95... no
    checking for f90... no
    checking for f77... no
    checking whether we are using the GNU Fortran 77 compiler... no
    checking whether  accepts -g... no
    checking for mpicc... no
    checking for gawk... gawk
    checking how to run the C preprocessor... aarch64-linux-gnu-gcc -E
    checking whether ln -s works... yes
    checking whether make sets $(MAKE)... yes
    checking for aarch64-linux-gnu-ranlib... aarch64-linux-gnu-ranlib
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /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 ANSI C header files... (cached) yes
    checking for inline... inline
    checking whether time.h and sys/time.h may both be included... yes
    checking sys/time.h usability... yes
    checking sys/time.h presence... yes
    checking for sys/time.h... yes
    checking c_asm.h usability... no
    checking c_asm.h presence... no
    checking for c_asm.h... no
    checking intrinsics.h usability... no
    checking intrinsics.h presence... no
    checking for intrinsics.h... no
    checking mach/mach_time.h usability... no
    checking mach/mach_time.h presence... no
    checking for mach/mach_time.h... no
    checking sched.h usability... yes
    checking sched.h presence... yes
    checking for sched.h... yes
    checking for gethrtime... no
    checking for read_real_time... no
    checking for time_base_to_time... no
    checking for clock_gettime... yes
    checking for mach_absolute_time... no
    checking for sched_getcpu... yes
    checking for dlopen and dlerror symbols in base system... not found
    checking for dlopen and dlerror symbols in -ldl... found
    checking for native compiler for header generation... gcc
    checking for debug build... 
    checking for -Wno-override-init... 1
    checking for CPU type... arm
    forcing use of pthread mutexes... 
    checking for ffsll... yes
    checking for working gettid... no
    checking for working syscall(SYS_gettid)... yes
    checking for which real time clock to use... cycle
    checking for high performance thread local storage... __thread
    checking for which virtual timer to use... perfctr
    checking for static user preset events... no
    checking for static PAPI preset events... yes
    checking for whether to build static library... yes
    checking for whether to build shared library... no
    checking for static compile of tests and utilities... yes
    checking for linking with papi shared library of tests and utilities... no
    checking platform... linux-pe
    checking for components to build... perf_event perf_event_uncore
    checking for PAPI event CSV filename to use... papi_events.csv
    configure: Compiling genpapifdef with gcc because cross compiling
    configure: Generating fpapi.h
    configure: Generating f77papi.h
    configure: Generating f90papi.h
    configure: Rules.pfm4_pe will be included in the generated Makefile
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating papi.pc
    config.status: creating components/Makefile_comp_tests.target
    config.status: creating testlib/Makefile.target
    config.status: creating utils/Makefile.target
    config.status: creating ctests/Makefile.target
    config.status: creating ftests/Makefile.target
    config.status: creating validation_tests/Makefile.target
    config.status: creating config.h
    
    lfpm1993@lfpm1993-virtual-machine:~/Desktop/papi/src$ sudo make
    make -C libpfm4 ARCH="aarch64" CC="aarch64-linux-gnu-gcc  -Wno-override-init"  lib
    make[1]: Entering directory '/home/lfpm1993/Desktop/papi/src/libpfm4'
    make -C lib
    make[2]: Entering directory '/home/lfpm1993/Desktop/papi/src/libpfm4/lib'
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_common.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_raw.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_perf_event.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm.c
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_armv8.c
    rm -f libpfm.a
    ar cq libpfm.a pfmlib_common.o pfmlib_perf_event_pmu.o pfmlib_perf_event.o pfmlib_perf_event_raw.o pfmlib_arm_perf_event.o pfmlib_arm.o pfmlib_arm_armv8.o
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_common.c -o pfmlib_common.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_pmu.c -o pfmlib_perf_event_pmu.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event.c -o pfmlib_perf_event.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_perf_event_raw.c -o pfmlib_perf_event_raw.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_perf_event.c -o pfmlib_arm_perf_event.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm.c -o pfmlib_arm.lo
    aarch64-linux-gnu-gcc  -Wno-override-init -fPIC -DPIC  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I. -c pfmlib_arm_armv8.c -o pfmlib_arm_armv8.lo
    aarch64-linux-gnu-gcc  -Wno-override-init  -g -Wall -Werror -Wextra -Wno-unused-parameter -I. -I/home/lfpm1993/Desktop/papi/src/libpfm4/lib/../include -DCONFIG_PFMLIB_DEBUG -DCONFIG_PFMLIB_OS_LINUX -D_REENTRANT -I. -fvisibility=hidden -DCONFIG_PFMLIB_ARCH_ARM64 -I.  -shared -Wl,-soname -Wl,libpfm.so.4  -o libpfm.so.4.9.0 pfmlib_common.lo pfmlib_perf_event_pmu.lo pfmlib_perf_event.lo pfmlib_perf_event_raw.lo pfmlib_arm_perf_event.lo pfmlib_arm.lo pfmlib_arm_armv8.lo
    ln -sf libpfm.so.4.9.0 libpfm.so.4
    ln -sf libpfm.so.4.9.0 libpfm.so
    make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/libpfm4/lib'
    make[1]: Leaving directory '/home/lfpm1993/Desktop/papi/src/libpfm4'
    make
    make[1]: Entering directory '/home/lfpm1993/Desktop/papi/src'
    Host architecture   : Linux with perf_event kernel support and libpfm4
    Host CPU component  : perf_event
    Installation DESTDIR: 
    Installation PREFIX : /data/data/papi
    Installation EPREFIX: /data/data/papi
    Installation INCDIR : /data/data/papi/include
    Installation LIBDIR : /data/data/papi/lib
    Installation BINDIR : /data/data/papi/bin
    Installation MANDIR : /data/data/papi/share/man
    Installation DOCDIR : /data/data/papi/share/doc/papi
    Installation DATADIR: /data/data/papi/share/papi
    
    ar xv libpfm4/lib/libpfm.a
    x - pfmlib_common.o
    x - pfmlib_perf_event_pmu.o
    x - pfmlib_perf_event.o
    x - pfmlib_perf_event_raw.o
    x - pfmlib_arm_perf_event.o
    x - pfmlib_arm.o
    x - pfmlib_arm_armv8.o
    sh papi_events_table.sh papi_events.csv > papi_events_table.h
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_libpfm4_events.c -o papi_libpfm4_events.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi.c -o papi.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_internal.c -o papi_internal.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_hl.c -o papi_hl.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c extras.c -o extras.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c sw_multiplex.c -o sw_multiplex.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_fwrappers.c -o papi_fwrappers.o
    aarch64-linux-gnu-gcc -E -DFORTRANUNDERSCORE papi_fwrappers.c > papi_fwrappers_.c
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_fwrappers_.c -o papi_fwrappers_.o 
    aarch64-linux-gnu-gcc -E -DFORTRANDOUBLEUNDERSCORE papi_fwrappers.c > papi_fwrappers__.c
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_fwrappers__.c -o papi_fwrappers__.o
    aarch64-linux-gnu-gcc -E -DFORTRANCAPS papi_fwrappers.c > upper_PAPI_FWRAPPERS.c
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c upper_PAPI_FWRAPPERS.c -o upper_PAPI_FWRAPPERS.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c threads.c -o threads.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c cpus.c -o cpus.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c linux-memory.c -o linux-memory.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c linux-timer.c -o linux-timer.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c linux-common.c -o linux-common.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_preset.c -o papi_preset.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_vector.c -o papi_vector.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c papi_memory.c -o papi_memory.o
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c components/perf_event/perf_event.c -o perf_event.o 
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -c components/perf_event/pe_libpfm4_events.c -o pe_libpfm4_events.o 
    aarch64-linux-gnu-gcc -DPAPI_NO_MEMORY_MANAGEMENT -DSTATIC_PAPI_EVENTS_TABLE  -DUSE_PERFEVENT_RDPMC=1 -DPEINCLUDE=\"libpfm4/include/perfmon/perf_event.h\" -D_REENTRANT -D_GNU_SOURCE -DUSE_COMPILER_TLS -Ilibpfm4/include -fvisibility=hidden -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -DOSLOCK=\"linux-lock.h\" -DOSCONTEXT=\"linux-context.h\" -O2 -Icomponents/perf_event/ -c components/perf_event_uncore/perf_event_uncore.c -o perf_event_uncore.o 
    rm -f libpapi.a
    ar  rv libpapi.a pfmlib_common.o pfmlib_perf_event_pmu.o pfmlib_perf_event.o pfmlib_perf_event_raw.o pfmlib_arm_perf_event.o pfmlib_arm.o pfmlib_arm_armv8.o papi_libpfm4_events.o papi.o papi_internal.o papi_hl.o extras.o sw_multiplex.o papi_fwrappers.o papi_fwrappers_.o papi_fwrappers__.o upper_PAPI_FWRAPPERS.o threads.o cpus.o linux-memory.o linux-timer.o linux-common.o  papi_preset.o papi_vector.o papi_memory.o perf_event.o pe_libpfm4_events.o perf_event_uncore.o
    ar: creating libpapi.a
    a - pfmlib_common.o
    a - pfmlib_perf_event_pmu.o
    a - pfmlib_perf_event.o
    a - pfmlib_perf_event_raw.o
    a - pfmlib_arm_perf_event.o
    a - pfmlib_arm.o
    a - pfmlib_arm_armv8.o
    a - papi_libpfm4_events.o
    a - papi.o
    a - papi_internal.o
    a - papi_hl.o
    a - extras.o
    a - sw_multiplex.o
    a - papi_fwrappers.o
    a - papi_fwrappers_.o
    a - papi_fwrappers__.o
    a - upper_PAPI_FWRAPPERS.o
    a - threads.o
    a - cpus.o
    a - linux-memory.o
    a - linux-timer.o
    a - linux-common.o
    a - papi_preset.o
    a - papi_vector.o
    a - papi_memory.o
    a - perf_event.o
    a - pe_libpfm4_events.o
    a - perf_event_uncore.o
    cd testlib;  make
    make[2]: Entering directory '/home/lfpm1993/Desktop/papi/src/testlib'
    aarch64-linux-gnu-gcc -I. -I.. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O1  -c test_utils.c
    ar  rv libtestlib.a test_utils.o
    ar: creating libtestlib.a
    a - test_utils.o
    aarch64-linux-gnu-gcc -I. -I.. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O1 -O0 -c do_loops.c
    aarch64-linux-gnu-gcc -I. -I.. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O1  -c clockcore.c
    make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/testlib'
    cd utils && make
    make[2]: Entering directory '/home/lfpm1993/Desktop/papi/src/utils'
    aarch64-linux-gnu-gcc -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O2  -I../testlib -I.. -I. -c papi_avail.c
    aarch64-linux-gnu-gcc -I../testlib -I.. -I. -g -Wextra -DUSE_PTHREAD_MUTEXES  -Wall -O2  -c print_header.c
    aarch64-linux-gnu-gcc -ldl -static -o papi_avail papi_avail.o print_header.o ../libpapi.a
    ../libpapi.a(papi.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_internal.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_hl.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_hl.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(extras.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(extras.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(extras.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(extras.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(sw_multiplex.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(sw_multiplex.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(threads.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(threads.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(cpus.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(linux-common.o): In function `_linux_init_locks':
    /home/lfpm1993/Desktop/papi/src/linux-common.c:44: undefined reference to `pthread_mutex_init'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_memory.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(pe_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/./threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_lock':
    /home/lfpm1993/Desktop/papi/src/threads.h:67: undefined reference to `pthread_mutex_lock'
    ../libpapi.a(papi_libpfm4_events.o): In function `_papi_hwi_unlock':
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /home/lfpm1993/Desktop/papi/src/threads.h:81: undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.6':
    (.text+0x15e0): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info.part.6':
    (.text+0x1600): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
    (.text+0x1674): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_bases':
    (.text+0x1694): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
    (.text+0x175c): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__register_frame_info_table_bases':
    (.text+0x177c): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
    (.text+0x1818): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `__deregister_frame_info_bases':
    (.text+0x18c4): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
    (.text+0x1990): undefined reference to `pthread_mutex_lock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
    (.text+0x19e0): undefined reference to `pthread_mutex_unlock'
    /usr/lib/gcc-cross/aarch64-linux-gnu/5/libgcc_eh.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
    (.text+0x1ac8): undefined reference to `pthread_mutex_unlock'
    collect2: error: ld returned 1 exit status
    Makefile:19: recipe for target 'papi_avail' failed
    make[2]: *** [papi_avail] Error 1
    make[2]: Leaving directory '/home/lfpm1993/Desktop/papi/src/utils'
    Makefile.inc:234: recipe for target 'utils' failed
    make[1]: *** [utils] Error 2
    make[1]: Leaving directory '/home/lfpm1993/Desktop/papi/src'
    Rules.pfm4_pe:42: recipe for target 'libpfm4/lib/libpfm.a' failed
    make: *** [libpfm4/lib/libpfm.a] Error 2


    Searching online I found that the solution for those errors could be the order of the flags:
    (https://stackoverflow.com/questions/35716010/no-reference-to-pthread-mutex-lock-with-lpthread-compiled)

    Messing around the Makefiles and adding -lpthreads, solved my problem.

    Thanks for all the help!
    Luís Martins





Children