24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The configuration file /etc/xlf.cfg lists these default libraries and linker options. By<br />

doing a sample compilation with the -# option, you can see exactly how the<br />

compiler would run the linker.<br />

See the <strong>AIX</strong> Commands Reference <strong>for</strong> a description of the linker options.<br />

Linking 32–Bit Non-SMP Object Files Using the ld Command<br />

To use the ld command to link non-SMP object files in a 32-bit environment, follow<br />

these guidelines:<br />

v Do not specify the -e flag.<br />

v Do not change the default starting point of the executable output file (__start).<br />

If you use other starting points, your results will be unpredictable.<br />

v Specify the following options and files with the ld command:<br />

– -bh:4, -bpT:0x10000000, -bpD:02x0000000.<br />

– -lxlf be<strong>for</strong>e any other libraries or files on the command line if any object files<br />

compiled by <strong>XL</strong> <strong>Fortran</strong> Version 2 are being linked.<br />

– The object file that contains the system startup routine:<br />

- crt0.o <strong>for</strong> a program that was not profiled.<br />

- mcrt0.o <strong>for</strong> a program that was profiled with the -p option.<br />

- gcrt0.o <strong>for</strong> a program that was profiled with the -pg option.<br />

- Link with the startup files in /usr/lib.<br />

– Compiler and system libraries:<br />

- -lxlf90, -lm, and -lc in that order.<br />

- If you use the -qautodbl option, specify some extra libraries that are listed<br />

in “-qautodbl Option” on page 134.<br />

- If you use the -qpdf1 compiler option, specify -lxlopt.<br />

- If you use the -qhot=vector suboption, specify -lxlopt.<br />

For example, to link the object files file1.o and file2.o, you could specify the<br />

following:<br />

ld -bh:4 -bpT:0x10000000 -bpD:0x20000000 /lib/crt0.o -lxlf90 -lm -lc<br />

file1.o file2.o<br />

The configuration file /etc/xlf.cfg lists these default libraries and linker options. By<br />

doing a sample compilation with the -# option, you can see exactly how the<br />

compiler would run the linker.<br />

See the <strong>AIX</strong> Commands Reference <strong>for</strong> a description of the linker options.<br />

Linking 64-Bit Non-SMP Object Files Using the ld Command<br />

To use the ld command to link non-SMP object files in a 64-bit environment, follow<br />

these guidelines:<br />

v Do not specify the -e flag.<br />

v Do not change the default starting point of the executable output file (__start).<br />

If you use other starting points, your results will be unpredictable.<br />

v Specify the following options and files with the ld command:<br />

– On <strong>AIX</strong> 5.1, -bh:4, -bpT:0x10000000, -bpD:0x20000000, -b64.<br />

– The object file that contains the system startup routine:<br />

- crt0_64.o <strong>for</strong> a program that was not profiled.<br />

- mcrt0_64.o <strong>for</strong> a program that was profiled with the -p option.<br />

- gcrt0_64.o <strong>for</strong> a program that was profiled with the -pg option.<br />

- Link with the startup files in /usr/lib.<br />

– Compiler and system libraries:<br />

- -lxlf90, -lm, and -lc in that order.<br />

44 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!