Add hwloc to build system 43/3043/5
authorEvan Ramos <evan@hpccharm.com>
Tue, 19 Sep 2017 19:31:56 +0000 (14:31 -0500)
committerEvan Ramos <evan@hpccharm.com>
Fri, 20 Oct 2017 20:02:09 +0000 (15:02 -0500)
Co-authored-by: Steve Hoelle <steve@hpccharm.com>
Co-authored-by: Gengbin Zheng <gzheng@illinois.edu>
Change-Id: I95db11047dbb4819829d4c312ef5f351a8e6b6d3

package-tarball.sh
src/scripts/Makefile
src/scripts/Makefile.am [new file with mode: 0644]
src/scripts/charmc
src/scripts/configure.ac
src/util/charmrun-src/Makefile

index 8513b19d9246ef5f8a15f996cec1e4c65bfc3919..e96d7686e24c7af46cd4f0b7ed21edd70eb11030 100755 (executable)
@@ -40,11 +40,17 @@ SRCBASE=`pwd` ./commitid.sh
 git add -f VERSION
 rm VERSION.new
 
+# Symlink hwloc in temporarily
+ln -s ../../contrib/hwloc hwloc
+
 # Run autotools so users don't need to
 autoreconf
 autoheader
 rm -rf autom4te.cache
-git add -f configure conv-autoconfig.h.in
+git add -f aclocal.m4 configure conv-autoconfig.h.in
+
+# Remove symlink
+rm hwloc
 
 # Done with build scripts
 popd
index 7748ec9fa1834ee1a6d704b1478279d17d01f2e1..62ddc8350561a863c5c5b95955293275c0d9d2f9 100644 (file)
@@ -281,7 +281,7 @@ headers: dirs+sources
        $(MAKE) charmxi
        $(MAKE) headerlinks
 
-configure: configure.ac
+configure: Makefile.am configure.ac
        autoreconf
 
 conv-autoconfig.h.in: configure.ac
@@ -311,6 +311,7 @@ dirs+sources:
        pwd
        find . -type l -exec rm {} \;
        rm -rf QuickThreads
+       rm -rf hwloc
        rm -rf libs
        rm -rf ../bin ; mkdir ../bin
        if case `cat .vdir` in *win32*) true;; *win64*) true;; *-win-*) true;; *) false;; esac; then \
@@ -339,6 +340,7 @@ dirs+sources:
        ./gatherflat $(SRCBASE)/langs/f90charm   .
        ./gatherflat $(SRCBASE)/xlatcpm          .
        ./gathertree $(SRCBASE)/QuickThreads     QuickThreads
+       ./gathertree $(SRCBASE)/../contrib/hwloc hwloc
        ./gathertree $(SRCBASE)/libs             libs
        ./gathertree $(SRCBASE)/arch/util        .
        ./gathertree $(SRCBASE)/util             .
@@ -418,7 +420,7 @@ CVLIBS=$(L)/libconv-core.a \
        $(L)/libconv-cplus-y.a $(L)/libconv-cplus-n.a \
        $(L)/libconv-util.a $(L)/libconv-utilf.a \
        $(CLBLIBS) $(TRACELIBS) $(MEMLIBS) $(THREADLIBS) \
-       $(L)/libccs-client.a $(L)/libconv-partition.a \
+       $(L)/libccs-client.a $(L)/libconv-partition.a $(L)/libhwloc_embedded.a \
        $(L)/libconv-ldb.a
 
 LIBCONV_CORE= convcore.o conv-conds.o queueing.o msgmgr.o \
@@ -441,9 +443,24 @@ LIBCONV_UTIL=pup_util.o pup_toNetwork.o pup_toNetwork4.o           \
 
 LIBCONV_UTILF=pup_f.o
 
-converse: charmrun-target swapglobal-target conv-cpm tmgr
+converse: charmrun-target swapglobal-target conv-cpm tmgr hwloc-target
 
-charmrun-target: charmrun  sockRoutines.c sockRoutines.h ccs-server.c ccs-server.h sockRoutines-seq.o $(L)/libck.a $(CVLIBS)
+$(L)/libhwloc_embedded.a: hwloc-target
+
+cpuaffinity.o: hwloc-target
+
+hwloc-target:  conv-autoconfig.h
+       ( $(MAKE) -C hwloc )
+       ( cp -f hwloc/src/.libs/libhwloc_embedded.a $(L) )
+       ( cp -f hwloc/include/hwloc.h $(INC) )
+       ( cp -LRf hwloc/include/hwloc $(INC) )
+#      -(CHARMINC=.; . ./conv-config.sh; \
+        test -d ../lib_so && \
+        cp -f hwloc/src/.libs/libhwloc_embedded.$$CMK_SHARED_SUF ../lib_so && \
+        cp -f hwloc/src/.libs/libhwloc_embedded.$$CMK_SHARED_SUF ../lib_so/libhwloc_embedded.$$CMK_SHARED_SUF)
+       touch $@
+
+charmrun-target: hwloc-target charmrun  sockRoutines.c sockRoutines.h ccs-server.c ccs-server.h sockRoutines-seq.o $(L)/libck.a $(L)/libhwloc_embedded.a $(CVLIBS)
        if [ -f charmrun ] ; then ( cp -f charmrun ../bin ) ; fi
 
 QUICK_THREADS: $(CVHEADERS)
diff --git a/src/scripts/Makefile.am b/src/scripts/Makefile.am
new file mode 100644 (file)
index 0000000..03711aa
--- /dev/null
@@ -0,0 +1 @@
+ACLOCAL_AMFLAGS = -Ihwloc/config
index b10783d90532ab34c1619ba5f8a34157fadceee3..1dd0dc9cdcb329b7c5418f3962a9df35a9ae2038 100755 (executable)
@@ -1100,6 +1100,7 @@ then
     CMK_LDXX="$CMK_SEQ_LDXX" 
     CMK_AR="$CMK_SEQ_AR"
     CMK_RANLIB="$CMK_SEQ_RANLIB"
+    POST_LIBRARIES=`AddList $POST_LIBRARIES $CMK_HWLOC_LIBS`
 fi
 
 if [ -n "$NATIVE" ]
@@ -1954,7 +1955,7 @@ Debug "About to perform final link..."
 MAKE_LDXX="0"
 MAKE_LD="0"
 
-CORE_LIBS="-lconv-core -ltmgr -lconv-util -lconv-partition $TRACE_OBJ"
+CORE_LIBS="-lconv-core -ltmgr -lconv-util -lconv-partition $TRACE_OBJ $CMK_HWLOC_LIBS"
 
 # get TAU stub makefile variables
 if test "$CMK_WITH_TAU" = "true"
index 5bcc9090b49cc36950f7ac5e34dcaa6081b03e7f..8c0b199c12bfe72ba6d9a244b4843495e7ac16e0 100644 (file)
@@ -1,5 +1,23 @@
 
-AC_INIT(./Makefile)
+AC_INIT(Charm++, 2.6)
+AC_CONFIG_SRCDIR(./Makefile)
+
+# for hwloc
+enable_embedded_mode='yes'
+enable_static='yes'
+enable_libxml2='no'
+enable_visibility='no'
+AC_CONFIG_AUX_DIR(hwloc/config)
+AC_CANONICAL_TARGET
+AC_USE_SYSTEM_EXTENSIONS
+LT_INIT
+AS_CASE([$target_os],
+        [darwin*],
+        export MACOSX_DEPLOYMENT_TARGET='10.7'
+        export HWLOC_FLAGS='-mmacosx-version-min=10.7'
+        )
+
+AM_INIT_AUTOMAKE
 
 AC_CONFIG_HEADER(conv-autoconfig.h)
 
@@ -2418,6 +2436,15 @@ EOF
   /bin/rm -f conftest.f90
 fi
 
+# for hwloc
+AC_CONFIG_MACRO_DIR(hwloc/config)
+HWLOC_SET_SYMBOL_PREFIX([cmi_])
+HWLOC_SETUP_CORE([hwloc], [happy=yes], [happy=no])
+HWLOC_DO_AM_CONDITIONALS
+add_flag 'CMK_HWLOC_LIBS="-lhwloc_embedded '"$HWLOC_EMBEDDED_LIBS"' -lpthread"' "hwloc"
+add_flag 'OPTS_CC="$OPTS_CC '"$HWLOC_EMBEDDED_CFLAGS"'"' 'hwloc'
+add_flag 'OPTS_CXX="$OPTS_CXX '"$HWLOC_EMBEDDED_CFLAGS"'"' 'hwloc'
+
 AC_OUTPUT(
 libs/ck-libs/ampi/ampiCC,
 
index 2b4ab6ab6794501797a9c034a2d0803e543bdc04..7d74e8eb39004609e2a6941b987ac780afe83755 100644 (file)
@@ -1,5 +1,5 @@
 BIN=../../bin
-CHARMC=$(BIN)/charmc $(OPTS) -lm -I..
+CHARMC=$(BIN)/charmc $(OPTS) -lm -I.. -L../libs
 
 SHELL=/bin/sh