How do I install GMPY 1.11 on a Mac with OS X 10.6 and Python 3.1?

M

Mensanator

Ok, so I got a MacBook Air.

Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.

So I install Xcode, download macports and download gmpy-1.11rc1.

Following the instructions in mac_build.txt, I do the following:

- sudo /opt/local/bin/port install gmp

This works fine.

Then I do

- python setup.py install

This also works (a few warnings, but nothing looked serious).

Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.'1.11'

python gmpy_test.py
Unit tests for gmpy 1.11
on Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
..
..
..
25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.

Looks like a viable gmpy module for 2.6.

What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.

I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.

I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.

Anbody have any idea how to make this work?
 
B

Benjamin Kaplan

Ok, so I got a MacBook Air.

Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.

So I install Xcode, download macports and download gmpy-1.11rc1.

Following the instructions in mac_build.txt, I do the following:

- sudo /opt/local/bin/port install gmp

This works fine.

Then I do

- python setup.py install

This also works (a few warnings, but nothing looked serious).

Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.'1.11'

python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.

Looks like a viable gmpy module for 2.6.

What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.

I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.

I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.

Anbody have any idea how to make this work?

Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
 
M

Mensanator

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version() '1.11'

python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?

Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.

I wondered why there was both python3 and python3.1 in the bin
directory.

But why, when I type...

$ python3

....do I get...

Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.[1]+ Stopped python3

I get the same result with python3.1.

So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out

$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken. UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:

Any other ideas? Do I have to install a separate Python 3?
 
B

Benjamin Kaplan

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?

Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.

I wondered why there was both python3 and python3.1 in the bin
directory.

But why, when I type...

$ python3

...do I get...

Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.[1]+  Stopped                 python3

I get the same result with python3.1.

So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out

$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken.  UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:

Any other ideas? Do I have to install a separate Python 3?

That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk

My guess would be you're on Snow Leopard while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.
 
M

Mensanator

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+  Stopped                 python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken.  UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?

That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk

My guess would be you're on Snow Leopard

Yes, this machine has OS X 10.6.
while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.

Is there any easy way to fix the build script? Is there a hard way?
Which files comprise the build script?

Thanks for your help.
 
B

Benjamin Kaplan

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+  Stopped                 python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken.  UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?

That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk

My guess would be you're on Snow Leopard

Yes, this machine has OS X 10.6.
while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.

Is there any easy way to fix the build script? Is there a hard way?
Which files comprise the build script?

Thanks for your help.

I honestly have no idea how to fix this. I'm not very experienced with
build scripts. I just noticed that I had the 10.4 SDK on Leopard but
not on Snow Leopard and the script seems to want that version. My
guess would be that the option is either in a setup.py file or a
makefile in there.
 
M

Mensanator

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+  Stopped                 python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken.  UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?

That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk

My guess would be you're on Snow Leopard while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.

I just thought of something. Why I am able to do the build for python
2.6?
Wouldn't that also fail for lack of a 10.4 SDK?
 
B

Benjamin Kaplan

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
   on Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
 25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+  Stopped                 python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken.  UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?

That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk

My guess would be you're on Snow Leopard while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.

I just thought of something. Why I am able to do the build for python
2.6?
Wouldn't that also fail for lack of a 10.4 SDK?

I think you'd need different C sources for 2.x and 3.x because I think
the C API changed quite a bit. That might be why it worked for 2.6 but
failed for 3.1
 
M

Mensanator

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul �7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
� �on Python 2.6.1 (r261:67515, Jul �7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
�25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+ �Stopped � � � � � � � � python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken. �UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?
That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
My guess would be you're on Snow Leopard while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.
I just thought of something. Why I am able to do the build for python
2.6?
Wouldn't that also fail for lack of a 10.4 SDK?

I think you'd need different C sources for 2.x and 3.x because I think
the C API changed quite a bit.

I can see that.
That might be why it worked for 2.6 but
failed for 3.1

But Python 2.6 must not care about whether the 10.4SDK
exists or not. It must be using 10.5 or 10.6 since they
are te only SDKs that do exist.

As far as different sources, only one set is supplied and
it specifically states in the comments that the source
supports 3.x. There are, after all, 3.1 versions of the
windows installer.

I certainly woudn't be surprised by the need for seperate
sources, but wouldn't such seperate sources have been
supplied and seperate setup scripts been provided?



 
B

Benjamin Kaplan

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul �7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
� �on Python 2.6.1 (r261:67515, Jul �7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
�25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+ �Stopped � � � � � � � � python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3..1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:14:2: error: #error "Something's broken. �UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3.1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?
That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
My guess would be you're on Snow Leopard while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.
I just thought of something. Why I am able to do the build for python
2.6?
Wouldn't that also fail for lack of a 10.4 SDK?

I think you'd need different C sources for 2.x and 3.x because I think
the C API changed quite a bit.

I can see that.
That might be why it worked for 2.6 but
failed for 3.1

But Python 2.6 must not care about whether the 10.4SDK
exists or not. It must be using 10.5 or 10.6 since they
are te only SDKs that do exist.

As far as different sources, only one set is supplied and
it specifically states in the comments that the source
supports 3.x. There are, after all, 3.1 versions of the
windows installer.

I certainly woudn't be surprised by the need for seperate
sources, but wouldn't such seperate sources have been
supplied and seperate setup scripts been provided?

I was just digging though the sources- turns out it is a Python issue.
GMPY compiles using distutil's makefile.
/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config/Makefile

That makefile specifies the 10.4 SDK and a MACOSX_DEPLOYMENT_TARGET of
10.3. I don't know how you'd fix this to work on all supported
versions of OS X, but that seems to be the problem.
 
C

casevh

Ok, so I got a MacBook Air.
Has OS X 10.6 (Snow Leopard) and Python 2.6.1 already installed.
So I install Xcode, download macports and download gmpy-1.11rc1.
Following the instructions in mac_build.txt, I do the following:
- sudo /opt/local/bin/port install gmp
This works fine.
Then I do
- python setup.py install
This also works (a few warnings, but nothing looked serious).
Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import gmpy
gmpy.version()
'1.11'
python gmpy_test.py
Unit tests for gmpy 1.11
on Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)
[GCC 4.2.1 (Apple Inc. build 5646)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 151 tests, 0 failures
.
.
.
25 tests in gmpy_test_rnd.__test__.rand
1469 tests in 42 items.
1469 passed and 0 failed.
Test passed.
Looks like a viable gmpy module for 2.6.
What do I do AFTER I install Python 3.1? Just running python3.1 from
the
same directory doesn't work.
I've spent the last 5 days trying to figure that out. I hosed it so
bad
I somehow wrecked the 2.6 version to the point where it won't even
load.
I just got done doing a factory restore of the entire OS to undo
everything
I did. Re-did all the above and got it back working. Haven't re-
installed 3.1
yet.
Anbody have any idea how to make this work?
Did you run setup.py with python3? Python 3.1 won't install itself as
the default python install for compatibility reasons so you have to
run "python3 install setup.py" to install it for that version of
python.
I wondered why there was both python3 and python3.1 in the bin
directory.
But why, when I type...
$ python3
...do I get...
Python 3.1.1 (r311:74543, Aug 24 2009, 18:44:04)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
[1]+ Stopped python3
I get the same result with python3.1.
So, no, trying python3 is of no help, same errors as before.
There's hundreds of them, but they start out
$ /Library/Frameworks/Python.framework/Versions/3.1/bin/python3
setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.3-fat-3.1
creating build/temp.macosx-10.3-fat-3.1/src
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
Please check your Xcode installation
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I./src -I/
opt/local/include -I/Library/Frameworks/Python.framework/Versions/3.1/
include/python3.1 -c src/gmpy.c -o build/temp.macosx-10.3-fat-3.1/src/
gmpy.o
In file included from src/gmpy.c:206:
/Library/Frameworks/Python.framework/Versions/3.1/include/python3..1/
Python.h:11:20: error: limits.h: No such file or directory
/Library/Frameworks/Python.framework/Versions/3.1/include/python3..1/
Python.h:14:2: error: #error "Something's broken. UCHAR_MAX should be
defined in limits.h."
/Library/Frameworks/Python.framework/Versions/3.1/include/python3..1/
Python.h:18:
Any other ideas? Do I have to install a separate Python 3?
That's not a Python 3 problem. It appears to be a problem in the build script.
Compiling with an SDK that doesn't seem to exist: /Developer/SDKs/
MacOSX10.4u.sdk
My guess would be you're on Snow Leopard while the original developer
is either on Tiger or Leopard. The script wants to use the 10.4 SDK
but Apple only includes the SDKs for the latest 2 versions of OS X.
I just thought of something. Why I am able to do the build for python
2.6?
Wouldn't that also fail for lack of a 10.4 SDK?
I think you'd need different C sources for 2.x and 3.x because I think
the C API changed quite a bit.
I can see that.
But Python 2.6 must not care about whether the 10.4SDK
exists or not. It must be using 10.5 or 10.6 since they
are te only SDKs that do exist.
As far as different sources, only one set is supplied and
it specifically states in the comments that the source
supports 3.x. There are, after all, 3.1 versions of the
windows installer.
I certainly woudn't be surprised by the need for seperate
sources, but wouldn't such seperate sources have been
supplied and seperate setup scripts been provided?

I was just digging though the sources- turns out it is a Python issue.
GMPY compiles using distutil's makefile.
/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/config/Makefile

That makefile specifies the 10.4 SDK and a MACOSX_DEPLOYMENT_TARGET of
10.3. I don't know how you'd fix this to work on all supported
versions of OS X, but that seems to be the problem.
(I'm one of the GMPY maintainers but I have no access to Macs....)

The same GMPY source should should compile with all version of Python
2.4 and later.

I think the makefile is created when that specific version of Python
is compiled. Was Python 3.1 included with OS X or was it installed
separately? If it was installed separately, was it installed from
macports or python.org?

I have a couple other generic questions.

Is Python 2.6 built as a 32 or 64-bit application? (sys.maxint)

Is the gmp library 32 or 64-bit? (gmpy.gmp_limbsize())

For best performance with large numbers, GMPY should be compiled as a
64-bit application. If Python and gmp are not compiled in 64-bit mode,
you probably will want to compile both of them from source or find 64-
bit versions.

casevh
 
B

Benjamin Kaplan

(I'm one of the GMPY maintainers but I have no access to Macs....)

The same GMPY source should should compile with all version of Python
2.4 and later.

Like I said in the my last post, it appears to be an issue with
distutils distributed with the python.org installer. The makefile
distutils uses to compile C sources specifies the SDK for 10.4, but
Apple only gives the SDKs for the latest two versions of OS X (10.5
and 10.6 right now)
I think the makefile is created when that specific version of Python
is compiled. Was Python 3.1 included with OS X or was it installed
separately? If it was installed separately, was it installed from
macports or python.org?

Python 3 has to be installed separately. The issues appear in the
python.org installer. I haven't tried using Macports yet.
I have a couple other generic questions.

Is Python 2.6 built as a 32 or 64-bit application? (sys.maxint)

Is the gmp library 32 or 64-bit? (gmpy.gmp_limbsize())

For best performance with large numbers, GMPY should be compiled as a
64-bit application. If Python and gmp are not compiled in 64-bit mode,
you probably will want to compile both of them from source or find 64-
bit versions.

Macs usually work with Universal binaries. The System's Python 2.6 is
a 3-way binary: ppc, i386, and x86_64. It runs in 64-bit mode when
you're on a Mac with a 64-bit processor and 32-bit mode when you're on
a 32-bit processor. If gmp was built using Macports, then it was
compiled to whatever the system supports, so most likely 64-bit.
 
M

Mensanator

PROBLEM RESOLVED!

Yes, it does appear that the disk image on pytho.ord is defective
(maybe they made the image from an obsolete version?)

I installed Python 3.1 from macports and everything seems to work
now. (I never would have figured it out, although installing
from macports was on my long erm list of things to try).

# after macports install of Python 3.1

$ python setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build/temp.macosx-10.6-i386-3.1
creating build/temp.macosx-10.6-i386-3.1/src
/usr/bin/gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g
-fwrapv -O3 -Wall -Wstrict-prototypes -I./src -I/opt/local/include -I/
opt/local/Library/Frameworks/Python.framework/Versions/3.1/include/
python3.1 -c src/gmpy.c -o build/temp.macosx-10.6-i386-3.1/src/gmpy.o
creating build/lib.macosx-10.6-i386-3.1
/usr/bin/gcc-4.2 -L/opt/local/lib -bundle -undefined dynamic_lookup
build/temp.macosx-10.6-i386-3.1/src/gmpy.o -L/opt/local/lib -lgmp -o
build/lib.macosx-10.6-i386-3.1/gmpy.so
running install_lib
copying build/lib.macosx-10.6-i386-3.1/gmpy.so -> /opt/local/Library/
Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages
error: /opt/local/Library/Frameworks/Python.framework/Versions/3.1/lib/
python3.1/site-packages/gmpy.so: Permission denied

# minor glitch, easily resolveable

$ sudo python setup.py install
running install
running build
running build_ext
running install_lib
copying build/lib.macosx-10.6-i386-3.1/gmpy.so -> /opt/local/Library/
Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages
running install_egg_info
Writing /opt/local/Library/Frameworks/Python.framework/Versions/3.1/
lib/python3.1/site-packages/gmpy-1.11rc1-py3.1.egg-info

$ python
Python 3.1.1 (r311:74480, Dec 26 2009, 15:02:38)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.[2]+ Stopped pytho

$ python test3/gmpy_test.py
Unit tests for gmpy 1.11
on Python 3.1.1 (r311:74480, Dec 26 2009, 15:02:38)
[GCC 4.2.1 (Apple Inc. build 5646) (dot 1)]
Testing gmpy 1.11 (GMP 4.3.1), default caching (100, 128)
gmpy_test_cvr 148 tests, 0 failures
gmpy_test_rnd 26 tests, 0 failures
..
..
..
1500 tests in 42 items.
1500 passed and 0 failed.
Test passed.

Thanks guys, you saved my Christmas! I was afraid this MacBook was
going
to turn into a waste of money.

I guess the point here is NEVER use the disk image on python.org,
ALWAYS use macports to install Python 3.1.

At least until python.org fixes it.
 
B

Benjamin Kaplan

I guess the point here is NEVER use the disk image on python.org,
ALWAYS use macports to install Python 3.1.

At least until python.org fixes it.

Have you filed a bug report on this?
 
M

Mensanator


....NOT!

*I* won't be filling a bug report because *I* am still
locked out of python.org (it won't let me register).

Sorry, but this is beyond my control. All I can do is
report problems on comp.lang.python.
 
S

Steve Holden

Mensanator said:
Thank you! I would hate to see anyone else go through this hassle.
Perhpas you would do me a favor and report the problem about being
unable to register on bugs.python.org to the pydotorg webmaster list
(pydotorg at python dot org) and let me know if you get any result.

Please be sure to identify explicitly what the problem is and on which
page(s) it occurs.

Thanks
Steve
 
M

Mensanator

Perhpas you would do me a favor and report the problem about being
unable to register on bugs.python.org to the pydotorg webmaster list
(pydotorg at python dot org) and let me know if you get any result.

Ok, i reported it.
Please be sure to identify explicitly what the problem is and on which
page(s) it occurs.

It wasn't any page per se, it was supposed to send an e-mail for me to
follow up the registration. I never got any e-mail.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top