Example 3-1: directory structure, Example 3-2: recommended directory structure, 9 advanced topics – HP XC System 2.x Software User Manual

Page 50: 1 using the gnu parallel make capability, Section 3.9)

Advertising
background image

has

/opt/mypackage/lib

in it, which will then be able to handle both 32-bit and 64-bit

binaries that have linked against

libmystuff.so

.

Example 3-1: Directory Structure

/opt/mypackage/

include/

mystuff.h

lib/

i686/

libmystuff.a

libmystuff.so

x86_64/

libmystuff.a

libmystuff.so

If you have an existing paradigm using different names, HP recommends introducing links with
the above names. An example of this is shown in Example 3-2.

Example 3-2: Recommended Directory Structure

/opt/mypackage/

include/

mystuff.h

lib/

32/

libmystuff.a

libmystuff.so

64/

libmystuff.a

libmystuff.so

.......

i686 -> 32

.......

x86_64 -> 64

Linking an application using the library (dynamic or archive) requires you to specify the
appropriate subdirectory, depending on whether the application is 32-bit or 64-bit.

For example, to build a 32-bit application, you might enter:

<linkcommand> <32-bit> -L/opt/mypackage/lib/i686 -lmystuff

To build a 64-bit application, you might enter:

<linkcommand> <64-bit> -L/opt/mypackage/lib/x86_64 -lmystuff

Note that there is no shortcut as there is for the dynamic loader.

3.9 Advanced Topics

This section discusses topics of an advanced nature pertaining to developing applications in
the HP XC environment.

3.9.1 Using the GNU Parallel Make Capability

By default, the

make

command invokes the GNU

make

program. GNU

make

has the ability to

make independent targets concurrently. For example, if building a program requires compiling
10 source files, and the compilations can be done independently,

make

can manage multiple

compilations at once — the number of jobs is user selectable. More precisely, each target’s rules
are run normally (sequentially within the rule). Typically the rules for an object file target is a

3-10

Developing Applications

Advertising