[CIG-SEISMO] SpecFEM3DGlobe: a bug resolved - Nov. 02, 2010

Signature science0.delphin at laposte.net
Fri Nov 5 09:28:10 PDT 2010


Dear Sir:

Thank you very much for your kind answer. As son as I have time to build SpecFEM3DGlobe with your new C file, I will be in touch with you again to let you know how it works. Please may I tell you that Mac hardware is Core 2 Duo with an Intel processor. Again, I built OpenMPI myself to enable Fortran compilation with parallellism taht is not provided by Apple (but CC, C++/CXX).

Besides, please find enclosed a copy of a GCC manual that helped me to fix the "bug" with Mac OS X. Hereafter, you will find a short appendix about the section I found relevant some days ago.

Next step will be to test your software.

Again, thank you very much.
Hoping you a good receipt.

Kind regards,




Laurent Delphin, Dunkerque (EU)
LDVenture 

Space Systems, Sustainable Life, & Ecosystems Advisor
Research, Survey, Design, & Management


#=======================================================================
# 
# APPENDIX

5.49 Other built-in functions provided by GCC
GCC provides a large number of built-in functions other than the ones mentioned above.
Some of these are for internal use in the processing of exceptions or variable-length argument
lists and will not be documented here because they may change from time to time; we do
not recommend general use of these functions.
The remaining functions are provided for optimization purposes.
GCC includes built-in versions of many of the functions in the standard C library. The
versions prefixed with __builtin_ will always be treated as having the same meaning as 
the C library function even if you specify the ‘-fno-builtin’ option. (see Section 3.4 [C 
Dialect Options], page 27) Many of these functions are only optimized in certain cases; if 
they are not optimized in a particular case, a call to the library function will be emitted.

Outside strict ISO C mode (‘-ansi’, ‘-std=c89’ or ‘-std=c99’), the functions _exit,
alloca, bcmp, bzero, dcgettext, dgettext, dremf, dreml, drem, exp10f, exp10l, exp10,
ffsll, ffsl, ffs, fprintf_unlocked, fputs_unlocked, gammaf, gammal, gamma, gammaf_ 
r, gammal_r, gamma_r, gettext, index, isascii, j0f, j0l, j0, j1f, j1l, j1, jnf, jnl, jn,
lgammaf_r, lgammal_r, lgamma_r, mempcpy, pow10f, pow10l, pow10, printf_unlocked,
rindex, scalbf, scalbl, scalb, signbit, signbitf, signbitl, signbitd32, signbitd64,
signbitd128, significandf, significandl, significand, sincosf, sincosl, sincos,
stpcpy, stpncpy, strcasecmp, strdup, strfmon, strncasecmp, strndup, toascii, y0f,
y0l, y0, y1f, y1l, y1, ynf, ynl and yn may be handled as built-in functions. All these 
functions have corresponding versions prefixed with __builtin_, which may be used even 
in strict C89 mode.

The ISO C99 functions _Exit, acoshf, acoshl, acosh, asinhf, asinhl, asinh,
atanhf, atanhl, atanh, cabsf, cabsl, cabs, cacosf, cacoshf, cacoshl, cacosh, cacosl,
cacos, cargf, cargl, carg, casinf, casinhf, casinhl, casinh, casinl, casin, catanf,
catanhf, catanhl, catanh, catanl, catan, cbrtf, cbrtl, cbrt, ccosf, ccoshf, ccoshl,
ccosh, ccosl, ccos, cexpf, cexpl, cexp, cimagf, cimagl, cimag, clogf, clogl, clog,
conjf, conjl, conj, copysignf, copysignl, copysign, cpowf, cpowl, cpow, cprojf, 
356 Using the GNU Compiler Collection (GCC)
cprojl, cproj, crealf, creall, creal, csinf, csinhf, csinhl, csinh, csinl, csin,
csqrtf, csqrtl, csqrt, ctanf, ctanhf, ctanhl, ctanh, ctanl, ctan, erfcf, erfcl,
erfc, erff, erfl, erf, exp2f, exp2l, exp2, expm1f, expm1l, expm1, fdimf, fdiml, fdim,
fmaf, fmal, fmaxf, fmaxl, fmax, fma, fminf, fminl, fmin, hypotf, hypotl, hypot,
ilogbf, ilogbl, ilogb, imaxabs, isblank, iswblank, lgammaf, lgammal, lgamma, llabs,
llrintf, llrintl, llrint, llroundf, llroundl, llround, log1pf, log1pl, log1p,
log2f, log2l, log2, logbf, logbl, logb, lrintf, lrintl, lrint, lroundf, lroundl,
lround, nearbyintf, nearbyintl, nearbyint, nextafterf, nextafterl, nextafter,
nexttowardf, nexttowardl, nexttoward, remainderf, remainderl, remainder, remquof,
remquol, remquo, rintf, rintl, rint, roundf, roundl, round, scalblnf, scalblnl,
scalbln, scalbnf, scalbnl, scalbn, snprintf, tgammaf, tgammal, tgamma, truncf,
truncl, trunc, vfscanf, vscanf, vsnprintf and vsscanf are handled as built-in 
functions except in strict ISO C90 mode (‘-ansi’ or ‘-std=c89’).
There are also built-in versions of the ISO C99 functions acosf, acosl, asinf, asinl,
atan2f, atan2l, atanf, atanl, ceilf, ceill, cosf, coshf, coshl, cosl, expf, expl,
fabsf, fabsl, floorf, floorl, fmodf, fmodl, frexpf, frexpl, ldexpf, ldexpl, log10f,
log10l, logf, logl, modfl, modf, powf, powl, sinf, sinhf, sinhl, sinl, sqrtf, sqrtl,
tanf, tanhf, tanhl and tanl that are recognized in any mode since ISO C90 reserves these 
names for the purpose to which ISO C99 puts them. All these functions have corresponding
versions prefixed with __builtin_.
The ISO C94 functions iswalnum, iswalpha, iswcntrl, iswdigit, iswgraph, iswlower,
iswprint, iswpunct, iswspace, iswupper, iswxdigit, towlower and towupper are handled 
as built-in functions except in strict ISO C90 mode (‘-ansi’ or ‘-std=c89’). 
The ISO C90 functions abort, abs, acos, asin, atan2, atan, calloc, ceil, cosh,
cos, exit, exp, fabs, floor, fmod, fprintf, fputs, frexp, fscanf, isalnum, isalpha,
iscntrl, isdigit, isgraph, islower, isprint, ispunct, isspace, isupper, isxdigit,
tolower, toupper, labs, ldexp, log10, log, malloc, memchr, memcmp, memcpy, memset,
modf, pow, printf, putchar, puts, scanf, sinh, sin, snprintf, sprintf, sqrt, sscanf,
strcat, strchr, strcmp, strcpy, strcspn, strlen, strncat, strncmp, strncpy, strpbrk,
strrchr, strspn, strstr, tanh, tan, vfprintf, vprintf and vsprintf are all recognized 
as built-in functions unless ‘-fno-builtin’ is specified (or ‘-fno-builtin-function’ is 
specified for an individual function). All of these functions have corresponding versions
prefixed with __builtin_. 
GCC provides built-in versions of the ISO C99 floating point comparison macros that
avoid raising exceptions for unordered operands. They have the same names as the standard
macros ( isgreater, isgreaterequal, isless, islessequal, islessgreater, and
isunordered) , with __builtin_ prefixed. We intend for a library implementor to be 
able to simply #define each standard macro to its built-in equivalent. In the same fashion, 
GCC provides fpclassify, isfinite, isinf_sign and isnormal built-ins used with
__builtin_ prefixed. The isinf and isnan builtins appear both with and without the
__builtin_ prefix.
int __builtin_types_compatible_p (type1, type2) [Built-in Function] 
You can use the built-in function __builtin_types_compatible_p to determine 
whether two types are the same.
Chapter 5: Extensions to the C Language Family 357
This built-in function returns 1 if the unqualified versions of the types type1 and
type2 (which are types, not expressions) are compatible, 0 otherwise. The result of 
this built-in function can be used in integer constant expressions.
This built-in function ignores top level qualifiers (e.g., const, volatile). For example,
int is equivalent to const int. 
The type int[] and int[5] are compatible. On the other hand, int and char * are 
not compatible, even if the size of their types, on the particular architecture are the
same. Also, the amount of pointer indirection is taken into account when determining
similarity. Consequently, short * is not similar to short **. Furthermore, two types 
that are typedefed are considered compatible if their underlying types are compatible.
An enum type is not considered to be compatible with another enum type even if both 
are compatible with the same integer type; this is what the C standard specifies. For
example, enum {foo, bar} is not similar to enum {hot, dog}. 
You would typically use this function in code whose execution varies depending on
the arguments’ types.


#==========================================================================
> Message du 04/11/10 23:17
> De : "Dennis McRitchie" 
> A : "Signature" 
> Copie à : "Daniel B. Peter" , "Dimitri Komatitsch" , "Robert R. Knight" 
> Objet : RE: [CIG-SEISMO] SpecFEM3DGlobe: a bug resolved - Nov. 02, 2010
>
> Dear Mr. Delphin,
> 
> With regard to your changes to the param_reader.c source file, they unfortunately prevent us from compiling in our regular build environments. Hence I have made the following changes so that the source code should compile in our environments as well as yours.
> 
> Since Apple in their wisdom chose not to include strnlen and strndup as part of their gcc release, it is indeed appropriate to define these functions within param_reader.c . However, I have made the definitions conditional upon being compiled on an Apple system.
> 
> Also, I have kept our use of the FC_FUNC_ macro, so as to facilitate changing the naming convention should future users of this code need to build with different Fortran compilers and/or OSs where the name-mangling convention is other that the current underscore suffix.
> 
> Please try out the attached revised param_reader.c, and let us know if it works for you.
> 
> Best regards,
> Dennis McRitchie
> 
> Dennis McRitchie
> Computational Science and Engineering Support (CSES)
> Academic Services Department
> Office of Information Technology
> Princeton University
> 
> > -----Original Message-----
> > From: Dimitri Komatitsch [mailto:dimitri.komatitsch at univ-pau.fr]
> > Sent: Thursday, November 04, 2010 7:53 AM
> > To: Signature
> > Cc: cig-seismo at geodynamics.org; Dennis McRitchie; Jeroen Tromp; Min Chen; Vala Hjorleifsdottir; Brian
> > Savage; Shiann-Jong Lee; Dimitri Komatitsch; Roland Martin; Bernhard Schuberth; Carl Tape; Anne
> > Sieminski; Paul Friberg; Kasper van Wijk; Dylan Mikesell; Federica Magnoni; Hatice E. Bozdag; Hejun
> > Zhu; Pieyre Le Loher; Christina E. Morency; Emanuele Casarotti; Srujan Kumar ENAGANTI; Emmanuel
> > Chaljub; Tarje Nissen-Meyer; Qinya Liu; Yang Luo; Daniel B. Peter; Ying Zhou; Emiljana JORGJI; Paul
> > Cristini; Dennis McRitchie
> > Subject: Re: [CIG-SEISMO] SpecFEM3DGlobe: a bug resolved - Nov. 02, 2010
> > 
> > 
> > Dear Mr. Delphin,
> > 
> > Thank you very much for your contribution, which is very useful.
> > I have committed it to the official version of SPECFEM3D_GLOBE on our
> > SVN server.
> > 
> > I cc Dennis McRitchie from Princeton Univ., who wrote param_reader.c, to
> > make sure that he agrees with the changes.
> > 
> > I also cc Daniel Peter because he is currently working on the
> > attenuation routines of SPECFEM3D.
> > 
> > Merci beaucoup,
> > Bien cordialement,
> > 
> > Dimitri Komatitsch.
> > 
> > On 11/02/2010 03:59 PM, Signature wrote:
> > > Dear Sir:
> > >
> > > Please find enclosed two archived (zip) files about building
> > > SpecFEM3DGlobe under Mac OS X (Snow Leopard). A source file, namely
> > > param_reader.c, issues a compilation error avoiding building your software.
> > >
> > > In fact, two string-based functions are not taken by gcc in charge
> > > (please kindly see the GNU gcc user amnual for further informations). I
> > > have built them and integrated in the .c file. The zip file of SUCCESS
> > > includes the c file I modified.
> > >
> > > Consequently, the compilation and overall build processess succeeded.
> > > Nevertheless, I have not yet tested the executables files. MPI compilers
> > > were those included in the packages of OpenMPI (the MPI selected and
> > > provided by APPLE) and saved in /usr/local . Please kindly note that the
> > > Fortran MPI compilers are not provided by Apple: they lacked. So, for
> > > obvious and practical purposes, I built them.
> > >
> > > Eventually, and as soon as I have some time to spend on it, I will issue
> > > a technical report about my experience in building your sofwares with
> > > Snow Leopard, and will send it to you by email.
> > >
> > > Many many thanks for your kind attention and for the opportunity to give
> > > us and to use your open sources for R&D purposes.
> > >
> > > Kind regards,
> > >
> > >
> > > Laurent Delphin, Dunkerque (EU)
> > >
> > > *LDVenture*
> > >
> > > /Space Systems, Sustainable Life, & Ecosystems Advisor/
> > >
> > > /Research, Survey, Design, & Management/
> > >
> > >
> > >
> > > Pieddemail
> > > 
> > >
> > >
> > >
> > > _______________________________________________
> > > CIG-SEISMO mailing list
> > > CIG-SEISMO at geodynamics.org
> > > http://geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo
> > 
> > --
> > Dimitri Komatitsch - dimitri.komatitsch aT univ-pau.fr
> > Professor, University of Pau, Institut universitaire de France,
> > CNRS and INRIA Magique3D, France http://www.univ-pau.fr/~dkomati1
> >
> [ param_reader.c (8.8 Ko) ]

Une messagerie gratuite, garantie à vie et des services en plus, ça vous tente ?
Je crée ma boîte mail www.laposte.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://geodynamics.org/pipermail/cig-seismo/attachments/20101105/e08c7f7a/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-manual.pdf
Type: application/pdf
Size: 2893065 bytes
Desc: not available
Url : http://geodynamics.org/pipermail/cig-seismo/attachments/20101105/e08c7f7a/attachment-0001.pdf 


More information about the CIG-SEISMO mailing list