-
Notifications
You must be signed in to change notification settings - Fork 46
/
README.MULTILIB
76 lines (51 loc) · 2.88 KB
/
README.MULTILIB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Multilib allows you to have both 32-bit and 64-bit versions of libmunge
installed at the same time, capable of communicating with either a 32-bit
or 64-bit version of munged.
On Linux, at least, 32-bit libraries usually reside in /usr/lib, and
64-bit libraries usually reside in /usr/lib64. But on ia64, for example,
64-bit libraries reside in /usr/lib since everything is 64-bit there.
If you are building from source, you can pass a command-line option to
the configure script:
$ ./configure --enable-arch=32
$ ./configure --enable-arch=64
If you are building RPMs, you can pass a command-line option to rpmbuild:
$ rpmbuild -ta --clean --with arch32 munge-x.y.z.tar.bz2
$ rpmbuild -ta --clean --with arch64 munge-x.y.z.tar.bz2
You might also have to specify the --target command-line option:
$ rpmbuild -ta --clean --with arch32 --target i386 munge-x.y.z.tar.bz2
$ rpmbuild -ta --clean --with arch64 --target x86_64 munge-x.y.z.tar.bz2
For each platform, you will have one source RPM and three binary RPMs
(munge, munge-devel, and munge-libs).
If you wanted to install both 32-bit and 64-bit MUNGE libraries on an
RPM-based x86_64 system, for example, you would need to install either
the 32-bit or 64-bit version of the main munge RPM (containing munged),
and both 32-bit and 64-bit versions of the munge-devel and munge-libs RPMs:
$ rpm -ivh RPMS/x86_64/munge-0.5-1.x86_64.rpm \
RPMS/x86_64/munge-devel-0.5-1.x86_64.rpm \
RPMS/x86_64/munge-libs-0.5-1.x86_64.rpm \
RPMS/i386/munge-devel-0.5-1.i386.rpm \
RPMS/i386/munge-libs-0.5-1.i386.rpm
You can then link your application against either the 32-bit or 64-bit library:
$ gcc -o foo foo.c -m32 -lmunge
$ gcc -o foo foo.c -m64 -lmunge
AIX uses RPM 3.x which does not recognize the "--with" command-line option.
The 'arch 32_64' define builds a single multiarch library where both 32-bit
and 64-bit objects reside in libmunge.a. Note that the 'arch 32_64' string
must be quoted to appear as a single command-line argument. Export the
OBJECT_MODE variable to the environment.
The OS detection in RPM 3.x appends the OS version and release to the name
(eg, "aix5.3"). Since I didn't want to pin the spec file to a particular
set of AIX versions, I used the generic OS string "aix". Consequently,
you must specify "--target ppc-aix" when building the RPM, and "--ignoreos"
when installing the RPM.
$ export OBJECT_MODE=32
$ rpm -ta --clean --define 'arch 32' --target ppc-aix munge-x.y.z.tar.bz2
$ export OBJECT_MODE=64
$ rpm -ta --clean --define 'arch 64' --target ppc-aix munge-x.y.z.tar.bz2
$ export OBJECT_MODE=32
$ rpm -ta --clean --define 'arch 32_64' --target ppc-aix munge-x.y.z.tar.bz2
You can then link your application against either the 32-bit or 64-bit library:
$ export OBJECT_MODE=32
$ gcc -o foo foo.c -lmunge
$ export OBJECT_MODE=64
$ gcc -o foo foo.c -lmunge