Rename mmc and mgnuc options that set this grade component to --c-debug-grade.
Let the options named --c-debug of both mmc and mgnuc enable C level debugging
of only the module being compiled.
runtime/mercury_grade.h:
Rename the .ll_debug grade component to .c_debug. Also rename the C macro
that controls the presence or absence of this grade component
from MR_LL_DEBUG to MR_C_DEBUG_GRADE.
runtime/mercury_conf_param.h:
runtime/mercury_debug.c:
runtime/mercury_debug.h:
runtime/mercury_engine.c:
runtime/mercury_label.c:
runtime/mercury_memory_zones.c:
runtime/mercury_memory_zones.h:
runtime/mercury_overflow.c:
runtime/mercury_std.h:
runtime/mercury_wrapper.c:
Rename the MR_LOWLEVEL_DEBUG macro to MR_DEBUG_THE_RUNTIME.
Previously, the name of this macro wrongly implied that it had
something to do with the old .ll_debug grade component, even though
- the MR_LOWLEVEL_DEBUG macro was designed to debug LLDS grades,
since only these existed when it was created, while
- the .ll_debug grade component (now .c_debug) is useful only for
MLDS grades targeting C.
compiler/options.m:
Rename the old confusingly named low_level_debug option to c_debug_grade.
Move it to the list of grade options, and fix its documentation, which
was completely wrong:
- code in compile_target_code.m treated it as being a synonym of
the .ll_debug (now .c_debug) grade component, while
- its (commented out) documentation here in options.m said it called for
the enabling of what is now MR_DEBUG_THE_RUNTIME.
compiler/compile_target_code.m:
Conform to the rename just above.
Define MR_C_DEBUG_GRADE instead of MR_LL_DEBUG if c_debug_grade is enabled.
Pass -g to the C compiler if either c_debug_grade or target_debug
is enabled.
Add an XXX about a missing safety check for an obsolete experimental
feature.
compiler/compute_grade.m:
When given a grade with a .c_debug grade component, set only the
c_debug_grade option; don't set the target_debug option, which is NOT
a grade option. The change to compile_target_code.m above handles the
only situation in which this implication was formerly required.
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
Look for and process the .c_debug grade component instead of .ll_debug.
Use a sh variable named c_debug_grade to record its absence/presence.
Look for and process the --c-debug-grade grade-component option,
setting the same sh variable, c_debug_grade. (All grade components
can be set piecemeal using sh options to the scripts using these
subroutines.) This replaces the old, confusingly named option
--low-level-debug.
scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
Consistently use the sh variable c_debug to record the presence of
the (non-grade) --c-debug option to mgnuc, and the sh variable
c_debug_grade to record the presence of the .c_debug grade component.
Stop looking for and handling the --low-level-debug option, which
mgnuc used to document, even though this duplicated the same documentation
in init_grade_options.sh-subr, which mgnuc includes. The difference was
that init_grade_options.sh-subr meant it to represent the old .ll_debug
MLDS grade component, while mgnuc treated it as specifying what is now
MR_DEBUG_THE_RUNTIME for LLDS grades. It didn't help that two sh variables
with quite different semantics had names that differed only in an
underscore: LLDEBUG_OPTS vs LL_DEBUG_OPTS.
scripts/Mmakefile:
Add a missing dependency to force the rebuild of mgnuc after each update
of its sh subroutine mgnuc_file_ops.sh-subr.
doc/user_guide.texi:
Document the --c-debug-grade option of mmc. This option was not publicly
documented under its original misleading name (--low-level-debug), but
its documentation is now possible without contorted dancing around the
name.
Clarify the documentation of mgnuc's --c-debug option.
README.sanitizers:
configure.ac:
Conform to the rename of the grade component.
grade_lib/grade_spec.m:
grade_lib/grade_string.m:
grade_lib/grade_structure.m:
grade_lib/try_all_grade_structs.m:
Conform to the rename of the grade component .ll_debug to .c_debug.
Don't allow the .c_debug grade component in LLDS grades.
In grade_string.m, add some obvious implications of some grade components.
grade_lib/choose_grade.m:
grade_lib/grade_lib.m:
grade_lib/test_grades.m:
grade_lib/var_value_names.m:
Fix white space.
scripts/ml.in:
tools/lmc.in:
tools/test_mercury:
Conform to the change in compile_target_code.m to the naming of
Boehm gc library variants.
tools/test_mercury:
Build the source distribution in the hlc.gc.pregen grade.
Force the LLDS base grade for the source distribution to be none
rather than asm_fast. The latter was causing problems when
generating the C files on Mac OS X (or anything else on which
asm_fast doesn't work).
Add a `pregen' grade component and associated option `--pregenerated-dist',
intended for use in the pre-generated C files in the source distribution
ONLY.
Traditionally, by forcing the use of 2 tag bits and boxed floats, we
could provide one set of pre-generated C files, nominally targeting
32-bit platforms but also working on 64-bit platforms.
This became insufficient after I made two data representation changes.
The same constructor may have different layouts of its arguments
for --bits-per-word=32 and --bits-per-word=64:
- double-precision `float' arguments can be stored across two
words on 32-bit, whereas only one word is required on 64-bit;
- consecutive enum arguments can be packed into a single word
but the number of arguments that can be packed differs.
As a result, data structures created in a user module could be
misinterpreted when passed to a pre-generated standard library module,
and vice versa. (The enum case probably does not occur in practice.)
The solution adopted here is to allow configure to detect normal 64-bit
settings (3 tag bits, unboxed floats) irrespective of whether a usable
Mercury installation already exists. When present, the `pregen' grade
component causes the compiler and scripts to override the configuration
and enforce settings for portable C source files. The source
distribution should supply C source files from a `pregen' grade.
During installation, if required, the pre-generated C source files are
used to build and install a Mercury compiler _in a .pregen grade_.
Then it is used to install the libraries _in non-.pregen grades_,
so that configured settings have their usual effect.
Another benefit is that a user on a 64-bit system will get the "optimal"
installation using 3 tag bits and unboxed floats without additional
effort.
A small disadvantage is that a minimal installation of Mercury takes
slightly longer, as the default library grade no longer comes from the
pre-generated C source files.
compiler/options.m:
Add `--pregenerated-dist' option (same as `pregen' grade component).
Add `--arg-pack-bits <n>' internal option.
`--allow-argument-packing' is obsolete.
Add `--allow-double-word-fields' internal option.
compiler/handle_options.m:
Add `pregen' grade component. `pregen' implies boxed floats and
`spf' (single-prec float) implies unboxed floats, so we consider
them incompatible. There should be no need to use both at once.
In `pregen' grades, override settings to create portable C
source files.
Handle the internal `--arg-pack-bits <n>' option.
compiler/make_hlds_passes.m:
Pack only as many consecutive arguments as will fit into the
number of bits specified by `--arg-pack-bits', rather than into
the number of word bits. `pregen' implies --arg-pack-bits=32
Use `--allow-double-word-fields' to decide whether to store
floats across two words. `pregen' disables it.
compiler/compile_target_code.m:
Define MR_PREGENERATED_DIST when compiling C files in a `pregen'
grade.
compiler/c_util.m:
Write PREGENERATED_DIST={yes,no} into the grade info header at
the top of C files. This is checked by configure.
runtime/mercury_conf_param.h:
Make MR_PREGENERATED_DIST force the same settings as the
`--pregenerated-dist' option.
runtime/mercury_grade.h:
Add "_pregen" to the MR_GRADE macro so that `pregen' and
non-`pregen' object files are not accidentally mixed.
configure.ac:
As above, do NOT force 2 tag bits and unboxed floats when there
is no usable Mercury compiler installed.
BOOTSTRAP_GRADE is now a grade containing `.pregen'.
Make a minimal installation install $BEST_GRADE_FOR_COMPILER as
the default grade, not the grade that the compiler happens to be
built in, which might be a `pregen' grade.
scripts/canonical_grade.sh-subr:
scripts/init_grade_options.sh-subr:
scripts/mgnuc.in:
scripts/parse_grade_options.sh-subr:
Support `pregen' grade component and `--pregenerated-dist'
in shell scripts.
tools/test_mercury:
Add a note.
Estimated hours taken: 1
Branches: main
tools/test_mercury:
Switch to building the 11.07.2 release from the 11.07 beta release.
Rename the 11.07 beta build to 11.07.3.
Branches: main
Fix building of the 11.07 branch.
tools/test_mercury:
Handle the fact that the 11.07 version of the compiler shouldn't
have to run aclocal -I m4 before running autoconf.
(NOTE: the version of this script on the trunk is used to build
both branches; it has to remain compatible with both.)
reviews.
The configure script now supports the --without-hwloc option to disable the use
of hwloc, even if it is installed.
configure.in:
Allow the use of libhwloc to be disabled with the --without-hwloc option.
Distribute the autoconf macros for pkg-config with Mercury.
This allows mercury to be compiled from CVS on hosts that don't have these
macros in their autoconf installation.
acinclude.m4:
m4/mercury.m4:
Moved acinclude.m4 to m4/mercury.m4. This file contains mercury-specific
macros.
m4/pkg.m4:
Copied pkg.m4 from the autoconf installation on taura. This file contains
pkg-config macros.
INSTALL_CVS:
Mmakefile:
tools/test_mercury:
When calling aclocal pass the -I m4 option.
tools/bootcheck:
Create a link to the m4 directory when setting up stage directories.
Fix static linking with mmc --make and hwloc.
compiler/compile_target_code.m:
Conform to changes in scripts/ml.in (where static linking and hwloc is
already handled correctly).
compiler/options.m:
Create new options so that Mercury.config can tell mmc what options are
needed for linking to hwloc.
scripts/Mercury.config:
Pass hwloc linking options to the compiler.
+ Now pins threads intelligently on SMT systems by balancing threads among
cores.
+ performs fewer migrations when pinning threads (If a thread's current
CPU is a valid CPU for pinning, then it is not migrated).
+ Handle cases where the user requests more threads than available CPUs.
+ Handle cases where the process is restricted to a subset of CPUs by its
environment. (for instance, Linux cpuset(7))
This is largely made possible by the hwloc library
http://www.open-mpi.org/projects/hwloc/ However, hwloc is not required and the
runtime system will fall back to sched_setaffinity(), it will simply be less
intelligent WRT SMT.
runtime/mercury_context.h:
runtime/mercury_context.c:
Do thread pinning either via hwloc or sched_setaffinity. Previously only
sched_setaffinity was used.
Update thread-pinning algorithm, this:
Include the general thread pinning code only if MR_HAVE_THREAD_PINNING is
defined.
Use a combination of sysconf and sched_getaffinity to detect the number of
processors when hwloc isn't available. This makes the runtime compatible
with Linux cpuset(7) when hwloc isn't available.
configure.in:
Mmake.common.in:
Detect presence of the hwloc library.
configure.in:
Detect sched_getaffinity()
aclocal.m4:
acinclude.m4:
Move aclocal.m4 to acinclude.m4, the aclocal program will build aclocal.m4
and retrieve macros from the system and the contents of acinclude.m4.
Mmakefile:
Create a make target for aclocal.m4.
runtime/Mmakefile:
Link the runtime with libhwloc in low-level C parallel grades.
Include CFLAGS for libhwloc.
scripts/ml.in:
Link programs and libraries with libhwloc in low-level C parallel grades.
runtime/mercury_conf.h.in:
Define MR_HAVE_HWLOC when it is available.
Define MR_HAVE_SCHED_GETAFFINITY when it is available.
runtime/mercury_conf_param.h:
Define MR_HAVE_THREAD_PINNING if either hwloc or [sched_setaffinity and
sched_getaffinity] are available.
runtime/mercury_thread.c:
runtime/mercury_wrapper.c:
Only call MR_pin_thread and MR_pin_primordial_thread if
MR_HAVE_THREAD_PINNING is defined.
runtime/mercury_thread.h:
runtime/mercury_context.h:
Move the declaration of MR_pin_primordial_thread to mercury_context.h from
mercury_thead.h since it's definition is in mercury_context.c.
Require MR_HAVE_THREAD_PINNING for the declaration of
MR_pin_primordial_thread.
runtime/mercury_wrapper.c:
Conform to changes in mercury_context.h
INSTALL_CVS:
tools/test_mercury
Run aclocal at the right times while testing Mercury.
tools/test_mercury:
Fix an old problem: the 64-bit build on eris are being installed where
you would typically expect the 32-bit builds to go -- this dates back
to the time where we didn't have support for 64-bit Darwin.
Install asm_fast.gc.trseg instead of asm_fast.gc.tr on goofy.
Branches: main, 10.04
Final preparations for the 10.04 release.
NEWS:
10.04 is no longer beta.
tools/test_mercury:
Switch over to using the release tag.
util/.cvsignore:
Ignore mfiltercc.
distribution. We appear to be generating non-portable code for some types of
switches that causes the compiler (actually the lexer) to seg. fault, when it
is built from the source distribution C files on a 64-bit machine. (Bug #115)
A proper fix would be to disable the generation of non-portable code for
switches when --cross-compiling is enabled.
tools/test_mercury:
Make the above change.
Mercury installations on taura, saturn and bob are configured to use gcc-3.4.
taura:
taura's version of Ubuntu doesn't supply gcc-3.4, we where using a
back-ported package which is now unnecessary. When using gcc-3.4 taura
would compile in handwritten atomic instructions since gcc-3.4 doesn't
support the correct intrinsics. We now define MR_AVOID_COMPILER_INTRINSICS
to ensure that the handwritten instructions are still exercised.
Also enable --profile-for-implicit-parallelism for the test suite.
bob:
bob's --with-cc line was spelt incorrectly, and probably wasn't having an
effect. Using my best judgment I removed this option.
saturn:
saturn's configuration includes a comment saying that the use of gcc-3.4
avoids a bug. This has been updated to gcc-4.3 as suggested by Julien.
tools/test_mercury:
As above.
tools/run_all_tests_from_cron:
10.04 is now the release branch.
tools/test_mercury:
Prepare for building the 10.04 branch.
Delete stuff related to the 0.13 branch.
tools/test_mercury:
Don't include the .enable_lib_grades file in the soure distribution.
test_mercury uses this mechanism to select the grade set where it differs
from the default set; the problem hasn't shown up before because previously
the rotd host has always used the default set.
and GCC versions.
tools/test_mercury:
Use gcc 4.1 and 4.2 more. (3.4 is now only used on taura).
XXX some the hosts should be using 4.3 and 4.4, but 4.3 at
least causes problems with hlc.gc that need to be looked into
first.
Test asm_jump, stseg, mm, mmos, hl, hl_nest, rbmm and nogc grades.
(We weren't testing them because the machines that used to do so had died.)
Test the java grade on eris.
Install more grades on eris as well.
Test parallel trailing grades.