This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: question about fortran on the new intel Mac
On Apr 7, 2006, at 10:17:47, FX Coudert wrote:
Hi Erik,
I have gfortran working, starting from the SVN version and
applying some patches. It's not clean, and I hope that the
official version will work in a few days/weeks. There are two or
three small problems, solutions for these are known and patches
exist, but they have somehow not yet been officially applied.
I'm also interested in this. Do you have pointers to these patches?
Were they proposed on the gcc-patches ml?
Here is my recipe for using gfortran on a MacBook Pro, which has an
Intel processor. I use Mac OS X 10.4.6, which runs on Darwin 8.6.1.
It seems that gfortran is in a much better shape than when I started
to use it on a Mac -- I think that all gfortran problems that I
encountered have been solved in the mean time.
0. I started from gcc 112496 (this is the subversion version
number). I assume that later versions also work; maybe some of the
patches that I applied are then superfluous.
1. I installed a newer version of cctools. I use version 590.36;
version 590.23 does not work. This corrects an error with the symbol
"__dso_handle".
2. I installed the patch http://gcc.gnu.org/ml/gcc-patches/2006-02/
msg02041.html, which is supposed to correct an error with
"__Unwind_GetIPInfo", apparently for g++. I do not know whether this
patch is necessary, or whether it has been applied or superseded.
3. I installed a patch that corrects the initialisation of the SSE
unit in gfortran. This is bug 26712. I see that this bug has been
closed in the mean time, so that you don't need the patch below if
you use a current svn version.
Index: libgfortran/config/fpu-387.h
===================================================================
--- libgfortran/config/fpu-387.h (revision 112496)
+++ libgfortran/config/fpu-387.h (working copy)
@@ -93,12 +93,13 @@
/* SSE */
asm volatile ("stmxcsr %0" : "=m" (cw_sse));
cw_sse &= 0xFFFF0000;
- if (options.fpe & GFC_FPE_INVALID) cw_sse |= 1 << 7;
- if (options.fpe & GFC_FPE_DENORMAL) cw_sse |= 1 << 8;
- if (options.fpe & GFC_FPE_ZERO) cw_sse |= 1 << 9;
- if (options.fpe & GFC_FPE_OVERFLOW) cw_sse |= 1 << 10;
- if (options.fpe & GFC_FPE_UNDERFLOW) cw_sse |= 1 << 11;
- if (options.fpe & GFC_FPE_PRECISION) cw_sse |= 1 << 12;
+ cw_sse |= (_FPU_MASK_IM | _FPU_MASK_DM | _FPU_MASK_ZM |
_FPU_MASK_OM | _FPU_MASK_UM | _FPU_MASK_PM ) << 7;
+ if (options.fpe & GFC_FPE_INVALID) cw_sse &= ~(_FPU_MASK_IM <<
7);
+ if (options.fpe & GFC_FPE_DENORMAL) cw_sse &= ~(_FPU_MASK_DM
<< 7);
+ if (options.fpe & GFC_FPE_ZERO) cw_sse &= ~(_FPU_MASK_ZM << 7);
+ if (options.fpe & GFC_FPE_OVERFLOW) cw_sse &= ~(_FPU_MASK_OM
<< 7);
+ if (options.fpe & GFC_FPE_UNDERFLOW) cw_sse &= ~(_FPU_MASK_UM
<< 7);
+ if (options.fpe & GFC_FPE_PRECISION) cw_sse &= ~(_FPU_MASK_PM
<< 7);
asm volatile ("ldmxcsr %0" : : "m" (cw_sse));
}
}
Summing up, you have to use a new version of cctools to correct a
problem with Apple's linker, and you may have to apply a patch to
correct an error in g++. I assume that the gfortran problem has been
solved in the mean time.
-erik
--
Erik Schnetter <schnetter@cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
Attachment:
PGP.sig
Description: This is a digitally signed message part