Skip to content
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

Configure generates bogus makefile #4345

Closed
planetA opened this issue Oct 16, 2017 · 4 comments
Closed

Configure generates bogus makefile #4345

planetA opened this issue Oct 16, 2017 · 4 comments

Comments

@planetA
Copy link

planetA commented Oct 16, 2017

Background information

When I try to compile OpenMPI together with UCX, I expect the configure system to find UCX libraries. Configure script seems to find them, but fails to generate makefiles which point to the right location. This results in libtool failing to properly link the libraries.

What version of Open MPI are you using? (e.g., v1.10.3, v2.1.0, git branch name and hash, etc.)

I use ucx-1.2.1 and OpenMPI 2.1.1 downloaded from GitHub.

Describe how Open MPI was installed (e.g., from a source/distribution tarball, from a git clone, from an operating system distribution package, etc.)

When I compile OpenMPI it fails with following error message:

libtool:   error: require no space between '-L' and '-lrt'

To ease the reproducibility, I give Dockerfile to compile everything in an isolated environment.

Please describe the system on which you are running

  • Operating system/version: Debian 9 inside docker
  • Computer hardware: NA
  • Network type: NA

Details of the problem

Using this dockerfile, compilation fails

FROM Debian:9
MAINTAINER "Nobody <[email protected]>"

RUN apt-get update && \
    apt-get install -y flex git libtool build-essential gcc gfortran wget libnuma-dev autoconf automake && \
    wget https://github.com/openucx/ucx/archive/v1.2.1.tar.gz && \
    tar xvf v1.2.1.tar.gz && \
    cd ucx-1.2.1 && ./autogen.sh && ./configure && make && make install && cd .. && \
    rm -rf ucx-1.2.1 v1.2.1.tar.gz && \
    apt-get clean && apt-get purge
RUN wget https://github.com/open-mpi/ompi/archive/v2.1.1.tar.gz && \
    tar xvf v2.1.1.tar.gz && \
    cd ompi-2.1.1 && \
    ./autogen.pl && ./configure --with-ucx && make && make install && \
    cd .. && \
    rm -rf ompi-2.1.1 v2.1.1.tar.gz

Changing --with-ucx to --with-ucx=/usr results in successful compilation.

@bwbarrett
Copy link
Member

@jladd-mlnx, can you find someone from your team to look at this?

@ggouaillardet
Copy link
Contributor

@planetA can you give the inline patch a try ?

fwiw, master does things a bit differently, but bottom line, we do not need $ompi_check_ucx_extra_libs. also some more things need to be cleaned up

  • no need to check for ucx version if $ompi_check_ucx_happy=no
  • no need to handle --with-ucx_libdir is ```{"","yes","no"}
diff --git a/config/ompi_check_ucx.m4 b/config/ompi_check_ucx.m4
index 93aceeb..47002db 100644
--- a/config/ompi_check_ucx.m4
+++ b/config/ompi_check_ucx.m4
@@ -34,21 +34,17 @@ AC_DEFUN([OMPI_CHECK_UCX],[
        ompi_check_ucx_$1_save_LIBS="$LIBS"
 
        AS_IF([test "$with_ucx" != "no"],
-              [AS_IF([test ! -z "$with_ucx" && test "$with_ucx" != "yes"],
-                     [
-                        ompi_check_ucx_dir="$with_ucx"
-                        ompi_check_ucx_libdir="$with_ucx/lib"
-                     ])
-               AS_IF([test ! -z "$with_ucx_libdir" && test "$with_ucx_libdir" != "yes"],
+              [AS_IF([test -n "$with_ucx" && test "$with_ucx" != "yes"],
+                     [ompi_check_ucx_dir="$with_ucx"
+                      ompi_check_ucx_libdir="$with_ucx/lib"])
+               AS_IF([test -n "$with_ucx_libdir" && test "$with_ucx_libdir" != "yes"],
                      [ompi_check_ucx_libdir="$with_ucx_libdir"])
 
-               ompi_check_ucx_extra_libs="-L$ompi_check_ucx_libdir"
-
                OPAL_CHECK_PACKAGE([ompi_check_ucx],
                                  [ucp/api/ucp.h],
                                  [ucp],
                                  [ucp_cleanup],
-                                 [$ompi_check_ucx_extra_libs],
+                                 [],
                                  [$ompi_check_ucx_dir],
                                  [$ompi_check_ucx_libdir],
                                  [ompi_check_ucx_happy="yes"],
@@ -64,7 +60,8 @@ AC_DEFUN([OMPI_CHECK_UCX],[
        AC_MSG_CHECKING(for UCX version compatibility)
        AC_REQUIRE_CPP
        old_CPPFLAGS="$CPPFLAGS"
-       CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"
+        AS_IF([test -n "$ompi_check_ucx_dir"],
+              [CPPFLAGS="$CPPFLAGS -I$ompi_check_ucx_dir/include"])
        AC_COMPILE_IFELSE(
             [AC_LANG_PROGRAM([[#include <uct/api/version.h>]],
                             [[

@planetA
Copy link
Author

planetA commented Oct 17, 2017

@ggouaillardet compiled successfully and didn't need to add --with-ucx

@awlauria
Copy link
Contributor

Master PR: #4383

All Pr's merged, closing.

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

No branches or pull requests

4 participants