Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have compile on AIX two version of proftpd one with gcc and one with the xl c compiler from IBM.
The command line to compile both version are almost the excat same, but when I do a ldd on the gcc version, I have no problem while when I try to ldd the xl compiled I have for the libmysqlclient.a the message :
Cannot find libmysqlclient.a(libmysqlclient.so.16)
though I do include the library correct path during the compilation.
So the question is how can I identify the path where the binary look for binary or how can I include this path during compilation ?

Feel free to ask for further details, I'll update my question.

Edit 1 ldd result:
for the gcc version I have :

ldd/usr/local/proftpd/sbin/proftpd
/usr/local/proftpd/sbin/proftpd needs:
    /usr/lib//libc.a(shr.o)
    /opt/freeware/lib/libcrypto.a(libcrypto.so.1.0.1)
    /usr/lib//libpam.a(shr.o)
    /opt/freeware/lib/libssl.a(libssl.so.1.0.1)
    /opt/freeware/lib/mysql/mysql//libmysqlclient.a(libmysqlclient.so.16)
    /opt/freeware/lib/libz.a(libz.so.1)
    /unix
    /usr/lib//libcrypt.a(shr.o)
    /usr/lib//libc.a(shr_64.o)
    /usr/lib//libpthreads.a(shr_xpg5_64.o)
    /usr/lib//libmls.a(shr.o)
    /opt/freeware/lib/libgcc_s.a(shr.o)
    /usr/lib//libpthread.a(shr_xpg5.o)
    /usr/lib//libcrypt.a(shr_64.o)
    /usr/lib//libpthreads.a(shr_xpg5.o)
    /usr/lib//libmlsenc.a(shr.o)
    /usr/lib//libodm.a(shr.o)
    /usr/lib//libpthreads.a(shr_comm.o)

For the xl C version I have :

ldd proftpd-1.3.4d/proftpd
proftpd-1.3.4d/proftpd needs:
    /usr/lib/libc.a(shr.o)
    /opt/freeware/lib/libcrypto.a(libcrypto.so.1.0.1)
    /usr/lib/libpam.a(shr.o)
    /opt/freeware/lib/libssl.a(libssl.so.1.0.1)
    Cannot find libmysqlclient.a(libmysqlclient.so.16)
    /opt/freeware/lib/libz.a(libz.so.1)
    /unix
    /usr/lib/libcrypt.a(shr.o)
    /usr/lib/libc.a(shr_64.o)
    /usr/lib/libpthreads.a(shr_xpg5_64.o)
    /usr/lib/libmls.a(shr.o)
    /usr/lib/libcrypt.a(shr_64.o)
    /usr/lib/libpthreads.a(shr_xpg5.o)
    /usr/lib/libmlsenc.a(shr.o)
    /usr/lib/libodm.a(shr.o)
    /usr/lib/libpthreads.a(shr_comm.o)

Edit 2+1 compilation command (with a bit a formatting to make it more readable:
To compile with XL C I use this script

export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIG_ENV_ARGS=/opt/freeware/bin/bash
export CC=cc
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"export CXX=xlC
export CXXFLAGS=$CFLAGS
export F77=xlf
export FFLAGS="-qmaxmem=16384 -O -I/opt/freeware/include"
export LD=ld
export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib:/opt/freeware/lib/mysql/mysql -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-bmaxdata:0x80000000"
export PATH=/usr/bin:/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin:/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/opt/freeware/bin:/opt/freeware/sbin:/usr/local/bin:/usr/lib/instl
make clean
./configure 
    --with-modules=mod_tls:mod_sql:mod_sql_mysql:mod_sql_passwd:mod_sftp:mod_sftp_sql 
    --without-getopt 
    --enable-openssl 
    --with-includes=/home/user/include3_mysql/zlib:/home/user/include_mysql/mysql:/opt/freeware/lib/mysql/mysql 
    #with or without it doesn't work
     --with-libraries=/opt/freeware/lib/mysql/mysql  
     --prefix=/local/proftpd
make

The command line from GCC is a bit longer but without all the export part :

make clean
./configure 
    --with-modules=mod_tls:mod_sql:mod_sql_mysql:mod_sql_passwd:mod_sftp:mod_sftp_sql 
    --without-getopt 
    --enable-openssl 
    --with-includes=/opt/freeware/include:/opt/freeware/include/mysql/mysql/:/home/user/libmath_header/ 
    --with-libraries=/usr/lib/libc.a:/opt/freeware/lib/libcrypto.a:/usr/lib/libpam.a:/opt/freeware/lib/libssl.a:/opt/freeware/lib/mysql/mysql//libmysqlclient.a:/opt/freeware/lib/libz.a:/unix:/usr/lib/libcrypt.a:/usr/lib/libc.a:/usr/lib/libpthreads.a:/usr/lib/libmls.a:/opt/freeware/lib/libgcc_s.a:/usr/lib/libpthread.a:/usr/lib/libcrypt.a:/usr/lib/libpthreads.a:/usr/lib/libmlsenc.a:/usr/lib/libodm.a:/usr/lib/libpthreads.a 
    --prefix=/home/user/proftpd_bin
make

Edit 4: Does anybody have any small clue ?

share|improve this question

2 Answers 2

Edit 2 I see another line that's weird:

--with-includes=[...]/opt/freeware/lib/mysql/mysql 

Shouldn't that be /opt/freeware/include/mysql/mysql instead?

Also you haven't added /opt/freeware/lib/mysql/mysql to LDFLAGS when compiling.

Edit I see one thing that might explain it:

/opt/freeware/lib/mysql/mysql//libmysqlclient.a(libmysqlclient.so.16)

Note the extra / in there. I'm by no means an expert in xl, but it might possibly be getting confused by that, if you used the same notation when compiling in both compilers.

(Original answer: From my vague memory of AIX, I believe you want to add the path to the environment variable LIBPATH. )

share|improve this answer
    
well problem is it's empty if it's the correct name :D –  Kiwy Jan 2 at 11:12
1  
It would probably help if you showed what the command line options you used were. I'm by no means an expert in the xl c compiler, but it would appear obvious that it didn't link things in the same way as gcc did. –  Jenny D Jan 2 at 11:14
    
well I will as soon as I manage to get my bash history file back -.-' –  Kiwy Jan 2 at 11:27
    
Changed my answer based on your edit –  Jenny D Jan 2 at 11:36
    
Well now it's not compiling anymore, so Is it a bug or feature ? I 'll update the question. –  Kiwy Jan 2 at 11:38
up vote 1 down vote accepted

I finally use this script to allow the compilation:

export CONFIG_SHELL=/opt/freeware/bin/bash
export CONFIG_ENV_ARGS=/opt/freeware/bin/bash
export CC=cc
export CFLAGS="-qmaxmem=16384 -DSYSV -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 -D_AIX51 -D_AIX52 -D_AIX53 -D_AIX61 -D_ALL_SOURCE -DFUNCPROTO=15 -O -I/opt/freeware/include"export CXX=xlC
export CXXFLAGS=$CFLAGS
export F77=xlf
export FFLAGS="-qmaxmem=16384 -O -I/opt/freeware/include"
export LD=ld

export LDFLAGS="-L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib:/opt/freeware/lib/mysql/mysql -Wl,-bmaxdata:0x80000000"

export PATH=/usr/bin:/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/vac/bin:/usr/vacpp/bin:/usr/ccs/bin:/usr/dt/bin:/usr/opt/perl5/bin:/opt/freeware/bin:/opt/freeware/sbin:/usr/local/bin:/usr/lib/instl
make clean
./configure 
--with-modules=mod_tls:mod_sql:mod_sql_mysql:mod_sql_passwd:mod_sftp:mod_sftp_sql 
--without-getopt 
--enable-openssl 
--with-includes=/home/padubois/include3_mysql/zlib/:/home/padubois/include_mysql/mysql/ 
--with-libraries=/opt/freeware/lib/mysql/mysql:/opt/freeware/lib/mysql/mysql/libmysqlclient.a 
--prefix=/local/proftpd/
make

I was misusing LDFLAG here's the important part :
-blibpath:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib:/opt/freeware/lib/mysql/mysql

Happy new year

share|improve this answer
    
Nice that you found it! Happy new year to yourself too! –  Jenny D Jan 3 at 11:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.