Skip to content

configury: add the --enable-static-runtime option #829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

ggouaillardet
Copy link
Contributor

with this option, static libraries are forced to be built, and
orted is linked with the --static libtool flag.
This is enough so orted does not need the intel compiler runtime
dynamic libraries when compiled with icc.

with this option, static libraries are forced to be built, and
orted is linked with the --static libtool flag.
This is enough so orted does not need the intel compiler runtime
dynamic libraries when compiled with icc.
@ggouaillardet
Copy link
Contributor Author

Refs #818
that works for me with intel compiler, note i did not even need to pass the -static-intel flag when linking orted
note that if ompi if configure'd with --disable-static --enable-static-runtime, static libs are built and no warning is issued.
@gpaulsen can you please review this ?

@jsquyres
Copy link
Member

I'm not a big fan of --enable-static-runtime silently enabling --enable-static. At a bare minimum, I should think you should print a big warning that this is happening. My $0.02:

  • --enable-static-runtime should enable/disable the Libtool --static flag when building orted
  • If --enable-static-runtime is set but --enable-static is not set, emit a large warning saying "This might not do what you want..." But this should only be a warning, because what most people really want is static dependent library linking (e.g., the Intel runtime static libraries), not necessarily static libopen-rte.a and friends.

@ggouaillardet
Copy link
Contributor Author

if we use --enable-static-runtime and without --enable-static, orted is linked with libopen-pal.so and libopen-rte.so which do depend on the intel runtime, so we do not end up with the expected result.

a better option could be to build libopen-pal.a and libopen-rte.a but install them only if --enable-static was used at configure time.
/* right now, i do not know how that can be easily achieved from an autotool point of view */

fwiw, here is the ldd output of orted when configure'd with --enable-static-runtime (that implies --enable-static in this PR)

$ ldd bin/orted 
    linux-vdso.so.1 =>  (0x00007fffa19dc000)
    libtorque.so.2 => /usr/lib64/libtorque.so.2 (0x0000003790e00000)
    libxml2.so.2 => /usr/lib64/libxml2.so.2 (0x0000003790a00000)
    libz.so.1 => /lib64/libz.so.1 (0x000000378fa00000)
    libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x0000003790200000)
    libssl.so.10 => /usr/lib64/libssl.so.10 (0x0000003790600000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003c62000000)
    librdmacm.so.1 => /usr/lib64/librdmacm.so.1 (0x0000003700a00000)
    libosmcomp.so.3 => /usr/lib64/libosmcomp.so.3 (0x0000003700200000)
    libibverbs.so.1 => /usr/lib64/libibverbs.so.1 (0x00007f568a415000)
    libm.so.6 => /lib64/libm.so.6 (0x0000003c62400000)
    libdl.so.2 => /lib64/libdl.so.2 (0x0000003c61800000)
    librt.so.1 => /lib64/librt.so.1 (0x0000003c62c00000)
    libutil.so.1 => /lib64/libutil.so.1 (0x0000003c71800000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003c65c00000)
    libc.so.6 => /lib64/libc.so.6 (0x0000003c61c00000)
    libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x0000003c6ac00000)
    libkrb5.so.3 => /lib64/libkrb5.so.3 (0x0000003c69c00000)
    libcom_err.so.2 => /lib64/libcom_err.so.2 (0x0000003c68c00000)
    libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x0000003c69400000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003c61400000)
    libibumad.so.3 => /usr/lib64/libibumad.so.3 (0x0000003700600000)
    libwrap.so.0 => /lib64/libwrap.so.0 (0x0000003c6a000000)
    libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x0000003c6a800000)
    libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f568a20d000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x0000003c63800000)
    libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003c72000000)
    libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003c63400000)

surprisingly, some libs (such as libutil) are dynamic, even if static version are available

$ ls -l /usr/lib64/libutil*   
-rw-r--r--  1 root root 13632 Dec  7  2011 /usr/lib64/libutil.a
lrwxrwxrwx. 1 root root    24 Dec  5  2012 /usr/lib64/libutil.so -> ../../lib64/libutil.so.1

so passing the libtool --static flag when linking orted do not really generate a statically linked binary

@ggouaillardet
Copy link
Contributor Author

in the case of the intel compiler, it seems the runtime might not even be necessary.
it seems the -static-intel flag is some how intercepted by the libtool wrapper, but it is possible to pass -Wc,-static-intel instead.
i was able to build an orted not depending on the intel runtime (and without --enable-static nor --disable-dlopen) by configuring with
CFLAGS=-Wc,-static-intel LDFLAGS=-Wc,-static-intel

@jsquyres
Copy link
Member

I wonder if this is turning into a FAQ item rather than an autotools solution...?

I.e., should we just add @ggouaillardet's trick of CFLAGS=-Wc,-static-intel LDFLAGS=-Wc,-static-intel to the FAQ? (is the CFLAGS really necessary, or just the LDFLAGS?)

@ggouaillardet
Copy link
Contributor Author

I will double check this tomorrow

@ggouaillardet
Copy link
Contributor Author

indeed, only LDFLAGS=-Wc,-static-intel is enough to achieve the expected result.
fwiw, only libmpi_usempif08.so requires the intel runtime.

@jsquyres
Copy link
Member

To close out this PR: we decided to make this an FAQ item and leave autogen/configure alone. The FAQ item has been added, so I'm closing this PR (and #818).

@jsquyres jsquyres closed this Oct 22, 2015
jsquyres added a commit to jsquyres/ompi that referenced this pull request Aug 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants