Commit Graph

410 Commits

Author SHA1 Message Date
Zoltan Somogyi
05ef8e01fb Rename the .ll_debug grade component to .c_debug.
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.
2022-12-29 20:33:08 +11:00
Julien Fischer
667a00f86d Update the test_mercury script.
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).
2013-04-29 13:40:43 +10:00
Peter Wang
ad4b79e6ee Add a `pregen' grade component.
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.
2013-03-18 15:44:16 +11:00
Julien Fischer
46549d7ac1 Set up for building 12.08 beta releases.
tools/test_mercury:
	Set up for building 12.08 beta releases.
2012-08-12 16:54:10 +00:00
Peter Ross
8d91c1185d Switch to building the 11.07.2 release from the 11.07 beta release.
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.
2012-07-18 08:36:14 +00:00
Julien Fischer
0c7bcbd7d4 Set the correct ftp beta-release for mercury.cis.
tools/test_mercury:
	Set the correct ftp beta-release for mercury.cis.
2012-05-17 12:01:22 +00:00
Julien Fischer
5857a2b2a0 Use carlton as the ROTD host since goliath is dead.
tools/run_all_test_from_cron:
tools/test_mercury:
	Use carlton as the ROTD host since goliath is dead.
2012-05-16 07:07:36 +00:00
Julien Fischer
bb76d6ff9b Build 11.07.2 beta releases.
tools/test_mercury:
	Build 11.07.2 beta releases.
2012-04-25 08:49:28 +00:00
Julien Fischer
a6bf2ec724 Build the 11.07.1 release.
tools/test_mercury:
	Build the 11.07.1 release.
2012-02-29 01:30:45 +00:00
Julien Fischer
e107089ff0 Build 11.07.1-beta release.
Branches: main

tools/test_mercury:
	Build 11.07.1-beta release.
2012-01-10 14:35:51 +00:00
Julien Fischer
95e3fda14e Build the 11.07 release.
tools/test_mercury:
	Build the 11.07 release.
2011-12-20 15:55:52 +00:00
Julien Fischer
ca20691594 Fix a type: s/alcocal/aclocal/
tools/test_mercury:
	Fix a type: s/alcocal/aclocal/
2011-11-14 07:15:04 +00:00
Julien Fischer
5002730707 Fix 11.07 source distribution builds.
Branches: main

Fix 11.07 source distribution builds.

tools/test_mercury:
	Only invoke aclocal on the main branch when building
	the source distribution.
2011-11-13 11:42:37 +00:00
Julien Fischer
aa573a2e0d Fix building of the 11.07 branch.
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.)
2011-11-10 14:25:56 +00:00
Paul Bone
bc92fb14b1 Fix three hwloc related build system problems, these were raised in code
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.
2011-11-08 02:22:42 +00:00
Paul Bone
a071eaba53 Improve thread pinning:
+ 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.
2011-10-13 02:42:21 +00:00
Julien Fischer
f673606604 Build 11.07-beta releases.
tools/test_mercury:
tools/generate_index_html:
	Build 11.07-beta releases.
2011-06-27 17:38:01 +00:00
Paul Bone
c95303653a Install a threadscope grade on tuara.
tools/test_mercury:
    As above.
2011-06-16 07:07:30 +00:00
Julien Fischer
a3b5f097cd Fix an old problem: the 64-bit build on eris are being installed where
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.
2011-06-03 07:00:01 +00:00
Julien Fischer
e370719a9f Set up nightly builds on apollo.
Branches: main

tools/test_mercury:
	Set up nightly builds on apollo.
2011-05-18 16:28:21 +00:00
Julien Fischer
0feba1cd32 Enable builds for 11.01.1-beta.
tools/test_mercury:
	Enable builds for 11.01.1-beta.
2011-05-01 14:05:18 +00:00
Julien Fischer
0868df5006 Update for the 11.01 release.
tools/test_mercury:
	Update for the 11.01 release.

	Delete stuff related to the 10.04 release.
2011-04-26 06:54:09 +00:00
Paul Bone
61d30aef35 Build an asm_fast.gc.stseg grade on taura.
tools/test_mercury:
    As above.
2011-04-13 22:25:51 +00:00
Zoltan Somogyi
2d1ac55c9b Install some grades I need on taura, and don't install some we don't need,
Estimated hours taken: 0.1
Branches: main

Install some grades I need on taura, and don't install some we don't need,
at least not right now.
2011-04-13 07:57:54 +00:00
Julien Fischer
b83b057e91 Make goliath the ROTD host since saturn keeps dying.
tools/test_mercury:
	Make goliath the ROTD host since saturn keeps dying.
2011-02-07 04:17:12 +00:00
Julien Fischer
a9ff8449a4 Build and install the C# grade as part of the nightly tests on eris.
tools/test_mercury:
	Build and install the C# grade as part of the nightly tests on eris.
2011-01-18 11:36:59 +00:00
Julien Fischer
4e10555771 Fix a cut-and-paste error.
Branches: main

tools/test_mercury:
	Fix a cut-and-paste error.
2010-12-17 05:24:43 +00:00
Julien Fischer
7014da976b Prepare for 11.01 beta builds.
Branches: main

tools/test_mercury:
	Prepare for 11.01 beta builds.
2010-12-17 05:18:57 +00:00
Julien Fischer
30edda86bd Build beta releases for 10.04.3.
tools/test_mercury:
	Build beta releases for 10.04.3.
2010-10-09 12:57:46 +00:00
Julien Fischer
c81ecaa30f Build the 10.04.2 release.
tools/test_mercury:
	Build the 10.04.2 release.
2010-10-04 04:15:26 +00:00
Julien Fischer
67bffd249a Revert my last change - it causes trouble for G12 users on
tools/test_mercury:
	Revert my last change - it causes trouble for G12 users on
	that host.
2010-09-17 05:48:26 +00:00
Julien Fischer
854dd475d0 Use the default GCC on goliath, 4.3, rather than 4.1.
tools/test_mercury:
	Use the default GCC on goliath, 4.3, rather than 4.1.
2010-09-17 02:27:57 +00:00
Julien Fischer
9b8f60d1b4 Build 10.04.2 beta releases.
tools/test_mercury:
	Build 10.04.2 beta releases.
2010-09-10 07:36:50 +00:00
Julien Fischer
5580002eb6 Prepare the the 10.04.1 release.
Branches: main, 10.04

Prepare the the 10.04.1 release.

NEWS:
	Add an entry for 10.04.1

tools/test_mercury:
	Build 10.04.1.
2010-08-27 04:44:02 +00:00
Julien Fischer
97e0431e4a Build beta versions of Mercury 10.04.1
tools/test_mercury:
	Build 10.04.1 beta releases.

	Add some commented out stuff for the 10.04.1 release itself.
2010-07-19 08:25:24 +00:00
Julien Fischer
69f6bf3ce7 Correct typos in my last change.
tools/test_mercury:
	Correct typos in my last change.
2010-07-18 08:23:27 +00:00
Julien Fischer
fedfc5c248 Final preparations for the 10.04 release.
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.
2010-07-18 08:13:53 +00:00
Julien Fischer
2ab3cba758 Disable --smart-indexing when generating the C files for the source
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.
2010-06-29 08:38:26 +00:00
Paul Bone
8d6c1b4c79 Do not build Mercury using gcc-3.4 on some of our systems. At present the
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.
2010-06-28 05:52:19 +00:00
Julien Fischer
bb56fe25f2 Build 10.04 beta tarballs on saturn every other day.
tools/run_all_tests_from_cron:
tools/test_mercury:
	Build 10.04 beta tarballs on saturn every other day.

	Strip out some stuff related to aral.
2010-03-18 07:26:40 +00:00
Julien Fischer
f179a406be Correct the version details for the 10.04 betas.
tools/test_mercury:
	Correct the version details for the 10.04 betas.
2010-03-16 16:30:32 +00:00
Julien Fischer
284b5ddcc3 Update the build scripts for building the 10.04 betas.
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.
2010-03-06 14:20:26 +00:00
Julien Fischer
6ed0d0cbed Build and test the .par grades on eris. (They were disabled because of bug
#121, but that has been resovled by the GC upgrade.)

tools/test_mercury:
	As above.
2010-03-01 06:34:07 +00:00
Peter Ross
01a2a3cf52 Add the option to build a beta version of the upcoming release 10.04.
Estimated hours taken: 0.25
Branches: main

tools/test_mercury:
	Add the option to build a beta version of the upcoming release 10.04.
2010-02-03 05:24:04 +00:00
Julien Fischer
3b9b1f7e7a Fix a problem with the source distribution.
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.
2010-01-14 00:44:13 +00:00
Julien Fischer
a7999621fa Fix nightly builds on taura.
tools/test_mercury:
	Don't define MR_PROFILE_PARALLEL_EXECUTION_SUPPORT on the command
	line since it is now implied by the threadscope grades.
2010-01-12 20:46:17 +00:00
Julien Fischer
83c831df48 Use gcc 3.4 on saturn again - we are triggering internal
tools/test_mercury:
	Use gcc 3.4 on saturn again - we are triggering internal
	errors in gcc 4.2.
2009-12-29 19:39:34 +00:00
Julien Fischer
6788badce3 Don't run the depend target in parallel. It is intermittently
tools/test_mercury:
	Don't run the depend target in parallel.  It is intermittently
	fails with >2 jobs.
2009-12-28 22:31:34 +00:00
Julien Fischer
7716692311 Improve test coverage for the nightly tests by testing a wider range of grades
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.
2009-12-28 20:31:37 +00:00
Julien Fischer
f3db7b3e9f Make saturn the ROTD host since aral is not working
tools/test_mercury:
	Make saturn the ROTD host since aral is not working
	at the moment.
2009-12-17 20:03:32 +00:00