Hello,
I am Raj. I have recently started working on P4080 board. This is my first project with any board.
As part of my current assignment, I am trying to work on multi-core communication using BMan and QMan API's provided with the boards ISO. Have installed the ISO on the host machine (Ubuntu 10.04)
Having a toughtime trying to understand the compile messages.
Here is a small example I am trying to comile.
=====================================
#include <iostream>
#include <usdpaa/conf.h>
#include <usdpaa/of.h>
using namespace std;
int main()
{
cout<<"Helllo"<<endl;
of_init();
return 0;
}
=================================-
I tried compiling the above code using powerpc compiler.
powerpc-linux-gnu-g++ -L"/home/manager/workspace/CoreTest/include" -I /data/P4080_install/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/include/ -I /data/P4080_install/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/p4080ds-linux/kernel/include/ -I /data/P4080_install/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/p4080ds-linux/kernel/arch/powerpc/include -o "CoreTest" main.cpp -lusdpaa_qbman -lusdpaa_dma -lusdpaa_dma_mem -lusdpaa_fman -lusdpaa_of -lusdpaa_pme -lusdpaa_ppac -lusdpaa_rman -lusdpaa_sec -lusdpaa_srio -lusdpaa_syscfg
--------------------------------------------------------------
However, everytime I get the same error:
/tmp/ccyx81em.o: In function `of_init()':
main.cpp.text+0x1c): undefined reference to `of_init_path(char const*)'
collect2: ld returned 1 exit status
If I use grep i find that this function is available in usdpaa_of.a lib and have included that. Still I keep getting the same error.
Am I doing something wrong here?
Please guide me as to how I can achieve multicore communications using QMan and BMan portals?
Thanks,
RT
I think you need to specify the search paths for the libraries using the -L flag.
David
But where is libusdpaa_of.a on your system?
On mine it is in:
build_p4080ds_release/work/ppce500mc-linux/usdpaa-0.6.0-r2.0/usdpaa-0.6.0/lib_powerpc/
so I have that as one of my library search paths.
My libusdpaa_of.h is at : /data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib
so, i gave the command as
----> powerpc-linux-gnu-g++ -L/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib -I/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/include/ -lpthread -lusdpaa_qbman -lusdpaa_of -o "CoreTest" main.cpp
in the path you mentioned above, I see only a temp folder on my machine
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/work/ppce500mc-linux/usdpaa-0.6.0-r2.0/temp
Is it necessary that the lib has to be available on this path?
Thanks,
RT
No, your path may be different to mine, so go with yours.
I suggest you post here your latest linker command and error, as seen in the console window.
Hello David,
This is the command I have provided:
powerpc-linux-gnu-g++ -L/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib -I/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/include/ -lpthread -lusdpaa_qbman -lusdpaa_of -lusdpaa_ppac -o "CoreTest" main.cpp
This is the what is shown on the console
/tmp/ccQL1uOd.o: In function `main':
main.cpp.text+0x94): multiple definition of `main'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o):main.c.text+0x1cb0): first defined here
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `ppac_cli_macs':
main.c.text+0x714): undefined reference to `ppac_interface_enable_rx'
main.c.text+0x784): undefined reference to `ppac_interface_disable_rx'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `cb_tx_drain':
main.c.text+0xac8): undefined reference to `bman_release'
main.c.text+0xb3c): undefined reference to `bman_release'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `ppac_cli_help':
main.c.text+0xbfe): undefined reference to `cli_table_end'
main.c.text+0xc02): undefined reference to `cli_table_start'
main.c.text+0xc12): undefined reference to `cli_table_start'
main.c.text+0xc1a): undefined reference to `cli_table_end'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `bp_depletion':
main.c.text+0xe08): undefined reference to `bman_get_params'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `do_global_finish':
main.c.text+0xf64): undefined reference to `ppac_interface_finish_rx'
main.c.text+0xf98): undefined reference to `ppac_interface_finish'
main.c.text+0xfd0): undefined reference to `bman_free_pool'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `teardown_fq':
main.c.text+0x1068): undefined reference to `qman_retire_fq'
main.c.text+0x1078): undefined reference to `qman_oos_fq'
main.c.text+0x1084): undefined reference to `qman_destroy_fq'
main.c.text+0x10a0): undefined reference to `qman_poll'
main.c.text+0x10b0): undefined reference to `qman_fq_state'
main.c.text+0x10d8): undefined reference to `qman_volatile_dequeue'
main.c.text+0x10e0): undefined reference to `qman_poll'
main.c.text+0x10f0): undefined reference to `qman_fq_state'
main.c.text+0x1104): undefined reference to `qman_oos_fq'
main.c.text+0x1110): undefined reference to `qman_destroy_fq'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `ppac_fq_nonpcd_init':
main.c.text+0x1164): undefined reference to `qman_create_fq'
main.c.text+0x11a0): undefined reference to `qman_init_fq'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `ppac_fq_pcd_init':
main.c.text+0x11c6): undefined reference to `cb_dqrr_rx_hash'
main.c.text+0x11ce): undefined reference to `cb_dqrr_rx_hash'
main.c.text+0x1204): undefined reference to `qman_create_fq'
main.c.text+0x1250): undefined reference to `qman_init_fq'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `ppac_fq_tx_init':
main.c.text+0x12b4): undefined reference to `qman_create_fq'
main.c.text+0x12fc): undefined reference to `qman_init_fq'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `lazy_init_bpool':
main.c.text+0x1404): undefined reference to `bman_new_pool'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `do_global_init':
main.c.text+0x14c0): undefined reference to `dma_mem_bpool_base'
main.c.text+0x14cc): undefined reference to `dma_mem_bpool_range'
main.c.text+0x1538): undefined reference to `bman_acquire'
main.c.text+0x1600): undefined reference to `bman_release'
main.c.text+0x1688): undefined reference to `ppac_interface_init'
main.c.text+0x1740): undefined reference to `bman_acquire'
main.c.text+0x17d0): undefined reference to `ppac_interface_init_rx'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `worker_fn':
main.c.text+0x18f8): undefined reference to `bman_thread_init'
main.c.text+0x192c): undefined reference to `qman_thread_init'
main.c.text+0x1938): undefined reference to `qman_thread_fd'
main.c.text+0x193e): undefined reference to `cb_ern'
main.c.text+0x1944): undefined reference to `bman_thread_fd'
main.c.text+0x1952): undefined reference to `cb_ern'
main.c.text+0x1978): undefined reference to `qman_create_fq'
main.c.text+0x1980): undefined reference to `qman_static_dequeue_add'
main.c.text+0x19fc): undefined reference to `bman_thread_finish'
main.c.text+0x1ad4): undefined reference to `bman_irqsource_add'
main.c.text+0x1adc): undefined reference to `qman_irqsource_add'
main.c.text+0x1b00): undefined reference to `bman_irqsource_remove'
main.c.text+0x1b08): undefined reference to `qman_irqsource_remove'
main.c.text+0x1b0c): undefined reference to `bman_thread_irq'
main.c.text+0x1b10): undefined reference to `qman_thread_irq'
main.c.text+0x1b14): undefined reference to `bman_poll_slow'
main.c.text+0x1b18): undefined reference to `qman_poll_slow'
main.c.text+0x1b44): undefined reference to `qman_poll_slow'
main.c.text+0x1b5c): undefined reference to `qman_poll_dqrr'
main.c.text+0x1b90): undefined reference to `qman_poll_dqrr'
main.c.text+0x1bc8): undefined reference to `qman_static_dequeue_del'
main.c.text+0x1bd0): undefined reference to `qman_poll_slow'
main.c.text+0x1bd8): undefined reference to `qman_poll_dqrr'
main.c.text+0x1bec): undefined reference to `qman_thread_finish'
main.c.text+0x1bf0): undefined reference to `bman_thread_finish'
main.c.text+0x1bf8): undefined reference to `bman_poll_slow'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o): In function `main':
main.c.text+0x1d10): undefined reference to `of_init_path'
main.c.text+0x1d46): undefined reference to `ppam_args'
main.c.text+0x1d4e): undefined reference to `ppam_args'
main.c.text+0x1da4): undefined reference to `usdpaa_netcfg_acquire'
main.c.text+0x1dd0): undefined reference to `qman_global_init'
main.c.text+0x1de0): undefined reference to `bman_global_init'
main.c.text+0x1e6c): undefined reference to `dma_mem_setup'
main.c.text+0x214c): undefined reference to `usdpaa_netcfg_release'
main.c.text+0x2150): undefined reference to `of_finish'
main.c.text+0x2172): undefined reference to `cli_table_start'
main.c.text+0x2176): undefined reference to `cli_table_end'
main.c.text+0x218e): undefined reference to `cli_table_start'
main.c.text+0x2192): undefined reference to `cli_table_end'
main.c.text+0x2224): undefined reference to `readline'
main.c.text+0x2244): undefined reference to `history_tokenize'
main.c.text+0x22d0): undefined reference to `add_history'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o).data+0x8): undefined reference to `ppam_argp'
/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib/libusdpaa_ppac.a(usdpaa_ppac_main.o).data+0x10): undefined reference to `ppam_doc'
/tmp/ccQL1uOd.o: In function `of_init()':
main.cpp.text+0x1c): undefined reference to `of_init_path(char const*)'
collect2: ld returned 1 exit status
Location of the lib is provided as per screenshot attached below.
Thanks,
Raj Tulasi
Looks like you have a main.c and a main.cpp in your project, which won't work.
Hello David,
Got only one main.cpp in my project. Dont have any main.c anywhere within my project.
Here is something new I found.
If I remove -lusdpaa_ppac from my linker command and just run my code as is, I get the error as
/tmp/ccaKIWFX.o: In function `of_init()':
main.cpp.text+0x1c): undefined reference to `of_init_path(char const*)'
collect2: ld returned 1 exit status
If I include -lusdpaa_ppac lib then I get the error as multiple mains. Believe cannot include both -lusdpaa_ppac and -lusdpaa_of lib's together.
In my main.cpp file, I have commented out "of_init()" function and tried compiling with the same linker command:
powerpc-linux-gnu-g++ -L/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/lib -I/data/P4080_Installed/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/sysroots/ppce500mc-linux/usr/include/ -lpthread -lusdpaa_qbman -lusdpaa_of -o CoreTest main.cpp
and my code compiles fine. If I include of_init() function, I get the same error as:
/tmp/ccaKIWFX.o: In function `of_init()':
main.cpp.text+0x1c): undefined reference to `of_init_path(char const*)'
collect2: ld returned 1 exit status
Thanks,
Raj Tulasi.
Hi Raj
I don't think I can help any further. I based my USDPAA project on Freescale's 'hello_reflector' example. You might like to do the same. My problem is that I can only get it to work correctly if I use the gcc compiler, not g++. So, currently, my code must be written in C not C++.
David
In my installation, I can find the source code here:
/work/ppce500mc-linux/usdpaa-0.6.0-r2.0/usdpaa-0.6.0/apps/hello_reflector
David
Hello David,
Got two more questions for you.
1. In my iso install directory, I dont see an apps directory where I can find hello_reflector example. I can locate only the binary file of hello_reflector example. Did you create any bitbake to get this apps directory?
During my installation steps of P4080 iso I did the following:
1. sudo mount -o loop QorIQ-DPAA-SDK-<yyyymmdd>-systembuilder.iso /mnt/cdrom
2. /mnt/cdrom/install
3. ran ./scripts/ubuntu-oe.sh
4. source build_4080_release/bitbake.rc
5. bitbake devel-image
Am I missing any step?
2. Is it mandatory to use code warrior to build applications/libraries (usdpaa for instance) for p4080? Can I build the code in a terminal using ppc?
Thanks,
Raj Tulasi.
Hi Raj
1) To view the Freescale SDK examples (e.g. ‘reflector’) I needed to install the SDK source. I did this as follows:
$ cd ~/QorIQ-DPAA-SDK-20111026-systembuilder/build_p4080ds_release/
$ source bitbake.rc
$ bitbake -c patch usdpaa
$ bitbake -f devel-image
2) You shouldn't have to use CodeWarrior if you don't want to, but I haven't worked with the cross-development tools from the command line.
Please note that I am not an expert with these tools, I am learning like you are.
David