
Hi, Firstly thanks to everyone that has helped bring NumPy to the point it is today. Its an excellent bit of software. I've recently managed to get NumPy to compile on a 64 bit Solaris 10 (sparc) machine. We've embedded 64 bit Python in some of our C code using the Python C-API, and therefore require a 64 bit version of NumPy. I had to use a bit of a hack to get NumPy to compile in 64 bit mode, and I'm just wondering if there's a more elegant way of doing it? If I set CFLAGS to "-m64 -xcode=pic32", and CC to "/usr/bin/cc", it will raise the following error: ... snipped most of backtrace ... File "/home/leblanc/source/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 675, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program") However, if I create a wrapper script and set CC to the path of the wrapper, then it will build normally and create a NumPy module I can use from the 64 bit version of Python installed on the system (/usr/bin/sparcv9/python). Here's the wrapper: #!/bin/sh /usr/bin/cc -m64 -xcode=pic32 $* I did a bit of googling and couldn't find much information on this issue (which is why I wanted to post this message, so others could find it). I'm satisfied with the results, but wondering if there's a better way to do it. Cheers, Chris Chris LeBlanc GNS Science

Hi,
Firstly thanks to everyone that has helped bring NumPy to the point it is today. Its an excellent bit of software.
I've recently managed to get NumPy to compile on a 64 bit Solaris 10 (sparc) machine. We've embedded 64 bit Python in some of our C code using the Python C-API, and therefore require a 64 bit version of NumPy.
I had to use a bit of a hack to get NumPy to compile in 64 bit mode, and I'm just wondering if there's a more elegant way of doing it?
If I set CFLAGS to "-m64 -xcode=pic32", and CC to "/usr/bin/cc", it will raise the following error:
... snipped most of backtrace ... File "/home/leblanc/source/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 675, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program")
However, if I create a wrapper script and set CC to the path of the wrapper, then it will build normally and create a NumPy module I can use from the 64 bit version of Python installed on the system (/usr/bin/sparcv9/python). Here's the wrapper:
#!/bin/sh /usr/bin/cc -m64 -xcode=pic32 $*
I did a bit of googling and couldn't find much information on this issue (which is why I wanted to post this message, so others could find it). I'm satisfied with the results, but wondering if there's a better way to do it.
It's because CFLAGS does not append to but overrides flags. Your wrapper
On Tue, Jun 15, 2010 at 11:06 AM, Chris LeBlanc <crleblanc@gmail.com> wrote: script manages to append flags. Does the patch in http://projects.scipy.org/numpy/ticket/1382 work for you? If so it can be applied I think. Cheers, Ralf

Hi Ralf, Thanks for the information. I'll have a look at it, and see if it solves the issue. Cheers, Chris On 18 June 2010 01:53, Ralf Gommers <ralf.gommers@googlemail.com> wrote:
On Tue, Jun 15, 2010 at 11:06 AM, Chris LeBlanc <crleblanc@gmail.com> wrote:
Hi,
Firstly thanks to everyone that has helped bring NumPy to the point it is today. Its an excellent bit of software.
I've recently managed to get NumPy to compile on a 64 bit Solaris 10 (sparc) machine. We've embedded 64 bit Python in some of our C code using the Python C-API, and therefore require a 64 bit version of NumPy.
I had to use a bit of a hack to get NumPy to compile in 64 bit mode, and I'm just wondering if there's a more elegant way of doing it?
If I set CFLAGS to "-m64 -xcode=pic32", and CC to "/usr/bin/cc", it will raise the following error:
... snipped most of backtrace ... File "/home/leblanc/source/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 675, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program")
However, if I create a wrapper script and set CC to the path of the wrapper, then it will build normally and create a NumPy module I can use from the 64 bit version of Python installed on the system (/usr/bin/sparcv9/python). Here's the wrapper:
#!/bin/sh /usr/bin/cc -m64 -xcode=pic32 $*
I did a bit of googling and couldn't find much information on this issue (which is why I wanted to post this message, so others could find it). I'm satisfied with the results, but wondering if there's a better way to do it.
It's because CFLAGS does not append to but overrides flags. Your wrapper script manages to append flags.
Does the patch in http://projects.scipy.org/numpy/ticket/1382 work for you? If so it can be applied I think.
Cheers, Ralf
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

On 06/17/10 02:53 PM, Ralf Gommers wrote:
On Tue, Jun 15, 2010 at 11:06 AM, Chris LeBlanc<crleblanc@gmail.com> wrote:
Hi,
Firstly thanks to everyone that has helped bring NumPy to the point it is today. Its an excellent bit of software.
I've recently managed to get NumPy to compile on a 64 bit Solaris 10 (sparc) machine. We've embedded 64 bit Python in some of our C code using the Python C-API, and therefore require a 64 bit version of NumPy.
I had to use a bit of a hack to get NumPy to compile in 64 bit mode, and I'm just wondering if there's a more elegant way of doing it?
If I set CFLAGS to "-m64 -xcode=pic32", and CC to "/usr/bin/cc", it will raise the following error:
... snipped most of backtrace ... File "/home/leblanc/source/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 675, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program")
However, if I create a wrapper script and set CC to the path of the wrapper, then it will build normally and create a NumPy module I can use from the 64 bit version of Python installed on the system (/usr/bin/sparcv9/python). Here's the wrapper:
#!/bin/sh /usr/bin/cc -m64 -xcode=pic32 $*
I did a bit of googling and couldn't find much information on this issue (which is why I wanted to post this message, so others could find it). I'm satisfied with the results, but wondering if there's a better way to do it.
It's because CFLAGS does not append to but overrides flags. Your wrapper script manages to append flags.
Does the patch in http://projects.scipy.org/numpy/ticket/1382 work for you? If so it can be applied I think.
Cheers, Ralf
Ralf, looking at that patch, it is for the Sun compiler and will not work with gcc. However, I did find a very simple solution to this. CC="gcc -m64" export CC then Numpy builds fine. (I also had CFLAGS set too, though I'm not sure if that's really necessary if CC is set). Dave

On 06/15/10 04:06 AM, Chris LeBlanc wrote:
Hi,
Firstly thanks to everyone that has helped bring NumPy to the point it is today. Its an excellent bit of software.
I've recently managed to get NumPy to compile on a 64 bit Solaris 10 (sparc) machine. We've embedded 64 bit Python in some of our C code using the Python C-API, and therefore require a 64 bit version of NumPy.
I had to use a bit of a hack to get NumPy to compile in 64 bit mode, and I'm just wondering if there's a more elegant way of doing it?
If I set CFLAGS to "-m64 -xcode=pic32", and CC to "/usr/bin/cc", it will raise the following error:
... snipped most of backtrace ... File "/home/leblanc/source/numpy/numpy/distutils/command/build_src.py", line 385, in generate_sources source = func(extension, build_dir) File "numpy/core/setup.py", line 675, in get_mathlib_info raise RuntimeError("Broken toolchain: cannot link a simple C program")
However, if I create a wrapper script and set CC to the path of the wrapper, then it will build normally and create a NumPy module I can use from the 64 bit version of Python installed on the system (/usr/bin/sparcv9/python). Here's the wrapper:
#!/bin/sh /usr/bin/cc -m64 -xcode=pic32 $*
I did a bit of googling and couldn't find much information on this issue (which is why I wanted to post this message, so others could find it). I'm satisfied with the results, but wondering if there's a better way to do it.
Cheers, Chris
Chris LeBlanc
Chris, I just repied to your post, thinking it was one I had made, since I did post on a very similar topic - building numpy on 64-bit Solaris! The solution which worked for me was CC="gcc -m64" export CC I guess if you use the Sun compiler, it will be CC="cc -m64" export CC Dave
participants (3)
-
Chris LeBlanc
-
Dr. David Kirkby
-
Ralf Gommers