How to compile with PAL libraries

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Re: How to compile with PAL libraries

Postby cardosojc » Thu Nov 05, 2015 12:08 pm

Imagine i want to build a completely new program to run on epiphany and i want to use pal libraries.

Can someone provide a step-by-step tutorial to compile and run with pal? For example, like ePython!
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Re: How to compile with PAL libraries

Postby cardosojc » Sat Nov 14, 2015 11:40 am

Well, finally i was able to compile! it was missing the "-lpal" option on gcc.

But now i'm facing another problem:

// Execution setup
dev0 = p_init(1, 0); // initialize device and team
prog0 = p_load(dev0, file, func, 0); // load a program from file system
all = p_query(dev0,P_PROP_WHOAMI); // find number of nodes in system
team0 = p_open(dev0, 0, all); // create a team

printf("Number of cores = %d\n", all);

// Running program
for (i = 0; i < all; i++) {
printf("here\n");
sprintf(argbuf, "%d", i); // string args needed to run main asis
args[0] = argbuf;
status = p_run(prog0, team0, i, 1, nargs, args, 0);
}

"all" variable is equal to "-22" instead of expected "16", so it will never enter the for cycle and execute the code on cores..

Has someone executed correcty this code ?
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Previous

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 12 guests

cron