Skip to content

PMIX linking error when building --enable-static --disable-shared #1281

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
jsquyres opened this issue Jan 5, 2016 · 4 comments
Closed

PMIX linking error when building --enable-static --disable-shared #1281

jsquyres opened this issue Jan 5, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@jsquyres
Copy link
Member

jsquyres commented Jan 5, 2016

When building master with --disable-shared --enable-static, it seems that a PMIX library can't be found when compiling MPI applications:

$ mpicc -g    hello_c.c   -o hello_c
/usr/bin/ld: cannot find -lpmix
collect2: error: ld returned 1 exit status
$ mpicc --showme -g hello_c.c -o hello_c
gcc -g hello_c.c -o hello_c -I/home/jsquyres/bogus/include -pthread -Wl,-rpath -Wl,/home/jsquyres/bogus/lib -Wl,--enable-new-dtags -L/home/jsquyres/bogus/lib -lmpi -lopen-rte -lopen-pal -lm -lnuma -lpciaccess -libverbs -lrdmacm -ldl -lpmix -lmunge -lutil -lrt
$ ls $bogus/lib/*pmix*
zsh: no matches found: /home/jsquyres/bogus/lib/*pmix*

I note that when I build the same way (statically) on the v2.x branch, I get a pmix library, and therefore building MPI executables succeeds:

$ ls $bogus/lib/*pmix*
/home/jsquyres/bogus/lib/libpmix.a  /home/jsquyres/bogus/lib/libpmix.la*
@jsquyres jsquyres added the bug label Jan 5, 2016
@jsquyres jsquyres added this to the v2.0.0 milestone Jan 5, 2016
@rhc54
Copy link
Contributor

rhc54 commented Jan 5, 2016

I believe you just need to remove that -lpmix from the args - does it then work?

@jsquyres
Copy link
Member Author

jsquyres commented Jan 5, 2016

Yes -- if I manually remove -lpmix from the mpicc wrapper data text file, the compilation succeeds and the application runs correctly.

Is this all that is necessary?

diff --git a/opal/mca/pmix/pmix112/configure.m4 b/opal/mca/pmix/pmix112/configur
index b03c54d..59b2950 100644 
--- a/opal/mca/pmix/pmix112/configure.m4 
+++ b/opal/mca/pmix/pmix112/configure.m4  
@@ -61,9 +61,6 @@ AC_DEFUN([MCA_opal_pmix_pmix112_CONFIG],[ 
                   AC_SUBST([opal_pmix_pmix112_LIBS]) 
                   AC_SUBST([opal_pmix_pmix112_CPPFLAGS])])  

-           # Finally, add a flag to support static builds
-           pmix_pmix112_WRAPPER_EXTRA_LIBS=-lpmix
- 
            CFLAGS=$opal_pmix_pmix112_save_CFLAGS 
            CPPFLAGS=$opal_pmix_pmix112_save_CPPFLAGS 
            LDFLAGS=$opal_pmix_pmix112_save_LDFLAGS 
diff --git a/opal/mca/pmix/pmix120/configure.m4 b/opal/mca/pmix/pmix120/configur
index c5f94af..4053632 100644 
--- a/opal/mca/pmix/pmix120/configure.m4 
+++ b/opal/mca/pmix/pmix120/configure.m4 
@@ -61,9 +61,6 @@ AC_DEFUN([MCA_opal_pmix_pmix120_CONFIG],[
                   AC_SUBST([opal_pmix_pmix120_LIBS]) 
                   AC_SUBST([opal_pmix_pmix120_CPPFLAGS])]) 

-           # Finally, add a flag to support static builds 
-           pmix_pmix120_WRAPPER_EXTRA_LIBS=-lpmix
-
            CFLAGS=$opal_pmix_pmix120_save_CFLAGS 
            CPPFLAGS=$opal_pmix_pmix120_save_CPPFLAGS 
            LDFLAGS=$opal_pmix_pmix120_save_LDFLAGS

@rhc54
Copy link
Contributor

rhc54 commented Jan 5, 2016

Should be, yes

@jsquyres
Copy link
Member Author

jsquyres commented Jan 5, 2016

Fixed via e4bdad0.

@jsquyres jsquyres closed this as completed Jan 5, 2016
jsquyres added a commit to jsquyres/ompi that referenced this issue Aug 23, 2016
btl/openib: set send flags only after endpoint is connected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants