[m-rev.] for review: Document experience on AIX.
Peter Wang
novalazy at gmail.com
Mon Jul 14 13:43:35 AEST 2014
On Fri, 11 Jul 2014 18:15:38 +1000, Julien Fischer <jfischer at opturion.com> wrote:
> >
> > You may need to use the IBM C compiler instead of gcc. Pass
> > "--with-cc=xlc"
> > when configuring the Mercury installation, and use high-level C grades
> > for better performance.
> >
>
> One issue here is that the configure script, Mercury.options, mgnuc script,
> compiler/compiile_target_code.m
> and probably other places won't recognise xlc as a type of C compiler --
> the type should default
> to unknown, but may incorrectly default to GCC in spots.
I found one instance with grep -i for "compiler[-_ ]type",
in reserve_stack_size_flags.
Here is an updated document for review.
Peter
-----------------------------------------------------------------------------
Mercury was tested on AIX in 2014.
* AIX 7.1 on POWER7 processor
* using xlc (IBM C compiler) or gcc 4.8.2
* in grades hlc.gc, reg.gc, none.gc
You must have GNU make, flex and bison. RPMS are available from:
<http://www.ibm.com/systems/power/software/aix/linux/>
More recent packages, including GCC, are available from:
<http://www.perzl.org/aix/index.php>
-----------------------------------------------------------------------------
LIBATOMIC_OPS WORKAROUND
libatomic_ops does not build correctly. One workaround is to set
AO_USE_PTHREAD_DEFS by modifying boehm_gc/build_atomic_ops.sh:
CFLAGS="-DAO_USE_PTHREAD_DEFS" \
./configure --prefix=$P --libdir=$P/lib "$@"
It is not recommended to use parallel Mercury grades in this configuration,
if they even build. They currently do not.
-----------------------------------------------------------------------------
BUILDING WITH IBM XL C COMPILER
To use the IBM C compiler, pass "--with-cc=xlc" when configuring Mercury
installation. Use high-level C grades for better performance.
Low-level C grades will overflow the default TOC data structure. To use a
large TOC, you can pass the option `-qpic=large' to the C compiler and the
linker, or the option `-bbigtoc' to the linker.
-----------------------------------------------------------------------------
BUILDING WITH GCC
gcc 4.2.0, as provided by IBM, is very old and will not work. It crashes on
long function names, which the Mercury compiler generates an abundance of.
gcc 4.8.2 does work, but requires some workarounds:
* The configure test "checking whether we can use gcc labels..." enters
an infinite loop. Hit ^C to fail the test and continue.
`reg.gc' is available but not `asm_fast.gc'.
* Low-level C grades will overflow the TOC. Add this to Mmake.params:
EXTRA_CFLAGS=-mminimal-toc
or perhaps
EXTRA_CFLAGS=-mcmodel=medium
You would need the same flag when building user programs.
* Edit the `mgnuc' script to delete instances of `-ansi' to prevent
compilation problems. Pass `--no-ansi-c' when using `mmc --make'.
* gcc generates some spurious warnings about uninitialized variables.
-----------------------------------------------------------------------------
More information about the reviews
mailing list