help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PowerPC Relocation


From: Matt Marzilli
Subject: Re: PowerPC Relocation
Date: Wed, 9 Aug 2006 12:52:44 -0400

I checked my octave configuration and the configure script was set for:

Build shared libraries:             true

Is this all that is needed for --enable-shared?  Or should I recompile Octave while explicityly saying

>./configure --enabled-shared --prefix (path)

before running make?

I do not have a problem making .oct files with DEFUN_DLD normally.  Just not one that is dynamically or statically linked to another library on the PowerPC.

Thanks for the help,
Matt

On 8/3/06, Paul Kienzle <address@hidden> wrote:
If DEFUN_DLD is not working for you, chances are that you have compiled
Octave without the '--enable-shared' option.

Once Octave is compiled with shared, you should be able to use
'mkoctfile caller.cpp' to build the oct file.

- Paul

On Aug 3, 2006, at 9:49 AM, Matt Marzilli wrote:

> Hi All,
>
> I'm having a problem with a dynamically loaded function that uses the
> Octave Native interface. caller() is a function with the DEFUN_DLD
> entry point that eventually uses dlopen() to dynamically load another
> shared library to do its work.
>
> Output
>
> octave:1> caller
> --Progress: in caller.cpp, about to load libtest--
> Error in dlopen(): /home/ma20121/vmul/manager/libtest.so: R_PPC_REL24
> relocation at 0x0e985054 for symbol `strncpy' out of range
>
> After looking up PowerPC errors I've learned that it can usually be
> avoided by compiling with the -fPIC flag (force position independent
> code) which forces external function calls to use absolute instead of
> relative branches within the compiled instructions.
>
> My problem is that I am compiling all of my code with -fPIC to ensure
> this error does not arise. Has anyone worked with Octave on the
> PowerPC before and had a relocation error like this?
>
> Here is my build sequence:
>
> g++ -fPIC -shared -o libtest.so test.cpp
>
> (these next two lines are just mkoctfile caller.cpp -v)
>
> g++ -c -fPIC -I/home/ma20121/octave-install/include/octave- 2.9.5
> -I/home/ma20121/octave-install/include/octave- 2.9.5/octave
> -I/home/ma20121/octave-install/include -g -O2 caller.cpp -o caller.o
>
> g++ -shared -Wl,-Bsymbolic -o caller.oct caller.o
> -L/home/ma20121/octave-install/lib/octave- 2.9.5 -loctinterp -loctave
> -lcruft -lreadline -lncurses -ldl
> -L/usr/lib/gcc-lib/ppc64-yellowdog-linux/3.2.3
> -L/usr/lib/gcc-lib/ppc64-yellowdog-linux/3.2.3/../../../../lib
> -L/usr/lib/gcc-lib/ppc64-yellowdog-linux/3.2.3/../../.. -L/lib/../lib
> -L/usr/lib/../lib -lz -lfrtbegin -lg2c -lm -lgcc_s
>
> This is a very strange error, but if anyone has any PowerPC and Octave
> experience, any help would be greatly appreciated!
>
> Thank You,
> Matt
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave




--
Matthew S. Marzilli
LASER Laboratory for Advanced Software Engineering Research
University of Massachusetts Amherst
Amherst, MA 01003          
E-mail: address@hidden
reply via email to

[Prev in Thread] Current Thread [Next in Thread]