195 Commits

Author SHA1 Message Date
Zoltan Somogyi
05b7214151 Fix indentation. 2025-08-09 10:14:25 +02:00
Julien Fischer
1b73644571 Fix source distribution builds.
Mmakefile:
docs/Mmakefile:
    When building the source distribution, generate ug_invocation.texi
    using the bootstrap Mercury compiler since the building the source
    distribution does not create a mercury_compile executable.
2025-07-21 00:21:15 +10:00
Zoltan Somogyi
89b3e1dca3 Add "ft=make" to the modelines of Mmakefiles.
Add some missing .PHONY markers, and delete a stray .PHONY marker.

Add some missing copyright years.
2025-05-05 07:58:50 +10:00
Zoltan Somogyi
692d9d8129 Replace [ with test. 2024-02-29 06:48:35 +11:00
Julien Fischer
761f37bd15 Update top-level Mmakefile.
Mmakefile:
    Conform to a recent change: s/cs/all_cs/
2023-10-05 23:04:53 +11:00
Peter Wang
fe50f0c696 Delete touch_files target.
Mmakefile:
    Delete touch_files target. It's probably obsolete.
2023-01-31 15:51:36 +11:00
Julien Fischer
3362159147 Fix Mantis bug #558.
Mmakefile:
    Ensure that the mercury_{compile,profile} executables exist
    *before* attempting to build the manual pages.

doc/Mmakefile:
    Rebuild the mprof.1 manual page if the profiler options.m
    file changes.
2022-04-21 19:34:00 +10:00
Peter Wang
1c0a0531ad Ensure make does not try to run cross-compiled binaries.
When cross-compiling, `make' must not find cross-compiled binaries in
the workspace and try to execute them. For example, the problem arises
when cross-compiling for Linux/aarch64 from Linux/x86-64. `make' would
find e.g. util/mkinit (for an incompatible platform) and try to run it.

The problem did not arise in the special (but common) case of
cross-compiling for Windows on a Linux host: the Windows binaries would
be given a .exe extension, and `make' on Linux would not try to run
<foo>.exe anyway.

Mmakefile:
    Exclude util and mfilterjavac from the PATH when cross-compiling.
2021-10-28 14:46:17 +11:00
Peter Wang
524f4d72e2 Delete references to Erlang backend in makefiles.
Mmake.workspace:
Mmakefile:
*/Mmakefile:
tests/*/Mmakefile:
tests/valid/Mmake.valid.common:
trace/Mmakefile:
    As above.
2020-10-27 11:10:11 +11:00
Julien Fischer
11b971fd8d Exclude git related files from srcdist.
Mmakefile:
    As above.
2020-10-11 23:54:05 +11:00
Zoltan Somogyi
39377c939e Commit to the new build_srcdist.
tools/build_srcdist:
    Delete the old build_srcdist, and rename build_srcdist2 as build_srcdist.
    Make it refer to the tar target designed for it, tar2, under its new name
    tar.

Mmakefile:
    Delete the old tar target (which worked with the old build_srcdist),
    and rename the old tar2 target (which works with the new build_srcdist)
    as just plain tar.
2020-10-11 22:22:55 +11:00
Julien Fischer
4003c41345 Update tar targets.
Mmakefile:
    Delete references to deleted targets.
2020-10-09 23:59:28 +11:00
Zoltan Somogyi
be3f9443b1 Simplify the setup of mdbrc for tests.
We used to set up *two* mdbrc files for use by test cases:
scripts/test_mdbrc, and tests/mdbrc. Tools/bootcheck said
the tests should use the former, while tests/Mmake.common
said they should use the latter. This diff deletes the latter,
and uniformly uses the former.

The setup code was also scattered, with parts being done by
the configure script, and part being done by tools/bootcheck.
Move it all to scripts/Mmakefile, since that is the natural
place to put code to build scripts/test_mdbrc.

Mmakefile:
    Fix the action for cleaning up the tests directory.
    This started out as the reason for this whole change.
    As it happens, a *working* action for cleaning up the tests
    broke things, because it deleted an autoconfigured file
    (tests/mdbrc) that there was no rule for rebuilding.
    This issue is what required the rest of this diff.

    When doing "mmake clean/realclean", clean the extras as well.

configure.ac:
    Delete the code creating tests/mdbrc.in.

scripts/Mmakefile:
    Add a rule to build test_mdbrc, as mentioned above.

tests/Mmake.common:
    Switch to using scripts/test_mdbrc in test cases
    run under mdb.

    Mark the rules that clean up mdbrc and mdbrc.in
    as obsolete, since we will now stop creating those files.

tools/bootcheck:
    Delete the code that used to build tests/mdbrc. Instead,
    rebuild scripts/test_mdbrc (in case the workspace was moved),
    and use that.

tests/Mmakefile:
    When cleaning the tests directory, clean its subdirectories
    (since the top level directory does not have much clean).
2020-10-04 23:00:29 +11:00
Zoltan Somogyi
2cf8818d0e Make source distribution building less error-prone.
tools/build_srcdist2:
    A new version of the existing build_srcdist script that does *not*
    destroy the workspace it is invoked in by deleting from it
    the files we don't want to put into the source distribution's tar file.
    Instead, it makes a copy of a named workspace, deletes the unwanted
    files only from that copy, and puts the generated tar file where its
    caller wants it to go.

    Unlike the old build_srcdist, build_srcdist2 leaves deciding on the
    version name, and compressing the tar file, to its invoker. This is
    because the invoker has to know the tar file name, and hence the
    version name anyway, and it is simpler to test whether xz compression
    is available in the invoker only, rather than in both build_srcdist2
    and the invoker (since the invoker can't e.g. move a .xz file
    that does not exist).

Mmakefile:
    Add a new variant of the "make tar" target that conforms to
    the expectations of the new build_srcdist2 script.
2020-09-20 22:53:42 +10:00
Zoltan Somogyi
0beac98b61 Minor documentation improvements.
compiler/notes/c_coding_standard.html:
    Describe module header comments just once, not twice.
    Expand on what may be in such comments.

    Fix some oversights. For example, until now we didn't say that
    a developer needs git (!), and we didn't say where the definitions,
    as opposed to declarations, of any global variables exported from
    a module should go.)

    Improve the wording of several explanations.

    Make some lists of things into item lists.

    Expand tabs.

compiler/notes/glossary.html:
    Describe what HLDS, LLDS and MLDS mean in more detail.

compiler/notes/overall_design.html:
    Delete the reference to the long-deleted analysis directory.

compiler/notes/allocation.html:
compiler/notes/reviews.html:
compiler/notes/upgrade_boehm_gc.html:
    Fix indentation.
2020-09-19 04:48:00 +10:00
Julien Fischer
cf3ca0be07 Fix parallel builds.
Mmakefile:
    Fix dependencies for the grade_lib target.
2020-04-18 14:48:55 +10:00
Zoltan Somogyi
effb5f20c7 Fix the dep_grade_lib target. 2020-04-15 18:20:09 +10:00
Julien Fischer
2deb13aa63 Delete the unused libmmc target.
Makefile:
Mmakefile:
    Delete the libmmc target; we haven't supported building the compiler as
    a library for a number of years.
2020-04-14 21:26:30 +10:00
Julien Fischer
6dda7fb78f Fix compilation of the source distribution.
We need to include the grade_lib directory in the source distribution since
various things, e.g the configure script, refer to it.  Adding it doesn't
really affect anything since it is quite small anyway.

Mmakefile:
    Include the grade_lib directory in the source distribution.

    Make the top-level dep_grade_lib target depend on the .dep files
    in the grade_lib dir; not doing this means that we will attempt
    to build a Mercury.modules file when building the source distribution
    and that won't work in the absence of an installed Mercury compiler.
2020-04-14 19:08:49 +10:00
Zoltan Somogyi
0c40f3b5f0 Build the grade_lib directory by default.
This should prevent bit rot in its code, such as that caused by the
move of the one_or_more type from list.m to one_or_more.m.

Mmakefile:
    Add grade_lib to the list of directories to build, to the list of
    directories in which dependencies are made, the list of directories
    in which tags files are made, and the list of directories to clean.

    Do not include the grade library in source distributions. In the
    intended use case, the grade library modules that the compiler needs
    will be present in the source distribution in the *compiler* directory.

    Add mfilterjavac to the list of directories for tags files; its former
    absence was an oversight.

    Fix inconsistent indentation.

tools/bootcheck:
    Build the grade library during stages 2 and 3. Compare its stage 2 and 3
    versions as we do for other directories.

    Put the commands that create stages 2 and 3 into recognizable blocks.

grade_lib/Mmakefile:
    Add the targets needed by either by bootcheck or by the top level
    Mmakefile.

    Document the intended usage of the grade library.

grade_lib/.mgnuc_copts:
grade_lib/.mgnuc_opts:
    Use the same .mgnu_*opts files as e.g. the profiler directory.
    The common command sequence used by bootcheck to build the
    stage 2 and 3 directories assumes their presence.

library/Mmakefile:
    Make it clear that some rules previously separated by dividing lines
    are actually related.
2020-04-14 09:35:55 +10:00
Julien Fischer
aefabaf67a Optionally build srcdist .tar.xz files.
Mmakefile:
    As above.
2019-01-24 04:21:03 +00:00
Paul Bone
4ee7e744b7 Don't pack scripts/config.log in source tarballs
Mmakefile:
    Delete this file before making the source tarball.

scripts/Mmakefile:
    Delete this file in make realclean
2018-11-18 16:20:56 +11:00
Zoltan Somogyi
3e4b7e11ad Make tags in trace as well as in other directories. 2018-02-17 07:00:59 +11:00
Zoltan Somogyi
310048037c Try to guard against future bitrot.
tools/bootcheck:
    Build the dependencies for auxiliary programs, and the programs themselves,
    in the browser and profiler directories.

Mmakefile:
    Provide targets for bootcheck to use to make dependencies for the
    auxiliary programs in the browser and profiler directories.

browser/Mmakefile:
    Take the two aux programs in this directory out of the "all" target.
    Due to past bitrot, one gets errors during compilation, the other
    during linking. (The "all" target is not used by default, which is why
    this has not been a problem.)

    Add depend_aux and aux targets that should build these programs
    if they are ever fixed. The aux target is empty for now; the depend_aux
    target does make dependencies for both aux programs (since that still
    works, and we want to keep it that way).

profiler/Mmakefile:
    Add depend_aux and aux targets that build the one auxiliary program
    in this directory that works now. Add a comment about the other program
    that doesn't.
2018-01-09 01:05:42 +11:00
Zoltan Somogyi
81eec9f92f Improve the robustness of the INSTALL scripts.
.INSTALL.in:
INSTALL.git:
    Generate an error if the name of the current directory contains spaces.

.INSTALL.in:
    Also generate an error if the current directory lacks a boehm_gc subdir,
    indicating that it is not the result of unpacking a source distribution.

Mmakefile:
    Make INSTALL executable after it is created from .INSTALL.in.
    (INSTALL.git is already executable.)
2017-04-21 17:12:34 +10:00
Paul Bone
377eb0d876 Don't include .gitignore files in source distribution tarballs
Mmakefile:
    As above.
2017-04-04 12:10:32 +10:00
Paul Bone
94c11a5a63 Fix the clean and realclean mmake targets
Mmakefile:
    Use the SUBDIR_MMAKE command for cleaning in the tests directory

    Clean the scripts directory after all the others, regardless of
    dependency order or parallel builds.
2017-03-28 16:44:57 +11:00
Julien Fischer
8e732885ff Rename the top-level of the compiler.
Currently, the compiler's top-level module is the module 'top_level'.  This
means that the executable (or Java archive, or assembly) we generate is named
after that.  However, the rest of the system requires that the compiler
executable be named 'mercury_compile', so we currently rename it after it is
generated.  (At least, we do in C grades, in non-C grades the compiler
"executable" currently has the "wrong" name.)  Making this scheme work across
multiple backends and platforms leads to quite a bit of complication in the
build system.  This change simplifies matters by repurposing the
'mercury_compile' module to be the new top-level module; this means that the
executable is generated with the correct name to begin with.

compiler/mercury_compile.m:
     Shift the existing contents of this module to  new module,
     mercury_compile_main.

     Shift this module out of the top_level package and export main/2 from it.

compiler/mercury_compile_main.m:
     New module that contains the old contents of mercury_compile.m.

compiler/top_level.m:
     Conform to the above changes.

     Delete the definition of main/2 from this module.

compiler/make.m:
compiler/make.module_target.m:
     Conform to the above changes.

compiler/Mmakefile:
     Conform to the change in the name of the top-level module.

    Delete the rule for renaming the compiler executable.

Mmakefile:
    Update the dep_compiler target.

compiler/notes/compiler_design.html:
    Update this document.

scripts/mercury_compile.sh-csharp:
scripts/mercury_compile.sh-java:
    Update these scripts.

compiler/.gitignore:
    Conform to the above changes and generally update
    this file.

configure.ac:
tools/binary_step:
tools/bootcheck:
    Update the top-level module.
2016-02-17 20:13:33 +11:00
Julien Fischer
92c9a1fe4b Fix github issue #34: make uninstall leaves files behind.
Don't accidently strip the ".exe" extension from the deep profiler executables
on Windows when installing them.  (Deep profiling doesn't really work on
Windows, which is why this hasn't been noticed until now.)

compiler/Mmakefile:
mfilterjavac/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
     Add an uninstall target in these directories.

     Delete a stray reference to the IL backend.

deep_profiler/Mmakefile:
     Fix the issue mentioned above w.r.t the ".exe" extension.

     We install mdprof_cgi in (potentially) two locations, make
     sure we (attempt to) uninstall them both.

     Update the uninstall target to handle the other executables in
     this directory.

doc/Mmakefile:
     Make the uninstall target remove the manual pages.

Mmakefile:
     Invoke uninstall targets in directories where we previously didn't.
2016-01-28 22:06:13 +11:00
Julien Fischer
46d9973100 Install the Bohem GC headers with non-C grade compilers.
Ensure that the header files for the Boehm GC are installed when the compiler
is built in a non-C grade.  They need to be installed in case installation
includes a (.gc) C grade.

Mmakefile:
    Make the install_boehm target install the GC headers in non-C grades.

    Fix a typo.
2016-01-08 21:05:32 +11:00
Julien Fischer
682e4aedfe Make it possible to use a different tar command.
Mmakefile:
    Make it possible to specify a different tar command on the
    command line.  The tar supplied with OS X on my machine doesn't
    handle symlinks in the same way as GNU tar, so I need to use
    the latter (which is called gnutar).
2015-10-21 13:45:13 +11:00
Paul Bone
353522a296 Dereference symlinks in the "tar" Mmakefile target
Sebastian Godelet reported that symlinks are appearing in the tarballs,
which can cause problems for some platforms.  This change causes the "mmake
tar" target to dereference any symlinks, including their linked-to files
instead.

Mmakefile:
    As above.
2015-10-20 12:10:15 +11:00
Paul Bone
bca1db24d1 Use nested submodules to include boehm_gc/libatomic_ops
Feedback of the upgrade of Boehm GC indicated that including the
libatomic_ops submodule in the top-level was inconvenient, and I agree.
This change, along with a corresponding change to the boehm_gc repository,
will instead included it as a nested submodule of boehm_gc.

.gitmodules:
libatomic_ops:
    Remove libatomic_ops submodule.

boehm_gc
    Update to the most recent revision that adds a libatomic_ops submodule.

prepare.sh:
    Update submodules recursively.

Mmakefile:
scripts/prepare_install_dir.in:
tools/bootcheck:
    Remove code in build tools that links or copies the libatomic_ops
    directory from Mercury's top-level,
2015-10-19 16:31:10 +11:00
Paul Bone
2a0d3a5eff Fix the source distribution
tools/build_srcdist:
    De-initialise the git submodules prior to building the source
    distribution.  They are then setup again, with clean working
    directories, by the call to ./prepare.sh.

Mmakefile:
    Handle the the new location of libatomic_opss in the "tar" target.

scripts/prepare_install_dir.in:
    Handle both usage in the source distribution where
    boehm_gc/libatomic_ops is a directory, and usage in a development
    workspace where boehm_gc/libatomic_ops is a symlink.
2015-10-01 10:26:47 +10:00
Julien Fischer
88ba726688 Fix various minor problems.
Mmakefile:
	Run the realclean_tests target *before* the realclean_subdirs
	target since the former requires scripts/mmake to exist and
	the latter deletes it.

tests/debugger/save.exp:
	Update this expected output to conform to recent changes.
	(The .exp2 file was updated as part of those changes, but
	this one wasn't.)

trace/mercury_trace_cmd_breakpoint.c:
trace/mercury_trace_source.c:
	Avoid warnings from GCC.
2015-03-27 13:40:24 +11:00
Zoltan Somogyi
d33273d033 Tell vim not to expand tabs in Makefiles.
This file-specific setting will override a default setting of expandtabs
in $HOME/.vimrc.

*/Makefile:
*/Mmakefile:
    As above.

tests/hard_coded/.gitignore:
    Don't ignore the purity subdir. This ignore must have been left over
    from when purity.m was a test in hard_coded, not hard_coded/purity,
    and it ignored an executable, not a directory.
2015-01-08 22:07:29 +11:00
Paul Bone
d1f46923a0 Fix and enable the mfilterjavac option
Julien reported a bootstrap problem when mfilterjavac was enabled and a Java
grade was being installed but the installed compiler did not have an
mfilterjavac program.  When installing a Java grade the mfilterjavac program
in the workspace was not in the PATH.  This change ensures that mfilterjavac
is in the path and enables it's use in the compiler.

compiler/options.m:
    Enable the mfilterjavac option.

Mmakefile:
    Set the PATH in SUBDIR_MAKE and SUBSUBDIR_MAKE correctly so that the
    compiler can find mfilterjavac.

tools/bootcheck:
    Run 'mmake depend' in stage2/mfilterjavac in the same way that we do for
    the other directories.

mfilterjavac/.gitignore
    Ignore tags related files in this directory.
2013-10-16 19:14:24 +11:00
Julien Fischer
f0d0ddf414 Update the tar and touch_files targets for mfilterjavac.
Mmakefile:
	As above.
2013-04-23 17:47:25 +10:00
Julien Fischer
6cd0caa139 Install mfilterjavac from the top-level install target.
Mmakefile:
	As above.
2013-04-23 17:04:35 +10:00
Paul Bone
40600dfd31 Add mfilterjavac utility
Add the mfilterjavac utility to filter javac's output and re-write the error
locations.

mfilterjavac/mfilterjavac.m:
    As above

Mmakefile:
configure.ac:
mfilterjavac/Mmakefile
mfilterjavac/MFILTERJAVAC_FLAGS.in:
mfilterjavac/.mgnuc_opts:
mfilterjavac/.mgnuc_copts:
    Adjust the build system to support the new mfilterjavac directory.
2013-04-22 10:39:50 +10:00
Peter Wang
1cf15258d9 Remove RPM spec file and scripts.
The RPM spec file now lives in the `packaging' repository.

.mercury-compiler.spec.in:
tools/build_rpm:
tools/invoke_build_rpm:
	Delete these files.

.gitignore:
Mmakefile:
compiler/notes/release_checklist.html:
	Remove all evidence.

	Delete outdated instructions for building Debian packages.
2013-04-18 16:55:18 +10:00
Peter Wang
65cb898b07 Fix bug #203: install to temporary location with DESTDIR.
Attempting to install Mercury into a temporary location, with DESTDIR
set, would:

- wrongly install libatomic_ops into DESTDIR

- be unable to install library grades because the installed mmc script
  expects files in their final locations, without the DESTDIR prefix.

Thanks to Jeremy Huddleston and Nikolay Orlyuk for reporting the bug,
and an earlier version of this patch.

Mmakefile:
	Override MERCURY_COMPILER and MERCURY_CONFIG_DIR when installing
	library grades.

boehm_gc/build_atomic_ops.sh:
	Clear DESTDIR so that libatomic_ops is installed into the
	boehm_gc directory, as intended.
2013-03-18 15:21:31 +11:00
Julien Fischer
d33588b6a3 Rename the file generated for the source distribution.
Mmakefile:
    Make the tar target generate a file named me$rcury-srcdist-<VERSION>.tar.gz
    rather than mercury-compiler-<VERSION>.tar.gz.
2013-01-18 01:37:43 +11:00
Julien Fischer
c50b813b86 Do not distribute the extras distribution as a separate tarball.
Mmakefile:
    As above.
2013-01-17 13:22:05 +11:00
Julien Fischer
9309808a92 Exclude the .git directory from the source distribution.
Mmakefile:
     As above.  (I know that GNU tar has an --exclude-vcs
     option, but the BSD one doesn't.)
2013-01-04 16:39:31 +11:00
Julien Fischer
366f399efa Update and simplify the "tar" target in the top-level Mmakefile.
The main change here is to package up the test suite with the source
distribution rather than as a separate tarball.  The resulting combined tarball
is not significantly larger, so there is no good reason for not just
including the tests now.  TThe same rationale applies to not excluding
the benchmarks from the source distribution.

Mmakefile:
	Delete stuff in the tar target that was used for handling unused
	directories in the old CVS repository.

	Include the test suite in the main source distribution tarball
	rather than building a separate one for it.
2013-01-04 16:21:34 +11:00
Julien Fischer
7c12f72702 Rename configure.in to configure.ac.
configure.in:
    Rename this to configure.ac which is what current versions
    of autotools expect and also doesn't cause warnings to be
    emitted by aclocal.

Mmakefile:
scripts/ml.in:
    Conform to the above change.
2013-01-03 13:12:22 +11:00
Peter Wang
6b1f89831e Let Mercury be built with a MinGW cross-compiler.
Branches: main

Let Mercury be built with a MinGW cross-compiler.

tools/configure_mingw_cross:
	Add shell script to prepare for cross-compilation.

README.MinGW-cross:
	Document how to use the shell script.

configure.in:
Mmake.common.in:
	Set a new variable CROSS_COMPILING.

	Set FULLARCH and BUILD_C_PROGS_FOR_BUILD_SYSTEM variables
	to be passed to the Boehm GC build system.

	Use $host-ar for AR when cross-compiling.

m4/mercury.m4:
	Determine gcc version with gcc -dumpversion instead of building
	a program and running it.

	Don't run test for mercury_cv_cc_type if set explicitly.

Mmake.workspace:
	Use the default c2init and mkinit when cross-compiling.
	The copies in the util directory would not be usable then.

boehm_gc/Mmakefile:
	Pass configured values of AR, RANLIB down to sub-make.

boehm_gc/Makefile.direct:
boehm_gc/build_atomic_ops.sh:
	Use configured value from Mmake.common for HOSTCC.

	Pass --host when configuring libatomic_ops.

util/Mmakefile:
	Make tools with .exe suffixes on Windows.

Mmakefile:
	Use the bootstrap compiler to build libgrades when cross-compiling.

	Conform to changed target names in the util directory.

compiler/Mmakefile:
deep_profiler/Mmakefile:
profiler/Mmakefile:
slice/Mmakefile:
	Conform to changed target names in the util directory.

Makefile:
	Clean .exe files on Windows.
2012-01-09 00:35:41 +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