Closed cdeil closed 6 years ago
Ah ... so pyds9
does have some tests!
I'm getting this:
$ python -c 'import pyds9; pyds9.test()'
starting quick test for pyds9 version 1.7
looking for our 'pytest' ds9 ...
starting ds9 ...
waiting for ds9 to be available
.
.
.
.
.
.
.
.
.
.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/deil/Library/Python/3.4/lib/python/site-packages/pyds9.py", line 769, in test
raise ValueError("tired of waiting for ds9!")
ValueError: tired of waiting for ds9!
for the compilation error I have no idea. I can compile with without problem under ubuntu with gcc 4.9.2 and opensuse with gcc 5.x.x (I don't remember the exact version).
For the test: if you are in the source directory you can also run it with python pyds9.py
.
I had a similar problem and @ericmandel wrote this
I just built successfully on my Mac, using the Apple-supplied gcc (which is clang-602.0.53).
But here and here are discussions. I hate to add and commit the recommended link switch without actually seeing the problem and then seeing it go away. So @cdeil, if you could edit your setup.py on the machine where this is happening, and add "-Wl,-no_compact_unwind" to CFLAGS (which will then be passed to the linker), that would tell us something.
If I add "-Wl,-no_compact_unwind" to CFLAGS for the default Mac compiler (ggg -> clang), I get a warning:
gcc -c -I. -O2 -Wl,-no_compact_unwind -DHAVE_CONFIG_H xpamb.c
clang: warning: -Wl,-no_compact_unwind: 'linker' input unused
It looks like we can add it to LDFLAGS safely, without any warnings. So, @cdeil, instead of the above, please try editing your setup.py as follows:
diff --git a/setup.py b/setup.py
index 55da589..450ce01 100644
--- a/setup.py
+++ b/setup.py
@@ -28,11 +28,15 @@ def make(which):
if which == 'all':
os.system('echo "building XPA shared library ..."')
cflags = ''
+ ldflags = ''
if 'CFLAGS' not in os.environ and struct.calcsize("P") == 4:
if ulist[0] == 'Darwin' or ulist[4] == 'x86_64':
os.system('echo "adding -m32 to compiler flags ..."')
cflags = ' CFLAGS="-m32"'
- os.system('./configure --enable-shared --without-tcl'+cflags)
+ if 'LDFLAGS' not in os.environ:
+ if ulist[0] == 'Darwin':
+ ldflags = ' LDFLAGS="-no_compact_unwind"'
+ os.system('./configure --enable-shared --without-tcl'+cflags+ldflags)
os.system('make clean; make; rm -f *.o')
elif which == 'clean':
os.system('echo "cleaning XPA ..."')
and see of the warning goes away.
I close this issue: the build system has changed (now it uses astropy-helpers) and pyds9 builds on one osx instance in travis-ci.
I wanted to try out
pyds9
on my Mac, but it doesn't work with Python 2 or 3.The build log shows that somehow gcc 4.9 from Macports is picked as compiler and there's these linker errors:
Importing
pyds9
works, but when I try to create aDS9
object, the DS9 Window comes up, but the Python prompt hangs for a few seconds and then errors out like this (leaving the DS9 Window open after the Python interpreter exists):@montefra @ericmandel Any idea what the issue is or how I can debug / try to fix it?