[Darshan-users] undefined reference to __wrap_printf

Teng Wang tengwang at lbl.gov
Thu Jul 20 12:43:29 CDT 2017


Hi,


I'm having trouble when trying to statically link

Darshan with mpich3.3 applications following the instructions

here. Could you give me any suggestion on how to fix it?


http://www.mcs.anl.gov/research/projects/darshan/docs/darshan-runtime.html


Here is my steps:

1. Compile and install darshan 3.1.4

tar -xvzf darshan-3.1.4.tar.gz

cd darshan-3.1.4/darshan-runtime

./configure --with-mem-align=8 --with-log-path=<log directory>
--prefix=<install directory> --with-jobid-env=PBS_JOBID --disable-cuserid
CC=mpicc

make

make install


2. Create log directory, which successfully create the directory

darshan-mk-log-dirs.pl


3. Generate wrapper

darshan-gen-cc.pl `which mpicc` --output mpicc.darshan


4. Compile application (mpi-io-test.c) using mpicc.darshan

mpicc.darshan mpi-io-test.c -o mpi-io-test


After step 4, the following issue happened:

initthread.c:(.text+0xc59d): undefined reference to `__wrap_fprintf'

initthread.c:(.text+0xc5bd): undefined reference to `__wrap_fputs'

/global/homes/t/user/software_install/mpich3.3a-static/lib/libmpi.a(lib_libmpi_la-finalize.o):
In function `MPIR_Add_finalize':

finalize.c:(.text+0x226e): undefined reference to `__wrap_fputs'

finalize.c:(.text+0x227a): undefined reference to `__wrap_fflush'

finalize.c:(.text+0x2286): undefined reference to `__wrap_fflush'

/global/homes/t/user/software_install/mpich3.3a-static/lib/libmpi.a(lib_libmpi_la-util.o):
In function `MPIDI_OFI_control_handler':

util.c:(.text+0x17bc4): undefined reference to `__wrap_fprintf'

/global/homes/t/user/software_install/mpich3.3a-static/lib/libmpi.a(lib_libmpi_la-ch4_globals.o):
In function `MPID_Abort':

ch4_globals.c:(.text+0x38b): undefined reference to `__wrap_fputs'

ch4_globals.c:(.text+0x397): undefined reference to `__wrap_fflush'

ch4_globals.c:(.text+0x3a3): undefined reference to `__wrap_fflush'

/tmp/ccyntLoA.o: In function `main':

mpi-io-test.c:(.text+0x5ae): undefined reference to `__wrap_printf'

mpi-io-test.c:(.text+0x819): undefined reference to `__wrap_printf'

/global/homes/t/user/software_install/mpich3.3a-static/lib/libmpi.a(lib_libmpi_la-contextid.o):
In function `MPIR_Free_contextid':

contextid.c:(.text+0x1c3f): undefined reference to `__wrap_fputs'

contextid.c:(.text+0x1c4b): undefined reference to `__wrap_fflush'

contextid.c:(.text+0x1c57): undefined reference to `__wrap_fflush'



mpicc.darshan -show mpi-io-test.c -o mpi-io-test gave:


gcc -L/usr/lib64/slurmpmi
-L/global/common/cori/software/libfabric/1.4.1/gnu/lib mpi-io-test.c -o
mpi-io-test -L/global/homes/t/user/software_install/darshan/lib -ldarshan
-lz
-Wl,@/global/homes/t/user/software_install/darshan/share/ld-opts/darshan-base-ld-opts
-I/global/homes/t/user/software_install/mpich3.3a-static/include
-L/global/homes/t/user/software_install/mpich3.3a-static/lib -lmpi -lpmi
-lpmi -lpthread -lfabric -lrt -lpmi
-L/global/homes/t/user/software_install/darshan/lib -Wl,--start-group
-ldarshan -ldarshan-stubs -Wl,--end-group -lz -lrt -lpthread


The strange thing is when I do

nm libdarshan.a, it did show the functions (e.g. __wrap_printf) were linked
to

libdarshan.a.


*0000000000002bf0 T __wrap__IO_getc*

*0000000000002d80 T __wrap__IO_putc*

*00000000000030b0 T __wrap___isoc99_fscanf*

*0000000000001990 T __wrap_fclose*

*00000000000011d0 T __wrap_fdopen*

*0000000000001810 T __wrap_fflush*

*0000000000002a60 T __wrap_fgetc*

*0000000000003690 T __wrap_fgets*

*0000000000000db0 T __wrap_fopen*

*0000000000000fc0 T __wrap_fopen64*

*00000000000026b0 T __wrap_fprintf*

*0000000000001c80 T __wrap_fputc*

*0000000000001fa0 T __wrap_fputs*

*00000000000028d0 T __wrap_fread*

*00000000000013d0 T __wrap_freopen*

*00000000000015f0 T __wrap_freopen64*

*00000000000032d0 T __wrap_fscanf*

*0000000000003920 T __wrap_fseek*

*0000000000003a30 T __wrap_fseeko*

*0000000000003b40 T __wrap_fseeko64*

*0000000000003c50 T __wrap_fsetpos*


Thanks,

Teng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-users/attachments/20170720/af7a5d33/attachment.html>


More information about the Darshan-users mailing list