fatal: libm.so.2: open failed: No such file or directory
Following errors appeared during adcfgclone:
adgendbc.sh started at Wed Feb 13 19:58:15 EST 2008
.end std out.
ld.so.1: adident: fatal: libm.so.2: open failed: No such file or directory
$COMMON_TOP/admin/install/$CONTEXT_NAME/adgendbc.sh: test: argument expected
.end err out.
Uploading Metadata file $AD_TOP/admin/template/adctxinf.tmp
Metadata file $AD_TOP/admin/template/adctxinf.tmp upload failed.
Check log file created by FNDCPUCF program.
ERRORCODE = 137 ERRORCODE_END
.end std out.
ld.so.1: FNDCPUCF: fatal: libm.so.2: open failed: No such file or directory
Killed
ld.so.1: FNDCPUCF: fatal: libm.so.2: open failed: No such file or directory
Killed
I did an ldd to see what libraries were being called by the binaries that were failing
$ ldd $AD_TOP/bin/adident
libclntsh.so.1.0 => $ORACLE_HOME/lib/libclntsh.so.1.0
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libgen.so.1 => /usr/lib/libgen.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libc.so.1 => /usr/lib/libc.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.2 => (file not found)
libm.so.1 => /usr/lib/libm.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Sun-Fire-15000/lib/libc_psr.so.1
On inquring about the OS version of the source instance and the target instance, I learned that source instance is on Solaris 8 OS and target instance is on Solaris 10.
The first workaround I suggested was to simply copy /usr/lib/libm.so.1 as /usr/lib/libm.so.2. This worked, but since we were not sure this was the correct method, I googled some more. This link on sunfreeware.com advises in red:
The SPARC/Solaris 8 package may need /usr/lib/libm.so.2 which may not exist on some systems. You can use libm.so.1 by just doing ln -s /usr/lib/libm.so.1 /usr/lib/libm.so.2.
Sun fixed bug 6380587 which has these comments:
Currently the official builds on Solaris 8 use -lm or /usr/lib/libm.so in links of libraries or programs that need libm (math library functions). On Solaris 8 this ends up being a dependency on libm.so.1 because libm.so is a softlink to libm.so.1. But when you build on Solaris 9/10/11, libm.so is a softlink to libm.so.2, which is a library that does not exist on Solaris 8.
On Solaris 8 and 9, /usr/lib/libm.so is a softlink to /usr/lib/libm.so.1.
On Solaris 10, /usr/lib/libm.so is a softlink to /usr/lib/libm.so.2.
This softlink is resolved at the time the library is built with -lm (which is ‘as if’ you listed /usr/lib/libm.so on your link line), so this dependency on either libm.so.1 or libm.so.2 becomes permanent in what you build.
libm.so.2 is actually the Standard C math library. (A new .2 version had to be added when adding C99 support in Solaris 10 since it was incompatible with some of the existing functions in libm.so.1.)
After learning so much, I realized that I had not searched on metalink yet. So I searched with keyword libm.so.2 and voila note 403543.1 appeared in the results and gives the best solution:
Symptoms
When starting services (e.g., webserver, concurrent manager server or report server), they fail with the following errors:
adapcctl.sh version 115.50
Apache Web Server Listener is not running.
Starting Apache Web Server Listener (dedicated HTTP) …
Apache Web Server Listener (PLSQL) is not running.
Starting Apache Web Server Listener (dedicated PLSQL) …
adapcctl.sh: exiting with status 0
.end std out.
ld.so.1: FNDSVCRG: fatal: libm.so.2: open failed: No such file or directory
Killed
ld.so.1: FNDSVCRG: fatal: libm.so.2: open failed: No such file or directory
Killed
ld.so.1: FNDSVCRG: fatal: libm.so.2: open failed: No such file or directory
Killed
ld.so.1: FNDSVCRG: fatal: libm.so.2: open failed: No such file or directory
Killed
Note : While trying to correct the iss it was found that ADADMIN utility was not working.
Cloned from Solaris 10 to solaris 8
Due to the different versions of the operating systems used, the libraries will not match.
To implement the solution, please execute the following steps:
1. adrelink.sh force=y "fnd FNDSVCRG"
2. adrelink.sh force=y "ad adadmin"
3. adrelink.sh force=y "ad all"
Based on the above note, we first ran adrelink.sh force=y "ad adadmin"
ldd command confirmed that libm.so.2 was gone from the library list being referenced:
$ ldd $AD_TOP/bin/adadmin
libclntsh.so.1.0 => $ORACLE_HOME/lib/libclntsh.so.1.0
libnsl.so.1 => /usr/lib/libnsl.so.1
libsocket.so.1 => /usr/lib/libsocket.so.1
libgen.so.1 => /usr/lib/libgen.so.1
libdl.so.1 => /usr/lib/libdl.so.1
libc.so.1 => /usr/lib/libc.so.1
libaio.so.1 => /usr/lib/libaio.so.1
libm.so.1 => /usr/lib/libm.so.1
libmp.so.2 => /usr/lib/libmp.so.2
/usr/platform/SUNW,Sun-Fire-15000/lib/libc_psr.so.1
Based on the above, we ran adadmin and relinked all binaries with force option.