HPC
HPC

| HPC and Data for Lattice QCD

ald

HPC and Data for Lattice QCD

ald

Using and building the GNU linker for APEmille [noe 00/07/28]

Using with xtc/flint

Assume a program 'main.zzt' and 'module.zzt' . module contains only subroutines. main contains a 'begin main .. end main' section.
 % xtc-try -j -c main
 % xtc-try -j -c module
 % flint -E main-xtc
 % flint -E module-xtc
 % ald -o main main-xtc.o module-xtc.o		a)
 % elf2jex main  main.jex			b)
remarks:
 a) main program must be first
 b) no ELF loader for CAOS or KRUN (yet)

Using with t2/flint

Assume a program 'main.zzt' and 'module.zzt' . module contains only subroutines.
 % t2 -s main
 % t2 -s module
 % jasm2 main; jasm2 module
 % flint -E main
 % flint -M module                                      # 1)
 % ald -o main main.o module.o                          # 2)
 % elf2jex main main.jex                                # 3)
 % file main main.o main.*ex
 main: ELF 32-bit LSB executable, APEmille, version 1, statically linked, not stripped
 main.o: ELF 32-bit LSB relocatable, APEmille, version 1, not stripped 
 main.jex: APEmille jex file
remarks:
   1) t2 (up to beta5) always includes the main initialization
      and thus "defines" lots of labels. Modules mustn't define them, 
      so the converter needs the '-M' or '-m' flag.
   2) main program must be first
   3) no ELF loader for CAOS or KRUN (yet)

Building

(CVSROOT is assumed on apona)
  -  make sure the jab2.h include file and jasm2 binary are installed.
     (if not: CVS module jasm2)
  -  make sure 't2' is beta5 or later.
  -  check out the modified flint source
       cvs co -r WITH_REX flint
     and build it. 
     This will result in flint and disjex binaries that are different from
     the 'official" ones (but compatible). Make sure they are found in your
     PATH *before* the original ones (e.g. put them in $LROOT/bin/)
  -  check out the 'binutils' module. See README.apemille and configure
     like 4)
     I have links to the linker and some tools in $LROOT/bin/ : 
       ald     -> $BINUTILS/ld/ld-new
       nm      -> $BINUTILS/binutils/nm-new
       objdump -> $BINUTILS/binutils/objdump
       ar      -> $BINUTILS/binutils/ar
       ranlib  -> $BINUTILS/binutils/ranlib

      NOTE: if you configured as suggested, these tools also recognize the
      linux/386 format, so no need to rename them. Just for the linker I 
      prefer to be on the safe side ;-)
      All these tools should give a version "2.9.1 APE beta1"
 -  check out the 'elf' module, edit elf/converters/Makefile ,
    set the paths correctly and make.
    Install jex2elf and elf2jex in your path.
 -  patch your /usr/share/magic (redhat) file with elf/magic.patch , so
    the 'file' command will recognize apemille binaries.