Hello,
I'm trying to build a SPE program with PDT profiling enabled but I get some link errors. Following the samples in IBM documentation, my makefile is:
CC=/opt/cell/toolchain/bin/spu-g++
OBJS=DMABuf.o FVExtraction.o RWBuf.o Base/Matrix.o Base/Memory.o Base/SymSVD.o Base/Vector.o
FILES=DMABuf.cpp FVExtraction.cpp RWBuf.cpp Base/Matrix.cpp Base/Memory.cpp Base/SymSVD.cpp Base/Vector.cpp
CFLAGS=-W -Wno-main -g -I/opt/cell/sysroot/usr/spu/include/trace -Dmain=_pdt_main -Dexit=_pdt_exit -DMFCIO_TRACE -DLIBSYNC_TRACE -I. -I/opt/cell/sdk/usr/spu/include -march=cell -mea32 -mfloat=fast -mdouble=fast -mtune=cell -Winline -Wextra
LFLAGS=-Wl,-N -Wl,-q -L/opt/cell/sysroot/opt/cell/sdk/usr/spu/lib/trace -lsync -L/opt/cell/sysroot/usr/spu/lib/trace -ltrace -L/opt/cell/sysroot/opt/cell/sdk/usr/spu/lib/trace -lsync -L/opt/cell/sysroot/opt/cell/sdk/usr/spu/lib -lsimdmath -lmisc -L.
all: $(OBJS)
$(CC) -O $(OBJS) -o FVExtraction $(CFLAGS) $(LFLAGS)
%.o: %.cpp
$(CC) -O -c $^ $(CFLAGS) -o $@
clean:
rm -f FVExtraction
rm -f *.o
rm -f Base/*.o
The errors I get are:
/home/bucurb/workspace/cell/FVExtraction/DMABuf.cpp:263: undefined reference to `trace_interval_entry(short, unsigned int)'
DMABuf.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `InitFVE(unsigned long long, unsigned long long)':
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:120: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:120: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:121: undefined reference to `trace_interval_entry(short, unsigned int)'
FVExtraction.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `InitFVE(unsigned long long, unsigned long long)':
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:123: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:130: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:130: undefined reference to `trace_interval_entry(short, unsigned int)'
FVExtraction.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `InitFVE(unsigned long long, unsigned long long)':
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:133: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:140: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:140: undefined reference to `trace_interval_entry(short, unsigned int)'
FVExtraction.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `InitFVE(unsigned long long, unsigned long long)':
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:143: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:150: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:150: undefined reference to `trace_interval_entry(short, unsigned int)'
FVExtraction.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `spu_mfcdma64':
/opt/cell/toolchain/lib/gcc/spu/4.1.1/include/spu_internals.h:2910: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
FVExtraction.o: In function `InitFVE(unsigned long long, unsigned long long)':
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:194: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:194: undefined reference to `trace_interval_entry(short, unsigned int)'
FVExtraction.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `spu_mfcdma64':
/opt/cell/toolchain/lib/gcc/spu/4.1.1/include/spu_internals.h:2910: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
FVExtraction.o: In function `InitFVE(unsigned long long, unsigned long long)':
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:212: undefined reference to `trace_event(short, int, trace_payload_t*, char const*, unsigned int)'
/home/bucurb/workspace/cell/FVExtraction/FVExtraction.cpp:212: undefined reference to `trace_interval_entry(short, unsigned int)'
FVExtraction.o: In function `trace_mfc_read_tag_status':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:26: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:30: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
FVExtraction.o: In function `trace_spu_write_out_mbox':
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:76: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:76: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:76: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:78: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:76: undefined reference to `trace_interval_entry(short, unsigned int)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:76: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/include/trace/trace_spu_mfcio.h:78: undefined reference to `trace_interval_exit(void*, int, trace_payload_t*, char const*)'
/opt/cell/sysroot/usr/spu/lib/trace/libtrace.a(spe_main.o): In function `main':
spe_main.c:(.text+0x1ec): undefined reference to `_pdt_main'
So apparently it behaves like it does not find the libs, but they are there, with the proper paths. Do you have any idea of what is wrong ? Thanks in advance.