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

Hotfix: various build system fixes to support CI #52

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,22 @@ PKG_CHECK_MODULES([UCX],
if test "x$enable_ucx" = "xyes" && test "x$pkg_check_ucx_found" = "xno"; then
AC_MSG_ERROR([requested UCX support, but cannot find UCX with pkg-config])
fi
PKG_CHECK_VAR([UCX_LIBDIR],
[ucx >= 1.6.0],
[libdir],
[],
[AC_MSG_FAILURE([Could not find libdir for UCX])]
)
AS_IF([test "x$UCX_LIBDIR" = "x"],
[AC_MSG_FAILURE([check_var succeeded, but value is incorrect])]
)
AS_IF([test "x$enable_ucx" = "xyes"],
[DYAD_MOD_RPATH="-Wl,-rpath,$UCX_LIBDIR"],
[DYAD_MOD_RPATH=""]
)
AC_SUBST([DYAD_MOD_RPATH])
if test "x$enable_ucx" = "xyes"; then
PKG_CHECK_VAR([UCX_LIBDIR],
[ucx >= 1.6.0],
[libdir],
[],
[AC_MSG_FAILURE([Could not find libdir for UCX])]
)
AS_IF([test "x$UCX_LIBDIR" = "x"],
[AC_MSG_FAILURE([check_var succeeded, but value is incorrect])]
)
AS_IF([test "x$enable_ucx" = "xyes"],
[DYAD_MOD_RPATH="-Wl,-rpath,$UCX_LIBDIR"],
[DYAD_MOD_RPATH=""]
)
AC_SUBST([DYAD_MOD_RPATH])
fi

###########################
# Checks for header files #
Expand Down
2 changes: 1 addition & 1 deletion src/dtl/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ libdyad_dtl_la_SOURCES += \
ucx_dtl.c \
ucx_dtl.h
libdyad_dtl_la_LIBADD += $(UCX_LIBS)
libdyad_dtl_la_CFLAGS += $(UCX_CFLAGS)
libdyad_dtl_la_CFLAGS += $(UCX_CFLAGS) -DDYAD_ENABLE_UCX=1
endif

include_HEADERS = dyad_rc.h dyad_flux_log.h dyad_dtl.h
46 changes: 34 additions & 12 deletions src/dtl/dyad_dtl_impl.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#include "dyad_dtl_impl.h"

#include "flux_dtl.h"

#if DYAD_ENABLE_UCX
#include "ucx_dtl.h"
#endif

dyad_rc_t dyad_dtl_init (dyad_dtl_t **dtl_handle,
dyad_dtl_mode_t mode,
Expand All @@ -11,52 +14,71 @@ dyad_rc_t dyad_dtl_init (dyad_dtl_t **dtl_handle,
dyad_rc_t rc = DYAD_RC_OK;
*dtl_handle = malloc (sizeof (struct dyad_dtl));
if (*dtl_handle == NULL) {
return DYAD_RC_SYSFAIL;
rc = DYAD_RC_SYSFAIL;
goto dtl_init_done;
}
(*dtl_handle)->mode = mode;
#if DYAD_ENABLE_UCX
if (mode == DYAD_DTL_UCX) {
rc = dyad_dtl_ucx_init (*dtl_handle, mode, h, debug);
if (DYAD_IS_ERROR (rc)) {
return rc;
goto dtl_init_done;
}
return DYAD_RC_OK;
} else if (mode == DYAD_DTL_FLUX_RPC) {
#else
if (mode == DYAD_DTL_FLUX_RPC) {
#endif
rc = dyad_dtl_flux_init (*dtl_handle, mode, h, debug);
if (DYAD_IS_ERROR (rc)) {
return rc;
goto dtl_init_done;
}
return DYAD_RC_OK;
} else {
rc = DYAD_RC_BADDTLMODE;
goto dtl_init_done;
}
return DYAD_RC_BADDTLMODE;
rc = DYAD_RC_OK;

dtl_init_done:
return rc;
}

dyad_rc_t dyad_dtl_finalize (dyad_dtl_t **dtl_handle)
{
dyad_rc_t rc = DYAD_RC_OK;
if (dtl_handle == NULL || *dtl_handle == NULL)
if (dtl_handle == NULL || *dtl_handle == NULL) {
// We should only reach this line if the user has passed
// in an already-finalized DTL handle. In that case,
// this function should be treated as a no-op, and we
// should return DYAD_RC_OK to indicate no error has occured
return DYAD_RC_OK;
rc = DYAD_RC_OK;
goto dtl_finalize_done;
}
#if DYAD_ENABLE_UCX
if ((*dtl_handle)->mode == DYAD_DTL_UCX) {
if ((*dtl_handle)->private.ucx_dtl_handle != NULL) {
rc = dyad_dtl_ucx_finalize (dtl_handle);
if (DYAD_IS_ERROR (rc)) {
return rc;
goto dtl_finalize_done;
}
}
} else if ((*dtl_handle)->mode == DYAD_DTL_FLUX_RPC) {
#else
if ((*dtl_handle)->mode == DYAD_DTL_FLUX_RPC) {
#endif
if ((*dtl_handle)->private.flux_dtl_handle != NULL) {
rc = dyad_dtl_flux_finalize (dtl_handle);
if (DYAD_IS_ERROR (rc)) {
return rc;
goto dtl_finalize_done;
}
}
} else {
return DYAD_RC_BADDTLMODE;
rc = DYAD_RC_BADDTLMODE;
goto dtl_finalize_done;
}
rc = DYAD_RC_OK;

dtl_finalize_done:
free (*dtl_handle);
*dtl_handle = NULL;
return DYAD_RC_OK;
return rc;
}
1 change: 0 additions & 1 deletion src/stream/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ lib_LTLIBRARIES = libdyad_fstream.la

libdyad_fstream_la_SOURCES = dyad_stream_core.cpp
libdyad_fstream_la_LDFLAGS = \
-Wl,-rpath,'$(UCX_LIBDIR)' \
$(AM_LDFLAGS) \
-avoid-version \
-no-undefined
Expand Down
1 change: 0 additions & 1 deletion src/wrapper/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
lib_LTLIBRARIES = dyad_wrapper.la
dyad_wrapper_la_SOURCES = wrapper.c
dyad_wrapper_la_LDFLAGS = \
-Wl,-rpath,'$(UCX_LIBDIR)' \
$(AM_LDFLAGS) \
-module \
-avoid-version \
Expand Down
Loading