[cig-commits] r5637 - in short/3D/PyLith/branches/pylith-0.8: . pylith3d pylith3d/applications pylith3d/module

leif at geodynamics.org leif at geodynamics.org
Thu Jan 4 17:15:47 PST 2007


Author: leif
Date: 2007-01-04 17:15:46 -0800 (Thu, 04 Jan 2007)
New Revision: 5637

Added:
   short/3D/PyLith/branches/pylith-0.8/setup.py
Modified:
   short/3D/PyLith/branches/pylith-0.8/
   short/3D/PyLith/branches/pylith-0.8/Makefile.am
   short/3D/PyLith/branches/pylith-0.8/configure.ac
   short/3D/PyLith/branches/pylith-0.8/pylith3d/Makefile.am
   short/3D/PyLith/branches/pylith-0.8/pylith3d/applications/pylith3dapp.py
   short/3D/PyLith/branches/pylith-0.8/pylith3d/module/Makefile.am
Log:
Transitioned PyLith v0.8 to the egg-based "CIG Edition"
of Pythia.



Property changes on: short/3D/PyLith/branches/pylith-0.8
___________________________________________________________________
Name: svn:externals
   - m4	http://geodynamics.org/svn/cig/cs/autoconf/trunk

   + m4	        http://geodynamics.org/svn/cig/cs/autoconf/trunk
archimedes  http://geodynamics.org/svn/cig/cs/merlin/branches/v1/merlin/archimedes


Modified: short/3D/PyLith/branches/pylith-0.8/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/Makefile.am	2007-01-05 00:06:11 UTC (rev 5636)
+++ short/3D/PyLith/branches/pylith-0.8/Makefile.am	2007-01-05 01:15:46 UTC (rev 5637)
@@ -5,4 +5,10 @@
 
 SUBDIRS = pylith3d
 
+install-data-hook:
+	top_builddir=`$(am__cd) $(top_builddir) && pwd` && \
+		cd $(top_srcdir) && \
+		$(PYTHON) setup.py install_deps -H None -f $$top_builddir/deps --prefix=$(prefix) && \
+		$(PYTHON) setup.py egg_info -e $(pythondir)
+
 ## end of Makefile.am

Modified: short/3D/PyLith/branches/pylith-0.8/configure.ac
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/configure.ac	2007-01-05 00:06:11 UTC (rev 5636)
+++ short/3D/PyLith/branches/pylith-0.8/configure.ac	2007-01-05 01:15:46 UTC (rev 5637)
@@ -3,7 +3,7 @@
 # $Id: configure.ac,v 1.1 2005/08/24 22:45:51 leif Exp $
 
 AC_PREREQ(2.59)
-AC_INIT([PyLith3D], [0.8.1], [cig-short at geodynamics.org])
+AC_INIT([PyLith3D], [0.8.2], [cig-short at geodynamics.org])
 AC_CONFIG_AUX_DIR([./aux-config])
 AC_CONFIG_SRCDIR([pylith3d/applications/pylith3dapp.py])
 AC_CONFIG_HEADER([portinfo])
@@ -28,9 +28,46 @@
     [enable_greensfns=no])
 AM_CONDITIONAL([ENABLE_GREENSFNS], [test "$enable_greensfns" = yes])
 
-# Checks for programs.
+# Check for Python.
 AM_PATH_PYTHON([2.3])
 CIT_PYTHON_SYSCONFIG
+
+# Checks for Python modules and packages.
+
+builddir=`pwd`
+save_PYTHONPATH="$PYTHONPATH"
+PYTHONPATH="$builddir/python:$PYTHONPATH"; export PYTHONPATH
+cd $srcdir
+
+AC_MSG_NOTICE([downloading missing Python dependencies])
+AS_IF([AC_TRY_COMMAND([$PYTHON setup.py install_deps -zmxd $builddir/deps >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])],
+      [],
+      [AC_MSG_FAILURE([cannot download missing Python dependencies])])
+
+AC_MSG_NOTICE([building Python dependencies])
+AS_IF([AC_TRY_COMMAND([$PYTHON setup.py develop -H None -f $builddir/deps -x -d $builddir/python >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])],
+      [],
+      [AC_MSG_FAILURE([building Python dependencies])])
+
+AC_MSG_CHECKING([for egg-related flags])
+AS_IF([AC_TRY_COMMAND([$PYTHON setup.py egg_flags >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])],
+      [AC_MSG_RESULT(ok)
+       . egg-flags.sh
+       rm -f egg-flags.sh
+      ],
+      [AC_MSG_RESULT(failed)
+      AC_MSG_FAILURE([cannot scan Python eggs for flags])])
+
+cd $builddir
+PYTHONPATH="$save_PYTHONPATH"
+PYTHONPATH="${pythondir}:${pyexecdir}${save_PYTHONPATH:+:${save_PYTHONPATH}}"
+
+AC_SUBST(PYTHONPATH)
+AC_SUBST(PYTHON_EGG_CFLAGS)
+AC_SUBST(PYTHON_EGG_CPPFLAGS)
+AC_SUBST(PYTHON_EGG_LDFLAGS)
+
+# Checks for programs.
 CIT_PATH_PETSC([2.3])
 CIT_PROG_MPICXX
 # this is not portable
@@ -50,11 +87,6 @@
 AC_FC_WRAPPERS
 AC_PROG_LIBTOOL
 
-# Checks for Python modules and packages.
-CIT_PATH_PYTHIA([0.8])
-PYTHONPATH="${pyexecdir}${PYTHONPATH:+:${PYTHONPATH}}"; export PYTHONPATH
-AC_SUBST([PYTHONPATH])
-
 # Set the language for MPI tests.
 AC_LANG(C++)
 

Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/Makefile.am	2007-01-05 00:06:11 UTC (rev 5636)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/Makefile.am	2007-01-05 01:15:46 UTC (rev 5637)
@@ -40,10 +40,10 @@
 	$(CXXLINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
 		$(pypylith3d_LDFLAGS) $(pypylith3d_OBJECTS) $(pypylith3d_LDADD) \
 		$(PYTHON_BLDLIBRARY) \
+		$(PYTHON_EGG_LDFLAGS) \
 		$(PETSC_FORTRAN_LIB) $(PETSC_LIB) \
 		$(MPILIBS) \
 		$(FCLIBS) \
-		-ljournal \
 		$(PYTHON_LIBS) $(PYTHON_MODLIBS) $(PYTHON_SYSLIBS) \
 		$(LIBS) \
 		$(PYTHON_LDLAST)

Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/applications/pylith3dapp.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/applications/pylith3dapp.py	2007-01-05 00:06:11 UTC (rev 5636)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/applications/pylith3dapp.py	2007-01-05 01:15:46 UTC (rev 5637)
@@ -31,17 +31,21 @@
 # 
 
 
+__requires__ = "PyLith"
+
 # main
 
 if __name__ == "__main__":
     
     # re-create the PYTHONPATH at 'configure' time
-    import sys
+    import os.path, sys, site
     path = '@PYTHONPATH@'.split(':')
     path.reverse()
-    for dir in path:
-        if dir:
-            sys.path.insert(1, dir)
+    for directory in path:
+        if directory:
+            directory = os.path.abspath(directory)
+            sys.path.insert(1, directory)
+            site.addsitedir(directory)
 
     # if we are embedding, insert the extension module in the
     # 'pylith3d' package
@@ -52,9 +56,8 @@
         pass
     
     from pylith3d.Application import Application
-
-    app = Application()
-    app.run()
+    from pyre.applications import start
+    start(applicationClass=Application)
     
 
 # version

Modified: short/3D/PyLith/branches/pylith-0.8/pylith3d/module/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/pylith3d/module/Makefile.am	2007-01-05 00:06:11 UTC (rev 5636)
+++ short/3D/PyLith/branches/pylith-0.8/pylith3d/module/Makefile.am	2007-01-05 01:15:46 UTC (rev 5637)
@@ -21,14 +21,14 @@
 pylith3dmodule_la_LDFLAGS = -module
 pylith3dmodule_la_LIBADD = \
 	$(top_builddir)/pylith3d/libpylith3d/libpylith3d.la \
+	$(PYTHON_EGG_LDFLAGS) \
 	$(PETSC_LIB) \
-	$(FCLIBS) \
-	-ljournal
+	$(FCLIBS)
 
 CXX = $(MPICXX)
 CXXLD = @CXX@
 INCLUDES = $(PETSC_INCLUDE) -I$(PYTHON_INCDIR) $(MPIINCLUDES)
-AM_CPPFLAGS = $(PETSC_SIEVE_FLAGS)
+AM_CPPFLAGS = $(PYTHON_EGG_CPPFLAGS) $(PETSC_SIEVE_FLAGS)
 sources = \
 	array.cc \
 	array.h \

Added: short/3D/PyLith/branches/pylith-0.8/setup.py
===================================================================
--- short/3D/PyLith/branches/pylith-0.8/setup.py	2007-01-05 00:06:11 UTC (rev 5636)
+++ short/3D/PyLith/branches/pylith-0.8/setup.py	2007-01-05 01:15:46 UTC (rev 5637)
@@ -0,0 +1,27 @@
+
+from archimedes import use_merlin
+use_merlin()
+
+from merlin import setup, find_packages
+
+setup(
+    
+    name = 'PyLith', 
+    version = '0.8.2',
+
+    zip_safe = False,
+    packages = find_packages(),
+    
+    install_requires = [
+    'pythia[mpi] >= 0.8.1.0, < 0.8.2a',
+    #'numpy',
+    #'mercurial',
+    ],
+
+    author = 'Charles A. Williams, Brad Aagaard, and Matt Knepley',
+    author_email = 'cig-short at geodynamics.org',
+    description = """A finite element code for the solution of visco-elastic/plastic deformation that was designed for lithospheric modeling problems.""",
+    license = 'other',
+    url = 'http://www.geodynamics.org/cig/software/packages/short/pylith/',
+
+)



More information about the cig-commits mailing list