On 1/30/12 1:28 PM, Alexander Hansen wrote:
> On 1/30/12 11:33 AM, bzink wrote:
>> Hello,
>> 
>> When installing packages on the OS X 3.4.3 binary release, I
>> find that mkoctfile fails to correctly construct the required
>> LDFLAGS. Here is a sample attempt (note that the path to the
>> Octave.app directory is /Applications/octave/Octave.app)
>> 
>> octave-3.4.0:1> getenv('LDFLAGS') ans = 
>> -L/Applications/octave/Octave.app/Contents/Resources/lib 
>> -L/Applications/octave/Octave.app/Contents/Resources/lib/octave-3.4.0
>>
>> 
octave-3.4.0:2> cd octave/packages octave-3.4.0:3> pkg install
>> -verbose -global struct-1.0.9.tar.gz mkoctfile: stripping
>> disabled on this platform ld: warning: directory 
>> '/Applications/Octave.app/Contents/Resources/lib' following -L
>> not found ld: warning: directory 
>> '/Applications/Octave.app/Contents/Resources/lib/gcc/i686-apple-darwin9/4.2.1'
>>
>>
>
>> 
following -L not found
>> ld: warning: directory 
>> '/Applications/Octave.app/Contents/Resources/lib/gcc' following
>> -L not found ld: warning: directory 
>> '/Applications/Octave.app/Contents/Resources/bin/../lib/gcc/i686-apple-darwin9/4.2.1'
>>
>>
>
>> 
following -L not found
>> ld: warning: directory 
>> '/Applications/Octave.app/Contents/Resources/bin/../lib/gcc' 
>> following -L not found ld: warning: directory 
>> '/Applications/Octave.app/Contents/Resources/bin/../lib/gcc/i686-apple-darwin9/4.2.1/../../..'
>>
>>
>
>> 
following -L not found
>> ld: library not found for -lgfortranbegin collect2: ld returned
>> 1 exit status
>> 
>> (All of the ld -L flags have the wrong paths, even though the 
>> getenv('LDFLAGS') seems correct.)  Is there a corrective action
>> I can take?
>> 
>> My mac runs OS 10.6.8 and I'm using the Xcode developer tools.
>> 
>> Thanks.
>> 
>> 
> 
> Try editing 
> /Applications/octave/Octave.app/Contents/Resources/bin/mkoctfile-3.4.0
>
> 
and set LDFLAGS  there to match what you're getting from getenv(). You
> may need to set some of the other variables, too.  You might a
> 
> Either that or move Octave.app out of the octave/ directory and
> into the top-level /Applications/ directory.
> 
> Unfortunately, the mkoctfile-3.4.0 in Octave.app isn't quite set
> up properly to cope with allowing the app to be moved.
> 

A bit more information on this issue:

As you're aware, Octave's build process hardcodes paths in
mkoctfile-<version> and oct-conf.h.  And unless I'm totally off base,
I think the information in oct-conf.h gets encoded in the octave
executable, to be accessed via "octave_config_info".

Unfortunately, absolute paths are being used:

octave-3.4.0:2> octave_config_info LDFLAGS
ans = -arch i386 -L/Applications/Octave.app/Contents/Resources/lib
 -B/Applications/Octave.app/Contents/Resources/lib/gcc -L/usr/lib -lz
-lbz2 -lxml2

The use of absolute paths means that the app bundle can't be moved out
of /Applications.  It shouldn't be impossible, however, to change

-L/Applications/Octave.app/Contents/Resources/lib

to e.g.

-L@executable_path/../lib

in mkoctfile-3.4.0 and oct-conf.h after configuration but before
building, and this should allow the app to be moved around, which is
what non-Unix-oriented Mac people expect.


Another issue I found was that the 3.4.0 app hardcodes
/usr/bin/gcc-4.2 and /usr/bin/g++-4.2, which don't exist for Xcode 4.2
on either 10.6 or 10.7 .  It might be nice to generate a new app
bundle that actually works on those platforms. :-)

If build scripts to generate the app bundle are available, then I'd be
willing to help out with those.
-- 
Alexander Hansen, Ph.D.
Fink User Liaison
http://finkakh.wordpress.com/

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to