summaryrefslogtreecommitdiff
path: root/README.dev
blob: 80217459b4cfac21aa1c4245685d26692982c6a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
Notes for the MPFR developers and CVS users
===========================================

To compile source code obtained from CVS, you need some GNU development
utilities: aclocal, autoheader, automake, autoconf 2.50 (at least). As
some files like "configure" are not part of the CVS repository, you
first need to run "autoreconf"; if you have both autoconf 2.13 and 2.50
installed and use a wrapper, you may need to run "autoreconf" a second
time (as with old Debian packages, due to a bug in the wrapper). Then
you can run "configure" in the usual way (see the INSTALL file).

If for some reason, this doesn't work, there's still the old way: run
the "prepare" script to generate these files; as the "prepare" script
also runs "configure", you must give the options that will be passed
to "configure", for instance: ./prepare --with-gmp=/path/to/gmp
Give "--help" if you don't know (./prepare --help). Then, you can
use the configure script as usual. Read the INSTALL file for more
information. If you use GNU tools, you can give "-dev" as the first
option to the "prepare" script to get better dependency tracking.

To generate mpfr.info, you need texinfo version 4.2 (or higher).

===========================================

The VERSION file contains the number of the next release version, i.e.
the version currently developed. If nightly snapshots are built, the
date in the yyyymmdd format must be added to the version number, for
instance: "2.0.1-20020319".

===========================================

When submitting patches, unified diffs (option -u) are recommended,
as they are more readable. You can also use the option -d to generate
a smaller set of changes. See diff(1) for more information.

===========================================

Though the ISO C standard requires that <stdlib.h> defines NULL,
do not use NULL with #include <stdlib.h> only, because this will
not work with the native SunOS 4 C compiler, whose headers are
not conform to the standard (even with C90); other problems may
occur on this architecture. You can either include <stdio.h> or
use 0 (possibly casted to the target pointer type).

===========================================

In the tests, do not use mpfr_set_d (except when testing it), as the
result will depend on the floating-point arithmetic of the system;
this has shown many problems in the past and problems may still occur
with new systems.

===========================================

To make a release (for the MPFR team):
  1) Check the version and update the date in mpfr.texi.
  2) Update the NEWS file.
  3) Update the ChangeLog file (using a recent version of rcs2log,
     directly or with emacs), e.g. rcs2log > ChangeLog.2 and edit
     ChangeLog to insert ChangeLog.2 at the beginning and remove
     the duplicated lines.
  4) Fix the file permissions that have been broken by CVS.
  5) Generate the release version with "make dist".
  6) Test the release version on different machines, with and without
     the --disable-alloca configure option (or compile gmp with
     --enable-alloca=debug), with and without -DXDEBUG in $CFLAGS,
     with and without gmp internal files, with and without gmp built
     as a shared library, with and without srcdir equals to objdir
     (../mpfr/configure --srcdir=/users/spaces/pelissip/mpfr/).
  7) If there is no problem, add a tag to the CVS corresponding to the
     release, e.g. mpfr-2-0-1-rel for mpfr 2.0.1 (note that the periods
     are replaced by dashes): cvs tag mpfr-2-0-1-rel
  8) Update the version with the update-version script to indicate the
     next version.

A branch may be created first (e.g. with "cvs tag -b mpfr-2-0-2-branch")
to allow new features to be committed to the trunk.

===========================================

To check the coverage of the test suite (for the MPFR team),
you can use gcov (with GCC):
1. Clean MPFR:
  make clean
2. Build MPFR with theses options:
  make CFLAGS="-fprofile-arcs -ftest-coverage"
3. Launch the tests:
  make check CFLAGS="-fprofile-arcs -ftest-coverage"
4. Get the results:
  find . -name '*.c' -exec gcov '{}' ';' | grep "lines executed" | sort

 For each source file, there is a .c.gcov file which contains much more
 information.

===========================================================================

List of the used macros for building MPFR:

+ HAVE_STRCASECMP: 	Define if the system supports 'strcasecmp' function.
+ HAVE_STRNCASECMP:	Define if the system supports 'strncasecmp' function.

+ HAVE_CONFIG_H:        Define if we have to include 'config.h' first.
+ MPFR_HAVE_GMP_IMPL:	Define if we have the gmp internal files.
			 ('gmp-impl.h', 'gmp-maparam.h', ...).

+ HAVE_ALLOCA_H:	Define if the function 'alloca' is in alloca.h.
+ HAVE_LONG_LONG:	Define if the system supports 'long long'

+ HAVE_STDARG:		Define if the system supports 'stdarg.h'.
			 Otherwise it is assumed it is 'vararg.h'.
+ HAVE_STDINT_H:	Define if 'intmax_t' is supported (ISO C99).

 Define format of long double.
+ HAVE_LDOUBLE_IEEE_EXT_LITTLE:         IEEE extended, little endian.
+ HAVE_LDOUBLE_IEEE_QUAD_BIG:           IEEE quad, big endian.

+ XDEBUG:		Use generic 'double' code instead of IEEE specific one.
			The IEEE code for double needs GMP internal files.
+ WANT_ASSERT:		Define if we want to turn on the assertions.
+ MPFR_EXP_CHECK:	Define if we want to check the exp field.

+ MPFR_PREC_FORMAT:	Define the internal format of prec field
			 (For experimented users).

+ IEEE_DBL_MANT_DIG:	Number of bits in the mantissa of a double.
			(Default: 53).
+ LDBL_MANT_DIG:	Number of bits in the mantissa of a long double

List of the used macros for checking MPFR:

+ MPFR_HAVE_FESETROUND:	Define if the fesetround function is defined
			 (and in header fenv.h).
+ HAVE_DENORMS:		Define if denormalized floats work.
+ HAVE_SYS_TIME_H:	Define if the header sys/time.h is usuable.
+ HAVE_GETTIMEOFDAY:	Define if the function gettimeofday is present.
+ MPFR_HAVE_TESTS_x86:	Define if we are on x86.

===========================================================================

Don't write:
  mp_limb_t l;
  [...]
  if (l) do_action ();
But:
  mp_limb_t l;
  [...]
  if (l != 0) do_action ();

 since mp_limb_t may be "unsigned long long", and some buggy compiler
produce illegal codes with the first form.

===========================================================================

The GNU Coding standards can be read at:
http://www.gnu.org/prep/standards_toc.html

===========================================================================

Don't use "near" and "far" as variable names since they are "Keywords"
for some C compiler (Old DOS compiler).