[PVFS2-CVS] commit by pcarns in pvfs2/maint/build: mpich2-build.py

CVS commit program cvs at parl.clemson.edu
Fri Mar 19 15:41:46 EST 2004


Update of /projects/cvsroot/pvfs2/maint/build
In directory parlweb:/tmp/cvs-serv15609

Added Files:
	mpich2-build.py 
Log Message:
broke out a part of some scripts written by Wes Emeneker (thanks Wes!) and
added some minor tweaks.  mpich2-build.py downloads mpich2 and builds it
with pvfs2 support (assuming that pvfs2 has already been built with
pvfs2-build.sh)


--- /dev/null	2003-01-30 05:24:37.000000000 -0500
+++ mpich2-build.py	2004-03-19 15:41:46.000000000 -0500
@@ -0,0 +1,77 @@
+#!/usr/bin/python
+# This script gets and builds MPICH2 with PVFS2 support
+
+import os,sys,string
+
+# default directory to download and build in 
+rootdir="/tmp/pvfs2-build-test/"
+
+def get_build_MPICH2():
+
+	os.chdir(rootdir)
+	if os.path.exists('mpich2-beta.tar.gz'):
+		os.remove('mpich2-beta.tar.gz')
+	if os.path.exists('mpich2-src'):
+		os.remove('mpich2-src')
+# Get MPICH2 and extract it
+	if os.system('wget -q --passive-ftp ftp://ftp.mcs.anl.gov/pub/mpi/mpich2-beta.tar.gz'):
+		print "Failed to download mpich2; Exiting..."
+		sys.exit(1)
+	os.system('tar -xzvf mpich2-beta.tar.gz >tarout')
+	os.system('ln -s `head -n1 tarout` mpich2-src')
+	os.remove('tarout')
+
+# Set the necessary variables for compiling with PVFS2 support and install it
+	OLD_CFLAGS = os.getenv("CFLAGS")
+	OLD_LDFLAGS = os.getenv("LDFLAGS")
+	OLD_LIBS = os.getenv("LIBS")
+	os.environ['CFLAGS']="-I"+pvfs2_install+"include"
+	os.environ['LDFLAGS']="-L"+pvfs2_install+"lib"
+	os.environ['LIBS']="-lpvfs2 -lpthread"
+
+	if os.path.exists(mpichdir):
+		os.system('rm -rf '+mpichdir)
+	os.mkdir(mpichdir)
+
+	os.chdir(mpichsrc)
+	if os.system('./configure --enable-romio --with-file-system=pvfs2+nfs+ufs --disable-f77 --prefix='+mpichdir+' --exec-prefix='+mpichdir+' >../mpich-configure.log 2>&1'):
+		print "MPICH2 configure failed; Exiting..."
+		print "See " + rootdir + "mpich-configure.log for details."
+		print "Perhaps you forgot to run pvfs2-build first?"
+		sys.exit(1)
+
+	if os.system('make > ../mpich-make.log 2>&1'):
+		print "See " + rootdir + "mpich-make.log for details."
+		print "MPICH2 build failed; Exiting..."
+		sys.exit(1)
+	
+	if os.system('make install > ../mpich-make-install.log 2>&1'):
+		print "MPICH2 make install failed; Exiting..."
+		print "See " + rootdir + "mpich-make-install.log for details."
+		sys.exit(1)
+	
+# UNset variables not needed anymore
+	os.environ['CFLAGS']=OLD_CFLAGS
+	os.environ['LDFLAGS']=OLD_LDFLAGS
+	os.environ['LIBS']=OLD_LIBS
+
+	return
+
+if len(sys.argv)<2:
+	print "MPICH2 will be built in default directory (/tmp/pvfs2-build-test)."
+else:
+	rootdir=sys.argv[1]+"/"
+	print "MPICH2 will be built in " + rootdir + "."
+
+pvfs2_src=rootdir+'pvfs2/'
+pvfs2_build=rootdir+'BUILD-pvfs2/'
+pvfs2_install=rootdir+'INSTALL-pvfs2/'
+mpichdir=rootdir+'mpich2/'
+mpichsrc=rootdir+'mpich2-src/'
+
+if not os.path.exists(rootdir):
+	os.mkdir(rootdir)
+
+os.chdir(rootdir)
+
+get_build_MPICH2()



More information about the PVFS2-CVS mailing list