As another example of that, consider that while most *ix's put shared libraries in a file with a ".so" extension, and then that file contains a bunch of PIC-compiled .o's. Static libraries are placed in a file with a ".a" extension, and again contain .o files that needn't be compiled PIC.
However, on AIX, both shared libraries and static libraries go into a single ".a" file. The shared version goes into the .a as a single file with a ".so" extension, while the static version goes into the .a as a series of PIC-compiled .o's. That's right, the static .o's are PIC, because all objects on AIX are PIC.
In addition, on AIX, both the 32 bit and the 64 bit version of a library, whether static or shared (see above) go into the same .a file. If you want the 32 bit version, you need $OBJECT_MODE==32 or to specify -X 32, and if you want the 64 bit version, you need $OBJECT_MODE==64 or to specify -X 64.
This leads to a problem with most contemporary Makefile's. Namely, when you "make install", the "install" rule is probably going to want to wipe out any .a's and start over. So it's easy to get .a's with 64 bit objects, or to get .a's with 32 bit objects, but getting both requires some extra futzing around.
That's the purpose of my merge-libs script. To use it, you first build your 32 bit version, and "make install" it as you would normally. Then you build the 64 bit version, but instead of using "make install" again (which would wipe out your 32 bit version), you instead find all the .a's in your build tree, and run something like:
esmf04m-root) merge-libs /usr/local/OPeNDAP-3.5.3/lib/libnetcdf_c++.a libnetcdf_c++.a Destination library is /usr/local/OPeNDAP-3.5.3/lib/libnetcdf_c++.a Source libraries are libnetcdf_c++.a Source library is libnetcdf_c++.a No 32 bit objects found in /u/strombrg/src/opendap/new/netcdf/src/src/cxx/libnetcdf_c++.a, continuing 64 bit objects found in /u/strombrg/src/opendap/new/netcdf/src/src/cxx/libnetcdf_c++.a, adding to /usr/local/OPeNDAP-3.5.3/lib/libnetcdf_c++.a Mon Feb 13 17:14:21
You can e-mail the author with questions or comments: