📄 builddll
字号:
#! /bin/sh#set -x# This script builds a stand-alone DLL for the shm channel.# It makes use of the configure scripts in the necessary components## Determine the source and build directorymypath=$0mypath=`echo $mypath | sed -e 's/builddll//'`mympich2=`(cd $mypath && cd ../../../../.. && pwd)`mybuild=`(cd ../../../../../ && pwd)`## Get the prefix, libdir, and exec_prefix, which may be needed for# setting installation directories. These may be either passed on the# command line or as environment variablesfor arg do option=`expr "x$arg" : 'x[^=]*=\(.*\)'` case $arg in --prefix=*) prefix=$option ;; --libdir=*) libdir=$option ;; --exec-prefix=*) exec_prefix=$option ;; --shlibtype=*) shlibtype=$option ;; --localdefs=*) if [ -s $option ] ; then . $option else echo "File $option was not found" exit 1 fi esacdoneBUILD_DLLS=yesexport BUILD_DLLS## Determine shared library type (only a few supported)osname=`uname -s`if [ -z "$shlibtype" ] ; then if [ -z "$CC" ] ; then shlibtype=gcc else shlibtype=$CC fi case $osname in *Darwin*|*darwin*) shlibtype="$shlibtype-osx" ;; *) ;; esacfi# Export the top_srcdir for MPICH2master_top_srcdir=$mympich2export master_top_srcdir## Temp for experimentationif [ -z "$CC_SHL" ] ; then case $shlibtype in gcc-osx|osx-gcc) CC_SHL="gcc -fPIC" C_LINK_SHL='${CC} -dynamiclib -undefined suppress -single_module -flat_namespace' SHLIB_EXT=dylib ;; *gcc*) CC_SHL="${CC} -fPIC" C_LINK_SHL='${CC} -shared' SHLIB_EXT=so ;; *) echo "Unknown shared library type in builddll" exit 1 ;; esacfiexport CC_SHLexport C_LINK_SHLexport SHLIB_EXT#MPICH2_INCLUDE_FLAGS=-I$mympich2/src/mpid/ch3/includeexport MPICH2_INCLUDE_FLAGS# The shm channel requires the lock utilities in mpid/common/locks# This directory may not exist yet (no other configure may have # created it), so we build it if necessaryif [ ! -d $mybuild/src/mpid/common/locks ] ; then mkdir $mybuild/src/mpid/common/locksfi# Note that we also need to run the setup in the locks directorylocksSetup=$mympich2/src/mpid/common/locks/setupif [ ! -f $locksSetup ] ; then echo "Cannot find $locksSetup , needed to build process locks" exit 1fi( MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/common/datatype" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/ch3/channels/shm/include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../ch3/channels/shm/include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../ch3/include" ; \export MPICH2_INCLUDE_FLAGS ; \CPPFLAGS="$CPPFLAGS -DUSE_PROCESS_LOCKS" ; export CPPFLAGS ; \ . $locksSetup ; \cd $mybuild/src/mpid/common/locks && \ $mympich2/src/mpid/common/locks/configure --enable-sharedlibs=$shlibtype \ --prefix=$prefix --libdir=$libdir --exec-prefix=$exec_prefix )if [ $? != 0 ] ; then echo "Aborting build because mpi/common/locks/configure failed" echo "See $mybuild/src/mpid/common/locks/config.log for more information" exit 1fi( MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/common/datatype" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../../include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/ch3/channels/shm/include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../../../common/locks" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/common/locks" ; \export MPICH2_INCLUDE_FLAGS ; \ $mypath/configure --enable-sharedlibs=$shlibtype \ --prefix=$prefix --libdir=$libdir --exec-prefix=$exec_prefix )## Make the channel library and update the channel dll(cd src && make clean && rm -f libmpich2-ch3-shm.la && \ make libmpich2-ch3-shm.la )rc=$?if [ $rc != 0 ] ; then echo "make step failed in ch3/channels/shm/src" exit $rcfirm -f *.loar x src/libmpich2-ch3-shm.laar cr libmpich2-ch3-shm.la *.lorm -f *.lo## Build the locks support code and link it into the ch3-shm dll(cd $mybuild/src/mpid/common/locks && make clean && \ rm -f libmpich2locks.la && make libmpich2locks.la)rc=$?if [ $rc != 0 ] ; then echo "make step failed in common/locks" exit $rcfimkdir .tmpcd .tmprm -f *.loar x $mybuild/src/mpid/common/locks/libmpich2locks.laar cr ../libmpich2-ch3-shm.la *.locd ..rm -rf .tmp## Build the ch3 shmbase support code and link it into the ch3-shm dll## Build the ch3 shmbase support code and link it into the ch3-sock dllif [ ! -d ../util ] ; then mkdir ../utilfiif [ ! -d ../../util/shmbase ] ; then mkdir ../../util/shmbasefi(\MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../channels/shm/include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/ch3/channels/shm/include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/ch3/include" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/common/datatype" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I../../../common/locks" ; \MPICH2_INCLUDE_FLAGS="$MPICH2_INCLUDE_FLAGS -I$mympich2/src/mpid/common/locks" ; \cd ../../util/shmbase && \ $mympich2/src/mpid/ch3/util/shmbase/configure \ --enable-sharedlibs=$shlibtype \ --prefix=$prefix --libdir=$libdir --exec-prefix=$exec_prefix )(cd ../../util/shmbase && make clean && rm -f libmpich-shmutil.la && \ make libmpich-shmutil.la)rc=$?if [ $rc != 0 ] ; then echo "make step failed in util/shmbase" exit $rcfimkdir .tmpcd .tmprm -f *.loar x ../../../util/shmbase/libmpich-shmutil.laar cr ../libmpich2-ch3-shm.la *.locd ..rm -rf .tmp## Now, create the dynamically-loadable libraryrm -f libmpich2-ch3-shm*.dylib libmpich2-ch3-shm*.so$mybuild/src/util/createshlib -echo --mode=link -version-info "1:1" \ -clink="$C_LINK_SHL" -cc=gcc -libtype=$shlibtype \ -o libmpich2-ch3-shm.la -rpath `pwd`rc=$?if [ $rc != 0 ] ; then echo "Createshlib step failed for shm channel" exit $rcfi# Note that when this directory is installed, it needs to be rebuilt with # a different rpath.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -