[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - How to compile with PAL libraries

How to compile with PAL libraries

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

How to compile with PAL libraries

Postby cardosojc » Tue Jun 02, 2015 9:36 pm

In https://github.com/parallella/pal/blob/master/README.md, there is an example of PAL usage but there is no reference to how to compile the files.

Can someone post here how should i proceed in order to execute the example?

Thanks!
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Re: How to compile with PAL libraries

Postby aolofsson » Tue Jun 02, 2015 11:25 pm

Huh? There are make, config instructions right there?
What exactly is missing?
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: How to compile with PAL libraries

Postby cardosojc » Wed Jun 03, 2015 6:31 am

I'm speaking of hello_task code, how to compile it!
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Re: How to compile with PAL libraries

Postby cardosojc » Fri Jun 05, 2015 10:18 pm

What i need is an example of the build script, one considering pal libraries and includes.
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Re: How to compile with PAL libraries

Postby cardosojc » Sat Jun 06, 2015 10:31 pm

I have this script:

----------------
#!/bin/bash

set -e

ESDK=${EPIPHANY_HOME}
EINCS=${ESDK}/tools/host/include
ELDF=${ESDK}/bsps/current/fast.ldf
ELIBS=/home/parallella/pal/src/.libs:${ESDK}/tools/host/lib:${LD_LIBRARY_PATH}
EHDF=${EPIPHANY_HDF}

SCRIPT=$(readlink -f "$0")
EXEPATH=$(dirname "$SCRIPT")
cd $EXEPATH

CROSS_PREFIX=
case $(uname -p) in
arm*)
# Use native arm compiler (no cross prefix)
CROSS_PREFIX=
;;
*)
# Use cross compiler
CROSS_PREFIX="arm-linux-gnueabihf-"
;;
esac

# Build HOST side application
${CROSS_PREFIX}gcc src/hello_arm.c -o bin/hello_world.elf -I ${EINCS} -L ${ELIBS} -le-hal -le-loader

# Build DEVICE side program
e-gcc -T ${ELDF} src/hello_epiphany.c -o bin/e_hello_world.elf -le-lib

# Convert ebinary to SREC file
e-objcopy --srec-forceS3 --output-target srec bin/e_hello_world.elf bin/hello_world.srec

--------

But on line "${CROSS_PREFIX}gcc src/hello_arm.c -o bin/hello_world.elf -I ${EINCS} -L ${ELIBS} -le-hal -le-loader" the compilation fails with the error :"/usr/bin/ld: cannot find -le-hal /usr/bin/ld: cannot find -le-loader"

What i'm doing wrong? Thanks!
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Re: How to compile with PAL libraries

Postby paran » Fri Jun 12, 2015 3:09 am

paran
 
Posts: 53
Joined: Sat Jun 28, 2014 5:22 pm
Location: Georgetown, Ontario, Canada

Re: How to compile with PAL libraries

Postby cardosojc » Fri Jun 12, 2015 1:05 pm

Perhaps i'm not explaining myself correctly...I was able to build pal master from git.
I'm trying to write my own program using pal libraries but i cannot compile it!
cardosojc
 
Posts: 11
Joined: Thu Nov 20, 2014 4:25 pm

Re: How to compile with PAL libraries

Postby paran » Sat Jun 13, 2015 1:43 pm

Do you mean you dont have a compiler or c++ IDE?
use synaptic package manager to download Code::Block.
Access Hello_Task with Code::Block and compile/run it. If you can and cannot compile your own code, then something wrong with your code.
paran
 
Posts: 53
Joined: Sat Jun 28, 2014 5:22 pm
Location: Georgetown, Ontario, Canada

Re: How to compile with PAL libraries

Postby paran » Sat Jun 13, 2015 1:49 pm

paran
 
Posts: 53
Joined: Sat Jun 28, 2014 5:22 pm
Location: Georgetown, Ontario, Canada

Re: How to compile with PAL libraries

Postby njpacoma » Mon Jul 06, 2015 3:54 am

I am confused in the same way as cardosojc.

I followed the PAL build instructions and also ran a "sudo make install" because that didn't seem to get done after the "make". That seemed to be successful.

I have taken the example code from the PAL README.md and moved that code to a 'workarea' directory:

workarea/palExample
manager.c
hello_task.c

and now I want to compile them. Whatever I have tried so far does not work.

Using the build commands from another example, the epiphany-examples/apps/hello-world, I have a compile command for the manager.c file like this

gcc manager.c -o manager.elf -I /usr/local/include/pal -L /usr/local/lib -Ilibpal

but what I get out is as follows:

manager.c: In function ‘main’:
manager.c:30:9: warning: passing argument 6 of ‘p_run’ from incompatible pointer type [enabled by default]
status = p_run(prog0, team0, i, 1, nargs, args, 0);
^
In file included from /usr/local/include/pal/pal.h:3:0,
from manager.c:1:
/usr/local/include/pal/pal_base.h:107:5: note: expected ‘const char **’ but argument is of type ‘char **’
int p_run(p_prog_t prog, p_team_t team, int start, int count, int nargs,
^
/usr/bin/ld: cannot find -llibpal
collect2: error: ld returned 1 exit status

So, I am obviously missing something here.

Similarly, I am not sure how I would go about creating the hello_task.elf file that the manager.c program wants to load into the processors.

Can you point me in the right direction?
njpacoma
 
Posts: 7
Joined: Sun Jun 28, 2015 12:27 am
Location: Billerica, MA

Next

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 7 guests