Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-07 Thread Itai Tavor

Has anyone managed to do this procedure with Python 2.0? The 
-flat_namespace flag does not help and I'm still getting 
twolevel_namespace errors. I'm running Zope 2.3.2 and I'd like to 
avoid the startup warnings, as well as any possible incompatibilities 
with Python 2.1/2.2.

Itai

Jens Vagelpohl wrote:

i think i found a working solution. since my knowledge of compilers and
linkers isn't the greatest i'll just explain what i did.

trying to compile python2.1.1 on OS X 10.1 failed for me displaying the
very same error. searching through apple's discussion i found the
following link:

http://fink.sourceforge.net/doc/porting/shared.php

it explains that some linker/compiler default options have changed. in
order to get python compiled and running i edited the toplevel Makefile
after running ./configure and edited the lines starting with LDSHARED
and BLDSHARED, this is what they look like now in my setup:

LDSHARED=   $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined
suppress
BLDSHARED=  $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined
suppress

notice the -flat_namespace switch, this gets rid of the new default
twolevel_namespace that complains about undefined warning.

running make was now successful and i was able to compile and run Zope
2.4.1.   you will probably have to recompile your python to set that
switch under 10.1.

i only did some light testing, no guarantees and before using this in
production you might want to read up on those compiler/linker options...

jens


-- 
--
Itai Tavor  -- Je sautille, donc je suis.--
[EMAIL PROTECTED]--   - Kermit the Frog --
-- --
-- If you haven't got your health, you haven't got anything  --


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-07 Thread Jens Vagelpohl

if you have no compelling reason for running Zope 2.3.2 and Python 2.0 i 
highly suggest moving up to a combination of Python 2.1 (which is much 
more OSX-friendly) and Zope 2.4.1.

jens


On Sunday, October 7, 2001, at 09:04 , Itai Tavor wrote:

 Has anyone managed to do this procedure with Python 2.0? The 
 -flat_namespace flag does not help and I'm still getting 
 twolevel_namespace errors. I'm running Zope 2.3.2 and I'd like to avoid 
 the startup warnings, as well as any possible incompatibilities with 
 Python 2.1/2.2.

 Itai

 Jens Vagelpohl wrote:

 i think i found a working solution. since my knowledge of compilers and
 linkers isn't the greatest i'll just explain what i did.

 trying to compile python2.1.1 on OS X 10.1 failed for me displaying the
 very same error. searching through apple's discussion i found the
 following link:

 http://fink.sourceforge.net/doc/porting/shared.php

 it explains that some linker/compiler default options have changed. in
 order to get python compiled and running i edited the toplevel Makefile
 after running ./configure and edited the lines starting with LDSHARED
 and BLDSHARED, this is what they look like now in my setup:

 LDSHARED=   $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined
 suppress
 BLDSHARED=  $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined
 suppress

 notice the -flat_namespace switch, this gets rid of the new default
 twolevel_namespace that complains about undefined warning.

 running make was now successful and i was able to compile and run Zope
 2.4.1.   you will probably have to recompile your python to set that
 switch under 10.1.

 i only did some light testing, no guarantees and before using this in
 production you might want to read up on those compiler/linker options...

 jens


 -- --
 Itai Tavor  -- Je sautille, donc je suis.--
 [EMAIL PROTECTED]--   - Kermit the Frog --
 -- --
 -- If you haven't got your health, you haven't got anything  --


 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-03 Thread Leonardo Rochael Almeida



Mitchell L Model wrote:

 [...] With the updates for OS 10.1 in Python 2.2a4, all I had to do 
 to make both Python and Zope was:
 
 cd Python2.2a4
 configure --with-suffix=.exe
 make
 sudo make install
 
 cd Zope
 python wo_pcgi.py


I don't know if it's just me, but this --with-suffix=.exe, on an Mac 
OS (the OS where you weren't suppose to need extensions) is extremely 
disturbing. :-)

Cheers, Leo

PS: and I'm not a Mac user, just a Linux user who would like more 
metadata in his operating system. Maybe I've been in Zope land for too 
long :-)


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-03 Thread Jens Vagelpohl

well, the actual extension does not matter. you could as well specify 
something like --with-suffix=.mary_had_a_little_lamb if you wanted...

for a more technological explanation, when the compile is done the 
executable is copied into the root of the python source tree. by default 
the name of the executable is python.

this would not be a problem if it was not for the case insensitivity of 
the HFS file system used by most OS X users. there is a folder named 
Python in the root of the tree as well. trying to copy python into the 
root will fail because it collides with Python.

the --with-suffix will produce a binary with that suffix and that will 
avoid this collision.

jens


On Wednesday, October 3, 2001, at 11:03 , Leonardo Rochael Almeida wrote:



 Mitchell L Model wrote:

 [...] With the updates for OS 10.1 in Python 2.2a4, all I had to do to 
 make both Python and Zope was:
 cd Python2.2a4
 configure --with-suffix=.exe
 make
 sudo make install
 cd Zope
 python wo_pcgi.py


 I don't know if it's just me, but this --with-suffix=.exe, on an Mac OS 
 (the OS where you weren't suppose to need extensions) is extremely 
 disturbing. :-)

   Cheers, Leo

 PS: and I'm not a Mac user, just a Linux user who would like more 
 metadata in his operating system. Maybe I've been in Zope land for too 
 long :-)


 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-02 Thread Jens Vagelpohl

mitchell,

since python 2.2 is not yet officially supported i stuck with 2.1. we 
haven't done any extensive testing using 2.2 yet and there might still be 
some side effects.

jens



On Monday, October 1, 2001, at 10:43 , Mitchell L Model wrote:
 ...

 Wonderful!  Thanks!!  Great information.

 Having said that, and having spent a couple of hours experimenting, let 
 me try to clarify things a bit:

 1.  Python 2.2a4 defaults to --with-dylib, so you don't need that when 
 making Python 2.2a4 as you did for 2.1.

 2.  Likewise, you don't need to set OPT the way the 2.1 README says for 
 Mac OS 10.

 3.  Similarly, the Python2.2a4 configure.in knows to add -flat_namespace 
 to Makefile.pre and therefore Makefile.

 4.  Both 2.1 and 2.2a4 correctly specify -undefined suppress.

 So, whereas I did need to fix the Python 2.1 Makefile to build it, I didn'
 t need to fix the Python 2.2a4 Makefile to build it.  (I guess I didn't 
 try building Python 2.1 yesterday, or I would have realized the problem 
 wasn't in Zope, but in Python, as you discovered.)

 From my experience this evening, I'm surprised that fixing the Python 
 Makefile would allow you to compile Zope.  It turns out that the zope 
 configuration process uses the Makefile.pre.in installed in (typically) 
 /usr/local/lib/python2.{1,2}/config.  It also turns out that although 
 Python 2.2a4 correctly adds -flat_namespace to Makefile.pre and Makefile,
  it doesn't add it to Makefile.pre.in!  So for both 2.1 and 2.2 I had to 
 add:

   LDSHARED=   $(CC) $(LDFLAGS) -flat_namespace -undefined suppress

 to Makefile.pre.in, either in the Python src directory before doing 'make 
 install' or in the /usr/local/lib/python2.{1,2}/config after doing the 
 install.

 I'll report this problem to the Python developers.  Thanks for you hints 
 and your careful reading of the fink documentation on shared libraries.  
 (fink is a fabulous resource!)

 --
 --- Mitchell


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-02 Thread Mitchell L Model

False alarm for Python2.2a4.  It does work

It seems I was either hallucinating or had screwed something up. 
After discussions with Guido, after which I understood a lot better 
what was supposed to be happening and why, I started over, and this 
time it worked.  With the updates for OS 10.1 in Python 2.2a4, all I 
had to do to make both Python and Zope was:

cd Python2.2a4
configure --with-suffix=.exe
make
sudo make install

cd Zope
python wo_pcgi.py

That's all.  Just that one configure flag, and no global variables 
set.  Very, very nice.  What a delight to have a just released MacOS 
treated with respect by multi-platform software!

By the way, Guido said that the Makefile.pre.in mechanism installed 
in python2.2/lib/config is for a deprecated third-party build 
mechanism, replaced by distutils.  He suggests that Zope should 
maybeswitch to distutils.


-- 

 --- Mitchell

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-02 Thread Martijn Pieters

On Wed, Oct 03, 2001 at 12:44:11AM -0400, Mitchell L Model wrote:
 False alarm for Python2.2a4.  It does work
 
 It seems I was either hallucinating or had screwed something up. 
 After discussions with Guido, after which I understood a lot better 
 what was supposed to be happening and why, I started over, and this 
 time it worked.  With the updates for OS 10.1 in Python 2.2a4, all I 
 had to do to make both Python and Zope was:
 
   cd Python2.2a4
   configure --with-suffix=.exe
   make
   sudo make install
 
   cd Zope
   python wo_pcgi.py
 
 That's all.  Just that one configure flag, and no global variables 
 set.  Very, very nice.  What a delight to have a just released MacOS 
 treated with respect by multi-platform software!

Note that we have just identified some Zope tests that fail when running
under Python 2.2, but not under 2.1. We are still investigating as to what
causes this.

-- 
Martijn Pieters
| Software Engineer  mailto:[EMAIL PROTECTED]
| Zope Corporation   http://www.zope.com/
| Creators of Zope   http://www.zope.org/
-

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-01 Thread Matthew T. Kromer

Mitchell L Model wrote:

 Trouble compiling Zope 2.4.1 on Mac OS 10.1:

 tried 'python wo_pcgi' with both a Python 2.2a4 I just made and
 with my previous Python 2.1, both with and without sudo

 cc  -bundle -undefined suppress  ./ExtensionClass.o   -o
 ./ExtensionClass.so

 /usr/bin/ld: -undefined error must be used when
 -twolevel_namespace is in effect

 [...]


 The 'two-level namespace' business is a change from the OX X developer 
 tools version 10.0 to 10.1.


 Anyone know what's going on here and how to fix it?

Well, besides the obvious that MacOS 10.1 is only hot-off-the-shelves 
for a few hours, the problem is that the dynamic loader under Darwin 
used a flat namespace to load ALL shared libraries into (does Windows do 
the same? I dont know) whereas most Unixes load each shared library with 
its own namespace [which is a bit of a technical abstraction and hand 
waving].  It sure looks to me like Apple is trying to fix the namespace 
collision problems with dyld, with that -twolevel_namespace (which 
sounds like a funky namespace munger).  My best guess at noodling the 
error message is that it means your library must use the symbol 
'undefined error' when the loader goes to load a name from the library 
and it is not present.  It may be that there is something like a 
interrogation call to the library -- do you have member X? -- rather 
than what I'm used to, which is the loader looking in the library's 
table of contents.  I suspect, but dont know, that it has to do with how 
Objective C methods get bound dynamically.


Thats not a very helpful response, but until I go to an Apple store to 
get OS 10.1, I can't see it in action or read the docs.




___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-01 Thread Jens Vagelpohl

i think i found a working solution. since my knowledge of compilers and 
linkers isn't the greatest i'll just explain what i did.

trying to compile python2.1.1 on OS X 10.1 failed for me displaying the 
very same error. searching through apple's discussion i found the 
following link:

http://fink.sourceforge.net/doc/porting/shared.php

it explains that some linker/compiler default options have changed. in 
order to get python compiled and running i edited the toplevel Makefile 
after running ./configure and edited the lines starting with LDSHARED and 
BLDSHARED, this is what they look like now in my setup:

LDSHARED=   $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined suppress
BLDSHARED=  $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined suppress

notice the -flat_namespace switch, this gets rid of the new default 
twolevel_namespace that complains about undefined warning.

running make was now successful and i was able to compile and run Zope 2.
4.1.   you will probably have to recompile your python to set that switch 
under 10.1.

i only did some light testing, no guarantees and before using this in 
production you might want to read up on those compiler/linker options...

jens



On Sunday, September 30, 2001, at 07:19 , Mitchell L Model wrote:

 Trouble compiling Zope 2.4.1 on Mac OS 10.1:

 installed a fresh 10.1 that I just got from Apple



 downloaded the Zope 2.4.1 src



 tried 'python wo_pcgi' with both a Python 2.2a4 I just made and with my 
 previous Python 2.1, both with and without sudo



 Whatever I do, it breaks in the same place.  Here's the end of the output:

 sed -f sedscript ./Makefile.pre.in Makefile.pre

 /usr/local/lib/python2.1/config/makesetup \

  -m Makefile.pre -c /usr/local/lib/python2.1/config/config.c.in 
 Setup -n  /usr/local/lib/py\

 thon2.1/config/Setup.config /usr/local/lib/python2.1/config/Setup.local 
 /usr/local/lib/python2.1/co\

 nfig/Setup

 make -f Makefile do-it-again

 /usr/local/lib/python2.1/config/makesetup \

  -m Makefile.pre -c /usr/local/lib/python2.1/config/config.c.in 
 Setup -n  /usr/local/lib/py\

 thon2.1/config/Setup.config /usr/local/lib/python2.1/config/Setup.local 
 /usr/local/lib/python2.1/co\

 nfig/Setup

 make

 cc  -g -O2 -Wall -Wstrict-prototypes -I/usr/local/include/python2.1 
 -I/usr/local/include/python2.1 \

 -DHAVE_CONFIG_H  -I../Components/ExtensionClass/src -c ././../Components/
 ExtensionClass/src/Extensi\

 onClass.c -o ./ExtensionClass.o

 In file included from /usr/local/include/python2.1/pyport.h:84,

  from /usr/local/include/python2.1/Python.h:54,

  from ././../Components/ExtensionClass/src/ExtensionClass.
 h:114,

  from ././../Components/ExtensionClass/src/ExtensionClass.
 c:61:

 /usr/include/math.h:191: warning: function declaration isn't a prototype

 cc  -bundle -undefined suppress  ./ExtensionClass.o   -o ./ExtensionClass.
 so

 /usr/bin/ld: -undefined error must be used when -twolevel_namespace is in 
 effect

 make: *** [ExtensionClass.so] Error 1

 Traceback (most recent call last):

   File wo_pcgi.py, line 117, in ?

   File wo_pcgi.py, line 105, in main

   File /usr/local/src/Zope-2.4.1-src/inst/build_extensions.py, line 102,
  in ?

     make('lib','python')

   File /usr/local/src/Zope-2.4.1-src/inst/do.py, line 135, in make

     do('make')

   File /usr/local/src/Zope-2.4.1-src/inst/do.py, line 104, in do

     if i and picky: raise SystemError, i

 SystemError: 512


 The 'two-level namespace' business is a change from the OX X developer 
 tools version 10.0 to 10.1.

 Anyone know what's going on here and how to fix it?

 --


     --- Mitchell


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] compiling Zope 2.4.1 on Mac OS 10.1

2001-10-01 Thread Mitchell L Model

At 3:58 PM -0400 10/1/01, Jens Vagelpohl wrote:
i think i found a working solution. since my knowledge of compilers 
and linkers isn't the greatest i'll just explain what i did.

trying to compile python2.1.1 on OS X 10.1 failed for me displaying 
the very same error. searching through apple's discussion i found 
the following link:

http://fink.sourceforge.net/doc/porting/shared.php

it explains that some linker/compiler default options have changed. 
in order to get python compiled and running i edited the toplevel 
Makefile after running ./configure and edited the lines starting 
with LDSHARED and BLDSHARED, this is what they look like now in my 
setup:

LDSHARED=   $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined suppress
BLDSHARED=  $(CC) $(LDFLAGS) -bundle -flat_namespace -undefined suppress

notice the -flat_namespace switch, this gets rid of the new 
default twolevel_namespace that complains about undefined 
warning.

running make was now successful and i was able to compile and run Zope 2.
4.1.   you will probably have to recompile your python to set that 
switch under 10.1.

i only did some light testing, no guarantees and before using this 
in production you might want to read up on those compiler/linker 
options...

jens



On Sunday, September 30, 2001, at 07:19 , Mitchell L Model wrote:

Trouble compiling Zope 2.4.1 on Mac OS 10.1:


...

Wonderful!  Thanks!!  Great information.

Having said that, and having spent a couple of hours experimenting, 
let me try to clarify things a bit:

1.  Python 2.2a4 defaults to --with-dylib, so you don't need that 
when making Python 2.2a4 as you did for 2.1.

2.  Likewise, you don't need to set OPT the way the 2.1 README says 
for Mac OS 10.

3.  Similarly, the Python2.2a4 configure.in knows to add 
-flat_namespace to Makefile.pre and therefore Makefile.

4.  Both 2.1 and 2.2a4 correctly specify -undefined suppress.

So, whereas I did need to fix the Python 2.1 Makefile to build it, I 
didn't need to fix the Python 2.2a4 Makefile to build it.  (I guess I 
didn't try building Python 2.1 yesterday, or I would have realized 
the problem wasn't in Zope, but in Python, as you discovered.)

 From my experience this evening, I'm surprised that fixing the Python 
Makefile would allow you to compile Zope.  It turns out that the zope 
configuration process uses the Makefile.pre.in installed in 
(typically) /usr/local/lib/python2.{1,2}/config.  It also turns out 
that although Python 2.2a4 correctly adds -flat_namespace to 
Makefile.pre and Makefile, it doesn't add it to Makefile.pre.in!  So 
for both 2.1 and 2.2 I had to add:

LDSHARED=   $(CC) $(LDFLAGS) -flat_namespace -undefined suppress

to Makefile.pre.in, either in the Python src directory before doing 
'make install' or in the /usr/local/lib/python2.{1,2}/config after 
doing the install.

I'll report this problem to the Python developers.  Thanks for you 
hints and your careful reading of the fink documentation on shared 
libraries.  (fink is a fabulous resource!)

-- 

 --- Mitchell

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )