Update configure scripts for ccp integration

master
EunYoung Jeong 2019-05-27 23:12:18 +09:00
parent dff2c4636f
commit 835563dbba
6 changed files with 75 additions and 19 deletions

View File

@ -44,7 +44,7 @@ endif
ifeq ($(DPDK),1) ifeq ($(DPDK),1)
DPDK_MACHINE_LINKER_FLAGS=$${RTE_SDK}/$${RTE_TARGET}/lib/ldflags.txt DPDK_MACHINE_LINKER_FLAGS=$${RTE_SDK}/$${RTE_TARGET}/lib/ldflags.txt
DPDK_MACHINE_LDFLAGS=$(shell cat ${DPDK_MACHINE_LINKER_FLAGS}) DPDK_MACHINE_LDFLAGS=$(shell cat ${DPDK_MACHINE_LINKER_FLAGS})
LIBS += -g -O3 -pthread -lrt -march=native ${MTCP_FLD}/lib/libmtcp.a -lnuma -lmtcp -lpthread -lrt -ldl -lgmp -L${RTE_SDK}/${RTE_TARGET}/lib ${DPDK_MACHINE_LDFLAGS} -lstartccp LIBS += -g -O3 -pthread -lrt -march=native ${MTCP_FLD}/lib/libmtcp.a -lnuma -lmtcp -lpthread -lrt -ldl -lgmp -L${RTE_SDK}/${RTE_TARGET}/lib ${DPDK_MACHINE_LDFLAGS}
endif endif
# onvm-specific variables # onvm-specific variables
@ -71,7 +71,7 @@ endif
ifeq ($(CCP), 1) ifeq ($(CCP), 1)
# LIBCCP # LIBCCP
LIBCCP=${MTCP_FLD}/src/libccp LIBCCP=${MTCP_FLD}/src/libccp
LIBS += -L$(LIBCCP) -lccp LIBS += -L$(LIBCCP) -lccp -lstartccp
INC += -I$(LIBCCP) INC += -I$(LIBCCP)
endif endif

View File

@ -44,7 +44,7 @@ endif
ifeq ($(DPDK),1) ifeq ($(DPDK),1)
DPDK_MACHINE_LINKER_FLAGS=$${RTE_SDK}/$${RTE_TARGET}/lib/ldflags.txt DPDK_MACHINE_LINKER_FLAGS=$${RTE_SDK}/$${RTE_TARGET}/lib/ldflags.txt
DPDK_MACHINE_LDFLAGS=$(shell cat ${DPDK_MACHINE_LINKER_FLAGS}) DPDK_MACHINE_LDFLAGS=$(shell cat ${DPDK_MACHINE_LINKER_FLAGS})
LIBS += -g -O3 -pthread -lrt -march=native ${MTCP_FLD}/lib/libmtcp.a -lnuma -lmtcp -lpthread -lrt -ldl -lgmp -L${RTE_SDK}/${RTE_TARGET}/lib ${DPDK_MACHINE_LDFLAGS} -lstartccp LIBS += -g -O3 -pthread -lrt -march=native ${MTCP_FLD}/lib/libmtcp.a -lnuma -lmtcp -lpthread -lrt -ldl -lgmp -L${RTE_SDK}/${RTE_TARGET}/lib ${DPDK_MACHINE_LDFLAGS}
endif endif
# onvm-specific variables # onvm-specific variables
@ -69,7 +69,7 @@ endif
ifeq ($(CCP), 1) ifeq ($(CCP), 1)
# LIBCCP # LIBCCP
LIBCCP=${MTCP_FLD}/src/libccp LIBCCP=${MTCP_FLD}/src/libccp
LIBS += -L$(LIBCCP) -lccp LIBS += -L$(LIBCCP) -lccp -lstartccp
INC += -I$(LIBCCP) INC += -I$(LIBCCP)
endif endif

50
configure vendored
View File

@ -4484,7 +4484,7 @@ if test "${enable_ccp+set}" = set; then :
fi fi
if test "x$enable_lro" = "xyes" if test "x$enable_ccp" = "xyes"
then then
CCP=1 CCP=1
@ -4550,6 +4550,54 @@ then
as_fn_error $? "Packet I/O library is missing. Please set either dpdk or psio or netmap as your I/O lib." "$LINENO" 5 as_fn_error $? "Packet I/O library is missing. Please set either dpdk or psio or netmap as your I/O lib." "$LINENO" 5
fi fi
if test "x$enable_ccp" = "xyes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libstartccp_run_forever in -lstartccp" >&5
$as_echo_n "checking for libstartccp_run_forever in -lstartccp... " >&6; }
if ${ac_cv_lib_startccp_libstartccp_run_forever+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lstartccp $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char libstartccp_run_forever ();
int
main ()
{
return libstartccp_run_forever ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_startccp_libstartccp_run_forever=yes
else
ac_cv_lib_startccp_libstartccp_run_forever=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_startccp_libstartccp_run_forever" >&5
$as_echo "$ac_cv_lib_startccp_libstartccp_run_forever" >&6; }
if test "x$ac_cv_lib_startccp_libstartccp_run_forever" = xyes; then :
echo "Found CCP library"
else
as_fn_error $? "CCP library is missing. Please see README.md for instructions." "$LINENO" 5
fi
fi
am__api_version='1.15' am__api_version='1.15'
# Find a good install program. We prefer a C program (faster), # Find a good install program. We prefer a C program (faster),

View File

@ -110,7 +110,7 @@ dnl Example of default-disabled feature
AC_ARG_ENABLE([ccp], AC_ARG_ENABLE([ccp],
AS_HELP_STRING([--enable-ccp], [Enable Congestion Control Plane (CCP)])) AS_HELP_STRING([--enable-ccp], [Enable Congestion Control Plane (CCP)]))
if test "x$enable_lro" = "xyes" if test "x$enable_ccp" = "xyes"
then then
AC_SUBST(CCP, 1) AC_SUBST(CCP, 1)
fi fi
@ -153,9 +153,12 @@ then
AC_MSG_ERROR([Packet I/O library is missing. Please set either dpdk or psio or netmap as your I/O lib.]) AC_MSG_ERROR([Packet I/O library is missing. Please set either dpdk or psio or netmap as your I/O lib.])
fi fi
AC_CHECK_LIB(startccp, libstartccp_run_forever, [echo "Found CCP library"], [ if test "x$enable_ccp" = "xyes"
AC_MSG_ERROR(CCP library is missing. Please see X for instructions.) then
]) AC_CHECK_LIB(startccp, libstartccp_run_forever, [echo "Found CCP library"], [
AC_MSG_ERROR(CCP library is missing. Please see README.md for instructions.)
])
fi
AM_INIT_AUTOMAKE(mtcp, 3) AM_INIT_AUTOMAKE(mtcp, 3)
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# install - install a program, script, or datafile # install - install a program, script, or datafile
scriptversion=2013-12-25.23; # UTC scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was # This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the # later released in X11R6 (xc/config/util/install.sh) with the
@ -324,34 +324,41 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0. # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;; ;;
*) *)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask && if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 $mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then then
if test -z "$dir_arg" || { if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m. # Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't. # other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"` test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;; d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;; d????-?--*) different_mode=755;;
*) false;; *) false;;
esac && esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && { $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"` ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
} }
} }
then posix_mkdir=: then posix_mkdir=:
fi fi
rmdir "$tmpdir/d" "$tmpdir" rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else else
# Remove any dirs left behind by ancient mkdir implementations. # Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi fi
trap '' 0;; trap '' 0;;
esac;; esac;;

View File

@ -1568,8 +1568,6 @@ mtcp_init(const char *config_file)
int i; int i;
int ret; int ret;
fprintf(stderr, "hello from mtcp_init\n");
/* getting cpu and NIC */ /* getting cpu and NIC */
/* set to max cpus only if user has not arbitrarily set it to lower # */ /* set to max cpus only if user has not arbitrarily set it to lower # */
num_cpus = (CONFIG.num_cores == 0) ? GetNumCPUs() : CONFIG.num_cores; num_cpus = (CONFIG.num_cores == 0) ? GetNumCPUs() : CONFIG.num_cores;