IBM Support

Building libmysqlclient.so (instead of just libmysqlclient.a) in the POWER8 Ubuntu LE (ppc64le) platform

Technical Blog Post


Abstract

Building libmysqlclient.so (instead of just libmysqlclient.a) in the POWER8 Ubuntu LE (ppc64le) platform

Body

If any of you have been scratching your head about why building MySQL client libraries from source on the new POWER8 Ubuntu LE platform doesn't produce shared libraries (libmysqlclient.so) then please read on. Here are a few hacks which might also apply to other open source projects (more specifically their configure file and config.guess files) which have not kept up with the newest platforms. Here are the steps I used to compile libmysqlclient.so from source.

  1. wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.1.62.tar.gz
  2. untar
  3. replace config.guess with the latest version download as:
    $ curl "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config…; > config.guess
    $ curl "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config…; > config.sub
  4. Edit the configure file to fix how the LD variable is set to elf64lppc for the new powerpc64le host:
        case `/usr/bin/file conftest.o` in
          *32-bit*)
            case $host in
              x86_64-*kfreebsd*-gnu)
                LD="${LD-ld} -m elf_i386_fbsd"
                ;;
              x86_64-*linux*)
                LD="${LD-ld} -m elf_i386"
                ;;
              ppc64-*linux*|powerpc64-*linux*)
                LD="${LD-ld} -m elf32ppclinux"
                ;;
              s390x-*linux*)
                LD="${LD-ld} -m elf_s390"
                ;;
              sparc64-*linux*)
                LD="${LD-ld} -m elf32_sparc"
                ;;
            esac
            ;;
          *64-bit*)
            case $host in
              x86_64-*kfreebsd*-gnu)
                LD="${LD-ld} -m elf_x86_64_fbsd"
                ;;
              x86_64-*linux*)
                LD="${LD-ld} -m elf_x86_64"
                ;;
              powerpc64le*-*linux*)
                LD="${LD-ld} -m elf64lppc"
                ;;

              ppc*-*linux*|powerpc*-*linux*)
                LD="${LD-ld} -m elf64ppc"
                ;;
              s390*-*linux*|s390*-*tpf*)
                LD="${LD-ld} -m elf64_s390"
                ;;
              sparc*-*linux*)
                LD="${LD-ld} -m elf64_sparc"
                ;;
            esac
            ;;
        esac
  5. ./configure        --prefix=/usr/local/mysql --enable-assembler    --without-server --with-client-ldflags=-rdynamic
  6. Check that you see this line in the output: checking whether the g++ linker (/usr/bin/ld -m elf64lppc) supports shared libraries... yes
  7. make
  8. make install
  9. ls /usr/local/mysql/lib/mysql/libmysqlclient.so
    /usr/local/mysql/lib/mysql/libmysqlclient.so



     

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"HW1W1","label":"Power ->PowerLinux"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

UID

ibm16170583