[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/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 - Can't link up C++ file

Can't link up C++ file

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Can't link up C++ file

Postby kaps90 » Tue Mar 24, 2015 4:27 pm

Hi everyone,

I am an MEng final year student using the Parallella board for the my final year project. I have used the example code in C to setup the board for what I need problem being that my project revolves around incorporating a C++ PhD project onto the board so as to take advantage of the parallellism provided.

To keep things simple I only wanted to include a small .cpp file which doesn't do much, just a class holding a few variable declerations here and there with some initialising and clearing functions. The host side compiles and links up fine but when it comes to the e-gcc linker I get the error "In function 'GECell::~GECell()' ..... undefined reference to 'operator delete(void*)'". I pinned it down to the inclusion of a vector variable. Everything compiles just fine and runs if the vector variables are not included. Would anyone know why? Don't forget that the files that I am incorporating were part of a PhD project and so in terms of mistakes there shouldn't be any and besides that, as I said, the file I included doesn't do anything really and after stripping it down it really doesn't do anything literally! Functions definitions are just returns! I simply create an object of the class and do nothing with it.

Thanks in advance for any help.

Kevin
kaps90
 
Posts: 4
Joined: Tue Mar 24, 2015 2:11 pm

Re: Can't link up C++ file

Postby piotr5 » Tue Mar 24, 2015 6:34 pm

old program you say? maybe use the new Array datatype from c++11 instead of Vector?
other than that, you haven't described how the delete error is related to Vector and GECell!
can you provide some online-version of that PhD work you're making use of?

epiphany has no memory-management capable of working accross cores, it seems.
(i.e. you can't obtain memory on one core and delete same space on another.)
in general that isn't much of an issue in c++, you just aren't allowed to resize vectors from another core...
piotr5
 
Posts: 230
Joined: Sun Dec 23, 2012 2:48 pm

Re: Can't link up C++ file

Postby cmcconnell » Tue Mar 24, 2015 8:02 pm

Is there any support for the STL? I didn't think there was; there is certainly no mention of it in the documentation.
Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: Can't link up C++ file

Postby cmcconnell » Wed Mar 25, 2015 5:52 am

Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: Can't link up C++ file

Postby kaps90 » Wed Mar 25, 2015 10:50 am

Hi Guys,

Colin it was the e-gcc to e-g++!!! I've was stuck on this problem for quite a while I can't believe it was that. Colin I completely agree with you. The epiphany SDK reference doesn't make any clear indication of this. It simply speaks of only e-gcc and says it compiles both C and C++. As for the linker it describes it via e-ld and so once again I just never knew there was a e-g++. Likewise, it would have been nice to have some C++ examples and not only C.

Thanks Colin, you saved me a lot of trouble. I'm just hoping I don't run into the memory space issue you found :/ . And I hope the answer to your question of C++ being a viable option for the epiphany is yes. It just simplifies my project by not having worry of changing too much. Thanks again :) .

Kevin
kaps90
 
Posts: 4
Joined: Tue Mar 24, 2015 2:11 pm

Re: Can't link up C++ file

Postby cmcconnell » Wed Mar 25, 2015 1:44 pm

Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: Can't link up C++ file

Postby cmcconnell » Mon Mar 30, 2015 9:34 pm

Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: Can't link up C++ file

Postby aolofsson » Mon Mar 30, 2015 9:58 pm

It is possble to program in c++ but you have to severely limit the subset of c++ that you use.

As far as I recall, the OpenCL/COPRTRH SDK from BrownDeer does source to source translation (openCL-->c++) and uses the e-g++ compiler.

For most people, it is probably not worth the trouble....

Andreas
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Can't link up C++ file

Postby cmcconnell » Tue Mar 31, 2015 4:53 pm

Colin.
cmcconnell
 
Posts: 99
Joined: Thu May 22, 2014 6:58 pm

Re: Can't link up C++ file

Postby bobblestiltskin » Wed Jan 27, 2016 3:29 pm

I wanted to use booleans and shared memory, and so try to use e-g++ instead of e-gcc on some of the epiphany examples and see...

bob@debian-parallella:~/src/dl/epiphany-examples/apps/shm_test$ e-gcc -T /opt/adapteva/esdk/bsps/current/fast.ldf src/e_shm_test.c -o bin/e_shm_test.elf -le-lib
bob@debian-parallella:~/src/dl/epiphany-examples/apps/shm_test$ rm bin/e_shm_test.elf
bob@debian-parallella:~/src/dl/epiphany-examples/apps/shm_test$ e-g++ -T /opt/adapteva/esdk/bsps/current/fast.ldf src/e_shm_test.c -o bin/e_shm_test.elf -le-lib
/opt/adapteva/esdk.2014.11/tools/e-gnu.armv7l/bin/../lib/gcc/epiphany-elf/4.8.2/../../../../epiphany-elf/bin/ld: bin/e_shm_test.elf section `.text' will not fit in region `INTERNAL_RAM'
/opt/adapteva/esdk.2014.11/tools/e-gnu.armv7l/bin/../lib/gcc/epiphany-elf/4.8.2/../../../../epiphany-elf/bin/ld: region `INTERNAL_RAM' overflowed by 19120 bytes
/tmp/ccyTAuUg.o: In function `main':
e_shm_test.c:(.text+0xf4): undefined reference to `trace_init()'
e_shm_test.c:(.text+0xf8): undefined reference to `trace_init()'
e_shm_test.c:(.text+0x10e): undefined reference to `trace_start()'
e_shm_test.c:(.text+0x112): undefined reference to `trace_start()'
e_shm_test.c:(.text+0x12e): undefined reference to `trace_write(unsigned int, unsigned int, unsigned int, unsigned int)'
e_shm_test.c:(.text+0x132): undefined reference to `trace_write(unsigned int, unsigned int, unsigned int, unsigned int)'
e_shm_test.c:(.text+0x142): undefined reference to `e_get_coreid()'
.....

e-gcc compiles fine, but I see that e-g++ fails. Is there anything in this specific example that I should be doing?

Bob
bobblestiltskin
 
Posts: 5
Joined: Wed Oct 01, 2014 7:41 pm

Next

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 0 guests