Linker Options
Options for linking.
-h [system|default]_alloc
Default: -h default_alloc
By default, the compiler uses a modified malloc implementation that offers better support for memory needs. The -h system_alloc option directs the compiler to link in the native malloc provided by the OS instead of the modified implementation.
-h [no]pgas_runtime
Default: pgas_runtime
The -h pgas_runtime option directs the compiler driver to link with the runtime libraries required when linking programs that use UPC, or coarrays. In general, a resource manager job launcher such as aprun or srun must be used to launch the resulting executable.
The -hnopgas_runtime option prevents this runtime library environment from being added to the link line.
Use the -hnopgas_runtime option with a program that does not use UPC or coarrays, when it needs to be executed outside of the aprun/srun job launch context. For example, to test a serial program which does not contain any UPC or coarray code on a login or service node, or fork/exec an executable on a compute node. Also, compile non-coarray Fortran using the -hnocaf option.
-h pgas_runtime is not supported in the Envoy environment.
-l libname
The -l libname option directs the compiler driver to search for the specified object library file when linking an executable file. To request more than one library file, specify multiple -l options.
When statically linking, the compiler driver searches for libraries by prepending ldir/lib to libname and appending .a, for each ldir that has been specified by using the -L option. It uses the first file it finds.
When dynamically linking, the library search process is similar to the static case, with a few differences. The compiler driver searches for libraries by prepending ldir/lib on the front of libname and appending .so on the end of it, for each ldir that has been specified by using the -L option. If a matching .so is not found, the compiler driver replaces .so with .a and repeats the process from the beginning. It uses the first file it finds.
There is no search order dependency for libraries.
If personal libraries are specified by using the -l command line option, those libraries are added before the default CCE library list. The -l option is passed to the linker. For example, when the following command line is issued, the linker looks for a library named libmylib.a and adds it to the top of the list of default libraries.
-L ldir
Changes the -l option search algorithm to look for library files in directory ldir during link time. To request more than one library directory, specify multiple -L options.
The linker searches for library files in the compiler release-specific directories.
Multiple -L options are treated cumulatively as if all ldir arguments appeared on one -L option preceding all -l options. Therefore, do not attempt to link functions of the same name from different libraries through the use of alternating -L and -l options.
-o outfile
Produces an absolute binary file named outfile. A file named a.out is produced by default. When this option is used in conjunction with the -c option and a single source file, a relocatable object file named outfile is produced.