opensubscriber
   Find in this group all groups
 
Unknown more information…

u : unix-porting@lists.apple.com 11 January 2006 • 7:44AM -0500

Re: Include necessary for environ?
by Joe Koski

REPLY TO AUTHOR
 
REPLY TO GROUP



Terry,

Thanks, but as I stated in my update, I tried both the -bundle_loader and
-flat_namespace option without success. I didn't try both together, though.
I guess I should try that too.

If I try "-bundle_loader executable" for this large make file, where the
first task is building a .dylib based on Fortran, what executable am I
referring to: ld? gcc? g95? octave? the library name? etc. I tried most of
these without success. My gcc manual just says to refer to the massive ld(1)
man page without specifics. Would I do better linking with something other
than ld?

Also, why don't gfortran and g77 require this special care? The compiler
developer wants to know, also.

Joe


on 1/10/06 4:27 PM, Terry Lambert at tlambert@appl... wrote:

> That was actually me who sait it was in crt1.o, and both Dave Z. and I
> pointed out that you will need to use the option -bundle_loader when
> you link your shared object to make the main binary symbols visible to
> your dynamically loaded shared objects.
>
> Dave also pointed out that -flat_namespace could potentially also work.
>
> -- Terry
>
> On Jan 10, 2006, at 10:25 AM, Joe Koski wrote:
>> Well, I¹m reporting back, with some progress, but no solution, yet.
>>
>> Memory refresher:  I¹m trying to compile octave-2.1.72 with g95 in
>> place of g77 (g77 builds octave without problems with the procedure
>> discussed here.) First, because saveFP and restFP are undefined
>> symbols, I export LDFLAGS=²-L/usr/lib ­lcc_dynamic² before I
>> configure to pick up the missing saveFP and restFP routines, which
>> is apparently standard Mac procedure. Then I configure as usual with
>> F77=/usr/local/bin/g95, and the configure completes successfully.
>> When I make, I get an undefined symbol _environ when attempting to
>> link the Fortran library portions of octave. The g95 compiler has
>> successfully compiled 50 or so Fortran routines at this point.
>>
>> Now for the progress: The g95 developer, Andy Vaught, says that
>> indeed, he does ³extern char **environ² as suggested on this list,
>> and is aware of the environment parsing issues discussed. I tried
>> the various Darwin options (-bundle, -flat_namespace, etc.)
>> suggested by list members without success. Then Andy stated that
>> environ exists in /usr/lib/crt1.o, and indeed it does, when in nm
>> crt1.o on my Mac. I then attempted to export LDFLAGS=²-L/usr/lib ­
>> lcc_dynamic /usr/lib/crt1.o², but the configure fails with
>> ³configure: error: C compiler cannot create executables². So now the
>> question is how to I create an LDFLAGS that picks up both /usr/lib/
>> cc_dynamic.a and /usr/lib/crt1.o without breaking gcc? Sorry, my
>> Unix/make knowledge is limited in this area.
>>
>> The next question is then, why do both g77 and gfortran work to
>> build octave with only the first LDFLAGS mentioned?
>>
>> Any ideas?
>>
>> Joe
>>
>> on 1/5/06 9:08 AM, Joe Koski at jkoski11@comc... wrote:
>>
>>> Thanks to all for the help on this issue. I¹ll report back when we
>>> have a solution.
>>>
>>> Joe
>>>
>>>
>>> on 1/4/06 8:26 PM, Marius Schamschula at marius@phys...
>>> wrote:
>>>
>>>> Dave,
>>>>
>>>> octave is an application that builds on several libraries.
>>>>
>>>> <http://www.octave.org/>
>>>>
>>>> Given that I need octave as part of porting a larger project
>>>> (CISM_DX <http://space.physics.aamu.edu/CISM_DX/>), I have found
>>>> that the lack of Apple "compatible" forms of FORTRAN to be a great
>>>> problem. For 10.3.9, Apple's gcc/g++ 3.3 plus hpc.sf.org's g77
>>>> 3.4.4 work fine, but for 10.4.3 I needed to build my own gcc/g++/
>>>> g77 3.4.5 from scratch to get octave to build (the folks at
>>>> DarwinPorts do something similar). With the current "stable"
>>>> branch of octave (2.1.72) you can forget gcc 4.0.x and gfortran
>>>> under 10.4. I haven't built the testing branch (2.9.4).
>>>>
>>>> On Jan 4, 2006, at 11:57 AM, Dave Zarzycki wrote:
>>>>
>>>>> Is octave a library?
>>>>>
>>>>> davez
>>>>>
>>>>> On Jan 4, 2006, at 9:54 AM, Luciano Miguel Ferreira Rocha wrote:
>>>>>
>>>>>
>>>>>> On Wed, Jan 04, 2006 at 09:43:04AM -0800, Dave Zarzycki wrote:
>>>>>>
>>>>>>> Linux tends to export environ as a part of their headers, but for
>>>>>>> reasons not worth going into, it would be difficult to add to our
>>>>>>> headers without breaking source from compiling. If you look at
>>>>>>> the
>>>>>>> man page for environ, you'll see that developers are simply
>>>>>>> expected
>>>>>>> to do:
>>>>>>>
>>>>>>> extern char **environ;
>>>>>>>
>>>>>>
>>>>>> I think his problem isn't the declaration, but the compilation of
>>>>>> plugins for octave.
>>>>>>
>>>>>>
>>>>>>>>  ld: Undefined symbols:
>>>>>>>>   _environ
>>>>>>>>
>>>>>>
>>>>>> I don't remeber the correct option. -bundle?
>>>>>>
>>>>>> -- lfr
>>>>>> 0/0
>>>>
>>>>
>>>>
>>>> Marius
>>>>
>>>> --
>>>>
>>>> Marius Schamschula,  Alabama A & M University, Department of Physics
>>>>
>>>>
>>>>
>>>>     The Center for Hydrology Soil Climatology and Remote Sensing
>>>>
>>>>    http://optics.physics.aamu.edu/ - http://www.physics.aamu.edu/
>>>>
>>>>           http://wx.aamu.edu/ - http://www.aamu.edu/hscars/
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Unix-porting mailing list      (Unix-porting@list...)
>>>> Help/Unsubscribe/Update your Subscription:
>>>> http://lists.apple.com/mailman/options/unix-porting/jkoski11%40comcast.net
>>>>
>>>> This email sent to jkoski11@comc...
>>>
>>
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Unix-porting mailing list      (Unix-porting@list...)
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/unix-porting/tlambert%40apple.com
>>
>> This email sent to tlambert@appl...
>


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (Unix-porting@list...)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/unix-porting/subscriber%40opensubscriber.com

This email sent to subscriber@opensub

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.