[SciPy-dev] newcore and gcc4/gfortran (only 3 tests fail now)

Ravikiran Rajagopal ravi at ati.com
Sat Nov 19 13:38:57 EST 2005


Hi,
  A little more progress. I can now compile and run tests on gcc4/gfortran without any segfaults. This is on Fedora Core 4, with gcc 4.0.2 branch SVN checkout from Nov 9 along with a few patches from Redhat. I can make the source/binary RPMs available to anyone - I don't have a website to host it though. I think Arnd's build is messed up because of his installed g77. He needs the following patch before he can actually get a true compiled version:

Index: scipy/distutils/fcompiler/gnu.py
===================================================================
--- scipy/distutils/fcompiler/gnu.py    (revision 1513)
+++ scipy/distutils/fcompiler/gnu.py    (working copy)
@@ -230,7 +230,26 @@
     module_dir_switch = '-M'
     module_include_switch = '-I'

+    def get_libraries(self):
+        opt = []
+        d = self.get_libgcc_dir()
+        if d is not None:
+            g2c = 'gfortran-pic'
+            f = self.static_lib_format % (g2c, self.static_lib_extension)
+            if not os.path.isfile(os.path.join(d,f)):
+                g2c = 'gfortran'
+        else:
+            g2c = 'gfortran'

+        if sys.platform=='win32':
+            opt.append('gcc')
+        if g2c is not None:
+            opt.append(g2c)
+        if sys.platform == 'darwin':
+            opt.append('cc_dynamic')
+        return opt
+
+
 if __name__ == '__main__':
     from distutils import log
     log.set_verbosity(2)

Note that this patch handles only gfortran. I don't have g95 available to test. Could someone commit this and makesure the proper g95 library is used for that case?

> Which is perfectly understandable!
> Just for the record - I also tried the gcc4/g77 variant, which gets beyond
> the above point, but segfaults at another place:

There are now only 3 errors with core 0.7.1.1513 and scipy 0.4.2_1446:

======================================================================
ERROR: check_dot (scipy.lib.blas.test_blas.test_fblas1_simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/scipy/lib/blas/tests/test_blas.py", line 75, in check_dot
    assert_almost_equal(f([3j,-4,3-4j],[2,3,1]),-9+2j)
SystemError: NULL result without error in PyObject_Call

======================================================================
ERROR: check_dot (scipy.linalg.blas.test_blas.test_fblas1_simple)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/scipy/linalg/tests/test_blas.py", line 75, in check_dot
    assert_almost_equal(f([3j,-4,3-4j],[2,3,1]),-9+2j)
SystemError: NULL result without error in PyObject_Call

======================================================================
ERROR: line-search Newton conjugate gradient optimization routine
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/scipy/optimize/tests/test_optimize.py", line 103, in check_ncg
    full_output=False, disp=False, retall=False)
  File "/usr/lib/python2.4/site-packages/scipy/optimize/optimize.py", line 969, in fmin_ncg
    alphak, fc, gc, old_fval = line_search_BFGS(f,xk,pk,gfk,old_fval)
  File "/usr/lib/python2.4/site-packages/scipy/optimize/optimize.py", line 556, in line_search_BFGS
    phi_a2 = apply(f,(xk+alpha2*pk,)+args)
  File "/usr/lib/python2.4/site-packages/scipy/optimize/optimize.py", line 133, in function_wrapper
    return function(x, *args)
  File "/usr/lib/python2.4/site-packages/scipy/optimize/tests/test_optimize.py", line 30, in func
    raise RuntimeError, "too many iterations in optimization routine"
RuntimeError: too many iterations in optimization routine

----------------------------------------------------------------------
Ran 1370 tests in 114.800s

FAILED (errors=3)

I do not think any of these failures are related to gfortran, but I could be horribly wrong. How can I help debug these failures? I vaguely recall looking at check_dot a few months ago while debugging a segfault, but not much else.

Regards,
Ravi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20051119/1cbb0448/attachment.html>


More information about the SciPy-Dev mailing list