Sponsored Content
Top Forums Programming Incompatiblity of the code due to CC compiler version mismatch. Post 302742959 by jim mcnamara on Tuesday 11th of December 2012 11:52:56 PM
Old 12-12-2012
Wow those directories are waaay to deep. Whoever did that was not afraid of PATH_MAX.

You have two different versions of middleware. While trying what I am showing you, be sure sure you find a common and correct release level of the libraries. Maybe it is: libbfunctor.so. in the 7.5.5.0.02 subdirectory -- this must match the current production version of the library.

Anyway - you have coerce the linker ld into using directory names that match what is on the problem server, even if they are not real on the compile server

Here is one way:

Library names are often symlinks. Like /usr/lib/libc.so is usually a symlink that points to the current version of libc, like maybe libc.so.4.2.1.

You need to trick the linker into using names it can find on the other box. This means two separate compiles with two makefiles, one the old way, one the new way to get around this nonsense for the problem machine. You already know the old way.

Those names are beyond absurdly long, so here is an example using sane paths.
Let's say you compile on machine A. And link to libfunctor.so which is really:
Code:
/usr/path/to/libc/libfunctor.so.1234 
# where it is a symlink
/usr/path/to/libc/libfunctor.so -> /usr/path/to/libc/libfunctor.so.1234

Now we know that
Code:
/usr/path/to

does not exist on one machine. So, on the compile machine we create a dummy directory that just has some symlinks in it.

We also know that on the problem machine the path to a libfunctor library we can use is
/opt/foo/gargle/libfunctor.so.1234 (HAS TO BE the SAME version as on the compile box).

This does not exist yet on the compile box. So. On the compile box we are going one make one via a symlink:
Code:
mkdir -p /opt/foo/gargle
ln-s /usr/path/to/libc/libfunctor.so.1234 /opt/foo/gargle/libfunctor.so.1234

Do the same for each library - I think there just two.

Change the -L command in your new makefile to point
Code:
-L /opt/foo/gargle

Run the new makefile. You can tell the compiled versions apart by running the command
Code:
ldd myprogname | grep libfunctor

Distribute the one that uses /opt/foo/gargle to the box that has /opt/foo/gargle/

You now know why installing software onto any old directory tree name on different UNIX boxes: is a pain in the butt.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

gcc compiler version?

How do you determine which version of the GNU gcc compiler is on your system? (1 Reply)
Discussion started by: Ben070371
1 Replies

2. Solaris

X Keyboard Extension version mismatch

I want to use calls from the X Keyboard Extension, but get "library version mismatch" error. First one is XkbLibraryVersion(..). This one already returns false. Then I call XkbOpenDisplay(...) which does not return a valid display; return value is XkbOD_NonXkbServer. If I open the display with... (0 Replies)
Discussion started by: hiker04
0 Replies

3. UNIX for Dummies Questions & Answers

What version is the compiler?

Hi ! we have a intel fortran compiler on our computer. How do i find out what version it is ? Thank you, dsmv. (1 Reply)
Discussion started by: dsmv
1 Replies

4. AIX

how to find out the compiler version and OS from binary file

Command to get the Compiler version(xlc/gcc) from the binary on AIX platform. I m searching for the Command, to get the Compiler(xlc/gcc) used to build the binary on AIX. I got two commands used on Linux Platform: - readelf -a <lib> | grep comment - hexdump -C -s 0x49e7b -n 1812 <lib> ... (1 Reply)
Discussion started by: Prajakta
1 Replies

5. AIX

install two different compiler version

Hi all. I have a simple question. There's a way to install under AIX system (5.3) two different compiler version, i.e. ibm xlf fortran 11 and 12? Seems that smitty doesn't allows user to change the default installation path; it only allows you to save the replaced files of the superseded... (1 Reply)
Discussion started by: poldo000
1 Replies

6. Solaris

java version mismatch for normal user and root user

:confused: I installed latest version of java ( jre 1.6) on Solaris Machine ......when I run java -version as root, shows the latest version but when I run java -version as normal user, shows the old / previous version What should I do to fix this ...should show the latest version... (3 Replies)
Discussion started by: frintocf
3 Replies

7. Programming

Choose compiler version

Hi, I'm new, here, and I'm searching for a simple solution for a simple problem. I'm working on RedHat 4.4.6-4 through a CentOS Virtual Machine and due to some reasons I must compile my C++ codes with these two different g++ versions: 4.4.6 and 4.2.2. The fact is that I should be able to... (4 Replies)
Discussion started by: Marcuss
4 Replies

8. AIX

Checking xlc compiler version

Hi, Below is output of lslpp command. bash-3.00# lslpp -L | grep xlC xlC.aix50.rte 11.1.0.1 C F XL C/C++ Runtime for AIX 5.3 xlC.cpp 9.0.0.0 C F C for AIX Preprocessor xlC.msg.en_US.cpp 9.0.0.0 C F C for AIX... (2 Replies)
Discussion started by: manoj.solaris
2 Replies

9. Linux

Linking issue due to so version number

Hi all, currently I'm facing a issue in linking a .so file. In my build machine, I've libcrypto.so.6 and there is a softlink as libcrypto.so. In my make file I'm trying to link to the lib using -L -lcrypto and it is success and created my test.exe. When I copy this test.exe to other... (4 Replies)
Discussion started by: vijkrr
4 Replies

10. Shell Programming and Scripting

Need fix for rsync Error due to version mismatch

rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -t -a -x' /web/admin/Transfer/data/ user1@destserver1:/tmp/testf rsync version on sender server is:3.0.9 rsync version on sender server is:3.0.6 Linux sourceserver1 3.10.0-693.17.1.el7.x86_64 #1 SMP Sun Jan 14 10:36:03 EST... (1 Reply)
Discussion started by: mohtashims
1 Replies
moe(1)																	    moe(1)

NAME
moe - manifest the optimal expansion of a pathname SYNOPSIS
moe [-c] [-32 | -64] [-s | -v] path The moe utility manifests the optimal expansion of a pathname containing reserved runtime linker tokens. These tokens can be used to define dependencies, filtees and runpaths within dynamic objects. The expansion of these tokens at runtime, provides a flexible mechanism for selecting objects and search paths that perform best on this machine. See ld.so.1(1). For example, the token $HWCAP can be employed to represent filters and dependencies. The runtime interpretation of this token can result in a family of objects that are analyzed to determine their applicability for loading with a process. The objects are sorted based on the hardware capabilities that each object requires to execute. moe returns the name of the object optimally suited for execution on the cur- rent platform. moe analyzes a pathname by passing the supplied path to dlmopen(3C), together with the RTLD_FIRST flag. Reserved token expansion is there- fore carried out by ld.so.1 as the expansion would occur in an executing process. Although multiple objects can be analyzed as a result of the dlmopen() call, the RTLD_FIRST flag insures only the optimal object is processed. By default, moe analyzes the specified path twice. The first analysis looks for 32-bit objects. The second analysis, if applicable, looks for 64-bit objects. Typically, 32-bit objects and 64-bit objects are isolated to different directories. These directories are frequently named to reflect the class of object the directory contains. The multiple passes of moe catch any instances where 32-bit objects and 64-bit objects occupy the same directory. Multiple passes also provide flexibility when the pathname that is specified does not convey to the user the class of object the directory might contain. For a complete description of the reserved token expansion carried out by the runtime linker, refer to the . The following options are supported: -32 Only analyze 32-bit objects. -64 Only analyze 64-bit objects. -c Prefix each pathname with the class of the object. -s Silent. No optimal name, or error diagnostics are displayed. Only an error return is made available. This option is only meaning- ful with the -32 and -64 options. The -s option can not be used with the -v option. -v Verbose. If no optimal expansion name can be determined, an error diagnostic is written to standard error. The -v option can not be used with the -s option. The following operand is supported: path The pathname to be expanded. The following example uses moe to display the optimal expansion of objects in the directory /usr/lib/libc. This directory contains a family of Intel objects that are built to use various hardware capabilities. % moe '/usr/lib/libc/$HWCAP' /usr/lib/libc/libc_hwcap.so.1 The -c option can be used to clarify the class of the optimal object. % moe -c '/usr/lib/libc/$HWCAP' 32-bit: /usr/lib/libc/libc_hwcap.so.1 The following example uses moe to display the optimal expansion of objects under the /opt/ISV/cpu directory hierarchy. These directories contain a family of SPARC objects that are built for various platforms. % moe -c -64 '/opt/ISV/$ISALIST/isa.so.1' 64-bit: /opt/ISV/sparcv9/isa.so.1 The -v can be used to diagnose the instance where an optimal name is not returned. An attempt to inspect the previous pathname as a 32-bit object, would result in the following diagnostic being produced. % moe -c -v -32 '/opt/ISV/$ISALIST/isa.so.1' 32-bit: /opt/ISV/sparcv9/isa.so.1: wrong ELF class: ELFCLASS64 When the -32 or -64 options are in effect, a successful optimal expansion returns 0, otherwise non-zero. Without the -32 or -64 options in effect, the return value is always 0. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Stable | +-----------------------------+-----------------------------+ ld.so.1(1), optisa(1), isalist(1), dlmopen(3C), attributes(5) 2 Feb 2005 moe(1)
All times are GMT -4. The time now is 07:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy