[SciPy-user] SciPy with gcc4 and gfortran on OS X

Zachary Pincus zpincus at stanford.edu
Sat Apr 8 11:03:49 CDT 2006


> Try `config_fc --noopt --noarch build`. Does this fix these issues?

Hmm. Now I get different errors (see below). Impressive.

> Could you send me the patch or file the corresponding ticket to
> numpy.distutils?

My slightly modified versions of Neil Becker's patches are attached.  
Now, I'm not sure that these should be applied generally. First,  
regarding the numpy patch, I'm not sure if there's a reason for not  
passing the extra_postargs to the fortran compiler, so I'm not sure  
if this patch would cause problems if generally applied.
Second, regarding the scipy patch, as is it will pass '-O' to all  
fortran compilers when the mach codes are compiled. Probably not  
good! Better would be to test if gfortran was in use and just pass '- 
O' in that case. Even better might be to just assume that gfortran  
optimizations are bad in general and disable them wholesale. Then at  
least bizarre compiler-specific stuff wouldn't be littered all over  
various setup.py files.

Zach

New errors when compiling without optimizations:
======================================================================
FAIL: check_cdf (scipy.stats.tests.test_distributions.test_fatiguelife)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "<string>", line 9, in check_cdf
AssertionError: D = 0.393270222394; pval = 5.39820008418e-05; alpha =  
0.01
args = (1.299268127930717,)

======================================================================
FAIL: check_dot (scipy.lib.tests.test_blas.test_fblas1_simple)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/scipy/lib/blas/tests/test_blas.py", line 76,  
in check_dot
     assert_almost_equal(f([3j,-4,3-4j],[2,3,1]),-9+2j)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/numpy/testing/utils.py", line 148, in  
assert_almost_equal
     assert round(abs(desired - actual),decimal) == 0, msg
AssertionError:
Items are not equal:
DESIRED: (-9+2j)
ACTUAL: (-1.9985527992248535+3.0378070058602205e-37j)

======================================================================
FAIL: check_dot (scipy.linalg.tests.test_blas.test_fblas1_simple)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "/Library/Frameworks/Python.framework/Versions/2.4/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)
   File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages/numpy/testing/utils.py", line 148, in  
assert_almost_equal
     assert round(abs(desired - actual),decimal) == 0, msg
AssertionError:
Items are not equal:
DESIRED: (-9+2j)
ACTUAL: (-1.9985527992248535+3.0392849833765131e-37j)

----------------------------------------------------------------------
Ran 1506 tests in 12.599s

FAILED (failures=3)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: numpy-gfortran.patch
Type: application/octet-stream
Size: 702 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060408/2165ae45/numpy-gfortran.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scipy-gfortran.patch
Type: application/octet-stream
Size: 1366 bytes
Desc: not available
Url : http://www.scipy.net/pipermail/scipy-user/attachments/20060408/2165ae45/scipy-gfortran.obj
-------------- next part --------------

On Apr 8, 2006, at 3:41 AM, Pearu Peterson wrote:

>
>
> On Fri, 7 Apr 2006, Zachary Pincus wrote:
>
>> Hi folks -
>>
>> Several issues:
>> (1) I think that the cc_dynamic library is still needed for gcc3/g77,
>> so it shouldn't be removed from numpy.distutils wholesale. Removing
>> cc_dynamic from *just* gnu95 is the way to go.
>
> The corresponding patch has been applied to SVN.
>
>> (2) After applying the patches that I referred to earlier, I was able
>> to compile and test SciPy.
>
> Could you send me the patch or file the corresponding ticket to
> numpy.distutils?
>
>> Maybe for the time being scipy should disable gfortran optimization
>> until the compiler gets a bit more stable?
>
> Try `config_fc --noopt --noarch build`. Does this fix these issues?
>
> Pearu
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user



More information about the SciPy-user mailing list