[cig-commits] r5302 - in mc/3D/CitcomS/trunk: . bin
leif at geodynamics.org
leif at geodynamics.org
Thu Nov 16 06:40:42 PST 2006
Author: leif
Date: 2006-11-16 06:40:41 -0800 (Thu, 16 Nov 2006)
New Revision: 5302
Added:
mc/3D/CitcomS/trunk/bin/
mc/3D/CitcomS/trunk/bin/Citcom.c
mc/3D/CitcomS/trunk/bin/CitcomSFull.c
mc/3D/CitcomS/trunk/bin/CitcomSRegional.c
mc/3D/CitcomS/trunk/bin/Makefile.am
mc/3D/CitcomS/trunk/bin/citcoms.in
mc/3D/CitcomS/trunk/bin/pycitcoms.c
Removed:
mc/3D/CitcomS/trunk/Citcom.c
mc/3D/CitcomS/trunk/CitcomSFull.c
mc/3D/CitcomS/trunk/CitcomSRegional.c
mc/3D/CitcomS/trunk/citcoms.in
mc/3D/CitcomS/trunk/pycitcoms.c
Modified:
mc/3D/CitcomS/trunk/Makefile.am
mc/3D/CitcomS/trunk/configure.ac
Log:
Re-created 'bin' subdirectory to avoid filename conflict on case-sensitive
filesystems (Mac, Windows): "CitcomS" == "citcoms".
Fixed egg-related bugs which prevented 'configure' from succeeding when
buildir != srcdir (another BuildBot test vector).
Call addsitedir() in the 'citcoms' script. I guess this is now necessary
since "site.py" is no longer in the same directory as "citcoms". (*)
Note that there is currently a bug in Merlin which prevents 'citcoms' from
running ("No module named pkg_resources"). The work-around is to manually
add the merlin egg to the merlin-install.pth file.
There are more bugs which prevent running on Mac OS X at all (still
investigating).
(*) I'm becoming annoyed with setuptools' use of .pth files as a
sys.path/PYTHONPATH persistence mechanism, mainly because of the accompanying
hacks which are used to turn ordinary directories into "site" directories
(i.e., directories where .pth files work) -- these ugly, confusing hacks include
the fake site.py, "virtual python", etc. I think Merlin will only use .pth
files in real site directories. It will use clear, straitforward, direct
sys.path manipulation everywhere else.
Deleted: mc/3D/CitcomS/trunk/Citcom.c
===================================================================
--- mc/3D/CitcomS/trunk/Citcom.c 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/Citcom.c 2006-11-16 14:40:41 UTC (rev 5302)
@@ -1,201 +0,0 @@
-/*
- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *<LicenseText>
- *
- * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
- * Clint Conrad, Michael Gurnis, and Eun-seo Choi.
- * Copyright (C) 1994-2005, California Institute of Technology.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *</LicenseText>
- *
- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-#include <mpi.h>
-
-#include <math.h>
-#include <sys/types.h>
-
-#include "element_definitions.h"
-#include "global_defs.h"
-#include "citcom_init.h"
-#include "output.h"
-#include "parallel_related.h"
-
-extern int Emergency_stop;
-
-void solver_init(struct All_variables *E);
-
-int main(argc,argv)
- int argc;
- char **argv;
-
-{ /* Functions called by main*/
- void general_stokes_solver();
- void general_stokes_solver_pseudo_surf();
- void read_instructions();
- void solve_constrained_flow();
- void solve_derived_velocities();
- void process_temp_field();
- void post_processing();
- void vcopy();
- void construct_mat_group();
- void read_velocity_boundary_from_file();
- void read_mat_from_file();
- void open_time();
- void output_finalize();
-
- float dot();
- float cpu_time_on_vp_it;
-
- int cpu_total_seconds,k, *temp;
- double CPU_time0(),time,initial_time,start_time,avaimem();
-
- struct All_variables *E;
- MPI_Comm world;
-
- MPI_Init(&argc,&argv); /* added here to allow command-line input */
-
- if (argc < 2) {
- fprintf(stderr,"Usage: %s PARAMETERFILE\n", argv[0]);
- parallel_process_termination();
- }
-
- world = MPI_COMM_WORLD;
- E = citcom_init(&world); /* allocate global E and do initializaion here */
-
- solver_init(E);
-
- start_time = time = CPU_time0();
- read_instructions(E, argv[1]);
-
- cpu_time_on_vp_it = CPU_time0();
- initial_time = cpu_time_on_vp_it - time;
- if (E->parallel.me == 0) {
- fprintf(stderr,"Input parameters taken from file '%s'\n",argv[1]);
- fprintf(stderr,"Initialization complete after %g seconds\n\n",initial_time);
- fprintf(E->fp,"Initialization complete after %g seconds\n\n",initial_time);
- fflush(E->fp);
- }
-
- if (E->control.post_p) {
- post_processing(E);
- parallel_process_termination();
- }
-
- if(E->control.pseudo_free_surf) {
- if(E->mesh.topvbc == 2)
- general_stokes_solver_pseudo_surf(E);
- else
- assert(0);
- }
- else
- general_stokes_solver(E);
-
- (E->problem_output)(E, E->monitor.solution_cycles);
-
- /* information about simulation time and wall clock time */
- output_time(E, E->monitor.solution_cycles);
-
-
- if (E->control.stokes) {
-
- if(E->control.tracer==1)
- (E->problem_tracer_advection)(E);
-
- parallel_process_termination();
- }
-
- while ( E->control.keep_going && (Emergency_stop == 0) ) {
- E->monitor.solution_cycles++;
- if(E->monitor.solution_cycles>E->control.print_convergence)
- E->control.print_convergence=1;
-
- (E->next_buoyancy_field)(E);
-
- if(((E->advection.total_timesteps < E->advection.max_total_timesteps) &&
- (E->advection.timesteps < E->advection.max_timesteps)) ||
- (E->advection.total_timesteps < E->advection.min_timesteps) )
- E->control.keep_going = 1;
- else
- E->control.keep_going = 0;
-
- cpu_total_seconds = CPU_time0()-start_time;
- if (cpu_total_seconds > E->control.record_all_until) {
- E->control.keep_going = 0;
- }
-
- if (E->monitor.T_interior>1.5) {
- fprintf(E->fp,"quit due to maxT = %.4e sub_iteration%d\n",E->monitor.T_interior,E->advection.last_sub_iterations);
- parallel_process_termination();
- }
-
- general_stokes_solver(E);
-
- if(E->control.tracer==1)
- (E->problem_tracer_advection)(E);
-
- if ((E->monitor.solution_cycles % E->control.record_every)==0) {
- (E->problem_output)(E, E->monitor.solution_cycles);
- }
-
- /* information about simulation time and wall clock time */
- output_time(E, E->monitor.solution_cycles);
-
- if(E->control.mat_control==1)
- read_mat_from_file(E);
- /*
- else
- construct_mat_group(E);
- */
-
- if(E->control.vbcs_file==1)
- read_velocity_boundary_from_file(E);
- /*
- else
- renew_top_velocity_boundary(E);
- */
-
-
-
- if (E->parallel.me == 0) {
- fprintf(E->fp,"CPU total = %g & CPU = %g for step %d time = %.4e dt = %.4e maxT = %.4e sub_iteration%d\n",CPU_time0()-start_time,CPU_time0()-time,E->monitor.solution_cycles,E->monitor.elapsed_time,E->advection.timestep,E->monitor.T_interior,E->advection.last_sub_iterations);
-
- time = CPU_time0();
- }
-
- }
-
-
-
-
- if (E->parallel.me == 0) {
- fprintf(stderr,"cycles=%d\n",E->monitor.solution_cycles);
- cpu_time_on_vp_it=CPU_time0()-cpu_time_on_vp_it;
- fprintf(stderr,"Average cpu time taken for velocity step = %f\n",
- cpu_time_on_vp_it/((float)(E->monitor.solution_cycles-E->control.restart)));
- fprintf(E->fp,"Initialization overhead = %f\n",initial_time);
- fprintf(E->fp,"Average cpu time taken for velocity step = %f\n",
- cpu_time_on_vp_it/((float)(E->monitor.solution_cycles-E->control.restart)));
- }
-
- output_finalize(E);
- parallel_process_termination();
-
- return(0);
-
-}
Deleted: mc/3D/CitcomS/trunk/CitcomSFull.c
===================================================================
--- mc/3D/CitcomS/trunk/CitcomSFull.c 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/CitcomSFull.c 2006-11-16 14:40:41 UTC (rev 5302)
@@ -1,38 +0,0 @@
-/*
- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *<LicenseText>
- *
- * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
- * Clint Conrad, Michael Gurnis, and Eun-seo Choi.
- * Copyright (C) 1994-2005, California Institute of Technology.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *</LicenseText>
- *
- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-struct All_variables;
-
-void full_solver_init(struct All_variables *E);
-
-void solver_init(struct All_variables *E)
-{
- full_solver_init(E);
-}
-
-/* end of file */
Deleted: mc/3D/CitcomS/trunk/CitcomSRegional.c
===================================================================
--- mc/3D/CitcomS/trunk/CitcomSRegional.c 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/CitcomSRegional.c 2006-11-16 14:40:41 UTC (rev 5302)
@@ -1,38 +0,0 @@
-/*
- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- *
- *<LicenseText>
- *
- * CitcomS by Louis Moresi, Shijie Zhong, Lijie Han, Eh Tan,
- * Clint Conrad, Michael Gurnis, and Eun-seo Choi.
- * Copyright (C) 1994-2005, California Institute of Technology.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *</LicenseText>
- *
- *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- */
-
-struct All_variables;
-
-void regional_solver_init(struct All_variables *E);
-
-void solver_init(struct All_variables *E)
-{
- regional_solver_init(E);
-}
-
-/* end of file */
Modified: mc/3D/CitcomS/trunk/Makefile.am
===================================================================
--- mc/3D/CitcomS/trunk/Makefile.am 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/Makefile.am 2006-11-16 14:40:41 UTC (rev 5302)
@@ -30,124 +30,7 @@
MAYBE_PYRE = CitcomS etc examples module tests visual
endif
-SUBDIRS = lib $(MAYBE_PYRE)
+SUBDIRS = lib $(MAYBE_PYRE) bin
-INCLUDES = -I$(top_srcdir)/lib
-
-AM_CPPFLAGS =
-if COND_HDF5
- AM_CPPFLAGS += -DUSE_HDF5
-endif
-
-
-if COND_PYRE
-
-if COND_EMBEDDING
- bin_PROGRAMS = pycitcoms mpipycitcoms
-else
- bin_PROGRAMS =
-endif
-
- bin_SCRIPTS = citcoms
-else
- bin_PROGRAMS = CitcomSFull CitcomSRegional
- bin_SCRIPTS =
-endif
-
-
-######## legacy drivers ########
-
-
-CitcomSFull_SOURCES = Citcom.c CitcomSFull.c
-CitcomSFull_LDADD = $(top_builddir)/lib/libCitcomS.a
-CitcomSRegional_SOURCES = Citcom.c CitcomSRegional.c
-CitcomSRegional_LDADD = $(top_builddir)/lib/libCitcomS.a
-
-
-
-######## pyrized driver ########
-
-
-abs_top_srcdir = @abs_top_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_builddir = @abs_builddir@
-
-
-if COND_EMBEDDING
- INTERPRETER = $(bindir)/pycitcoms
- noinstINTERPRETER = $(abs_builddir)/pycitcoms
- noinstPYTHONPATH = $(abs_top_srcdir)
- libCitcomS = $(top_builddir)/lib/libCitcomS.a
-else
- INTERPRETER = $(PYTHON)
- noinstINTERPRETER = $(PYTHON)
- noinstPYTHONPATH = $(abs_top_srcdir):$(abs_top_builddir)/module/.libs
- libCitcomS = $(top_builddir)/lib/libCitcomS.la
-endif
-
-if COND_PYRE
-INCLUDES += \
- -I$(top_srcdir)/module \
- $(PYTHON_EGG_CPPFLAGS) \
- -I$(PYTHON_INCDIR)
-endif
-
-
-# citcoms (top-level Python script)
-do_build = sed -e s%[@]INTERPRETER[@]%$(noinstINTERPRETER)%g -e s%[@]PYTHONPATH[@]%$(noinstPYTHONPATH)%g
-do_install = sed -e s%[@]INTERPRETER[@]%$(INTERPRETER)%g -e s%[@]PYTHONPATH[@]%$(PYTHONPATH)%g
-citcoms: $(srcdir)/citcoms.in Makefile
- $(do_build) < $(srcdir)/citcoms.in > $@ || (rm -f $@ && exit 1)
- chmod +x $@
-install-binSCRIPTS: $(bin_SCRIPTS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
- @list='$(bin_SCRIPTS)'; for p in $$list; do \
- if test -f "$$p.in"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p.in; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(do_install) '$$d$$p.in' > '$(DESTDIR)$(bindir)/$$f'"; \
- $(do_install) "$$d$$p.in" > "$(DESTDIR)$(bindir)/$$f"; \
- echo " chmod +x '$(DESTDIR)$(bindir)/$$f'"; \
- chmod +x "$(DESTDIR)$(bindir)/$$f"; \
- else :; fi; \
- done
-EXTRA_DIST = citcoms.in
-CLEANFILES = $(bin_SCRIPTS)
-
-
-# pycitcoms (libCitcomS + CitcomSLibmodule + embedded Python interpreter)
-pycitcoms_SOURCES = pycitcoms.c
-pycitcoms_LDADD = \
- $(top_builddir)/module/libCitcomSLibmodule.a \
- $(libCitcomS)
-pycitcoms$(EXEEXT): $(pycitcoms_OBJECTS) $(pycitcoms_DEPENDENCIES)
- @rm -f pycitcoms$(EXEEXT)
- $(LINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
- $(pycitcoms_LDFLAGS) $(pycitcoms_OBJECTS) $(pycitcoms_LDADD) \
- $(PYTHON_EGG_LDFLAGS) \
- $(PYTHON_BLDLIBRARY) \
- $(PYTHON_LIBS) $(PYTHON_MODLIBS) $(PYTHON_SYSLIBS) \
- $(LIBS) \
- $(PYTHON_LDLAST)
-
-
-# pycitcoms (libCitcomS + CitcomSLibmodule + embedded Python interpreter)
-mpipycitcoms_SOURCES = pycitcoms.c
-mpipycitcoms_CFLAGS = -DUSE_MPI
-mpipycitcoms_LDADD = \
- $(top_builddir)/module/libCitcomSLibmodule.a \
- $(libCitcomS)
-mpipycitcoms$(EXEEXT): $(mpipycitcoms_OBJECTS) $(mpipycitcoms_DEPENDENCIES)
- @rm -f mpipycitcoms$(EXEEXT)
- $(LINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
- $(mpipycitcoms_LDFLAGS) $(mpipycitcoms_OBJECTS) $(mpipycitcoms_LDADD) \
- $(PYTHON_EGG_LDFLAGS) \
- $(PYTHON_BLDLIBRARY) \
- $(PYTHON_LIBS) $(PYTHON_MODLIBS) $(PYTHON_SYSLIBS) \
- $(LIBS) \
- $(PYTHON_LDLAST)
-
-
## end of Makefile.am
Copied: mc/3D/CitcomS/trunk/bin/Citcom.c (from rev 5300, mc/3D/CitcomS/trunk/Citcom.c)
Copied: mc/3D/CitcomS/trunk/bin/CitcomSFull.c (from rev 5300, mc/3D/CitcomS/trunk/CitcomSFull.c)
Copied: mc/3D/CitcomS/trunk/bin/CitcomSRegional.c (from rev 5300, mc/3D/CitcomS/trunk/CitcomSRegional.c)
Copied: mc/3D/CitcomS/trunk/bin/Makefile.am (from rev 5300, mc/3D/CitcomS/trunk/Makefile.am)
===================================================================
--- mc/3D/CitcomS/trunk/Makefile.am 2006-11-16 03:04:21 UTC (rev 5300)
+++ mc/3D/CitcomS/trunk/bin/Makefile.am 2006-11-16 14:40:41 UTC (rev 5302)
@@ -0,0 +1,144 @@
+## Process this file with automake to produce Makefile.in
+##
+##<LicenseText>
+##
+## CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+## Copyright (C) 2002-2005, California Institute of Technology.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+##</LicenseText>
+
+# $Id$
+
+
+INCLUDES = -I$(top_srcdir)/lib
+
+AM_CPPFLAGS =
+if COND_HDF5
+ AM_CPPFLAGS += -DUSE_HDF5
+endif
+
+
+if COND_PYRE
+
+if COND_EMBEDDING
+ bin_PROGRAMS = pycitcoms mpipycitcoms
+else
+ bin_PROGRAMS =
+endif
+
+ bin_SCRIPTS = citcoms
+else
+ bin_PROGRAMS = CitcomSFull CitcomSRegional
+ bin_SCRIPTS =
+endif
+
+
+######## legacy drivers ########
+
+
+CitcomSFull_SOURCES = Citcom.c CitcomSFull.c
+CitcomSFull_LDADD = $(top_builddir)/lib/libCitcomS.a
+CitcomSRegional_SOURCES = Citcom.c CitcomSRegional.c
+CitcomSRegional_LDADD = $(top_builddir)/lib/libCitcomS.a
+
+
+
+######## pyrized driver ########
+
+
+abs_top_srcdir = @abs_top_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_builddir = @abs_builddir@
+
+
+if COND_EMBEDDING
+ INTERPRETER = $(bindir)/pycitcoms
+ noinstINTERPRETER = $(abs_builddir)/pycitcoms
+ noinstPYTHONPATH = $(abs_top_srcdir):$(abs_top_builddir)
+ libCitcomS = $(top_builddir)/lib/libCitcomS.a
+else
+ INTERPRETER = $(PYTHON)
+ noinstINTERPRETER = $(PYTHON)
+ noinstPYTHONPATH = $(abs_top_srcdir):$(abs_top_builddir):$(abs_top_builddir)/module/.libs
+ libCitcomS = $(top_builddir)/lib/libCitcomS.la
+endif
+
+if COND_PYRE
+INCLUDES += \
+ -I$(top_srcdir)/module \
+ $(PYTHON_EGG_CPPFLAGS) \
+ -I$(PYTHON_INCDIR)
+endif
+
+
+# citcoms (top-level Python script)
+do_build = sed -e s%[@]INTERPRETER[@]%$(noinstINTERPRETER)%g -e s%[@]PYTHONPATH[@]%$(noinstPYTHONPATH)%g
+do_install = sed -e s%[@]INTERPRETER[@]%$(INTERPRETER)%g -e s%[@]PYTHONPATH[@]%$(PYTHONPATH)%g
+citcoms: $(srcdir)/citcoms.in Makefile
+ $(do_build) < $(srcdir)/citcoms.in > $@ || (rm -f $@ && exit 1)
+ chmod +x $@
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p.in"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p.in; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(do_install) '$$d$$p.in' > '$(DESTDIR)$(bindir)/$$f'"; \
+ $(do_install) "$$d$$p.in" > "$(DESTDIR)$(bindir)/$$f"; \
+ echo " chmod +x '$(DESTDIR)$(bindir)/$$f'"; \
+ chmod +x "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+EXTRA_DIST = citcoms.in
+CLEANFILES = $(bin_SCRIPTS)
+
+
+# pycitcoms (libCitcomS + CitcomSLibmodule + embedded Python interpreter)
+pycitcoms_SOURCES = pycitcoms.c
+pycitcoms_LDADD = \
+ $(top_builddir)/module/libCitcomSLibmodule.a \
+ $(libCitcomS)
+pycitcoms$(EXEEXT): $(pycitcoms_OBJECTS) $(pycitcoms_DEPENDENCIES)
+ @rm -f pycitcoms$(EXEEXT)
+ $(LINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
+ $(pycitcoms_LDFLAGS) $(pycitcoms_OBJECTS) $(pycitcoms_LDADD) \
+ $(PYTHON_EGG_LDFLAGS) \
+ $(PYTHON_BLDLIBRARY) \
+ $(PYTHON_LIBS) $(PYTHON_MODLIBS) $(PYTHON_SYSLIBS) \
+ $(LIBS) \
+ $(PYTHON_LDLAST)
+
+
+# pycitcoms (libCitcomS + CitcomSLibmodule + embedded Python interpreter)
+mpipycitcoms_SOURCES = pycitcoms.c
+mpipycitcoms_CFLAGS = -DUSE_MPI
+mpipycitcoms_LDADD = \
+ $(top_builddir)/module/libCitcomSLibmodule.a \
+ $(libCitcomS)
+mpipycitcoms$(EXEEXT): $(mpipycitcoms_OBJECTS) $(mpipycitcoms_DEPENDENCIES)
+ @rm -f mpipycitcoms$(EXEEXT)
+ $(LINK) $(PYTHON_LDFLAGS) $(PYTHON_LINKFORSHARED) \
+ $(mpipycitcoms_LDFLAGS) $(mpipycitcoms_OBJECTS) $(mpipycitcoms_LDADD) \
+ $(PYTHON_EGG_LDFLAGS) \
+ $(PYTHON_BLDLIBRARY) \
+ $(PYTHON_LIBS) $(PYTHON_MODLIBS) $(PYTHON_SYSLIBS) \
+ $(LIBS) \
+ $(PYTHON_LDLAST)
+
+
+## end of Makefile.am
Copied: mc/3D/CitcomS/trunk/bin/citcoms.in (from rev 5300, mc/3D/CitcomS/trunk/citcoms.in)
===================================================================
--- mc/3D/CitcomS/trunk/citcoms.in 2006-11-16 03:04:21 UTC (rev 5300)
+++ mc/3D/CitcomS/trunk/bin/citcoms.in 2006-11-16 14:40:41 UTC (rev 5302)
@@ -0,0 +1,46 @@
+#!@INTERPRETER@
+# -*- Python -*-
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+#<LicenseText>
+#
+# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
+# Copyright (C) 2002-2005, California Institute of Technology.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+#</LicenseText>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+
+__requires__ = "CitcomS"
+
+# re-create the PYTHONPATH at 'configure' time
+import os.path, sys, site
+path = '@PYTHONPATH@'.split(':')
+path.reverse()
+for directory in path:
+ if directory:
+ directory = os.path.abspath(directory)
+ sys.path.insert(1, directory)
+ site.addsitedir(directory)
+
+from CitcomS.SimpleApp import SimpleApp
+app = SimpleApp()
+app.run()
+
+# end of file
Copied: mc/3D/CitcomS/trunk/bin/pycitcoms.c (from rev 5300, mc/3D/CitcomS/trunk/pycitcoms.c)
Deleted: mc/3D/CitcomS/trunk/citcoms.in
===================================================================
--- mc/3D/CitcomS/trunk/citcoms.in 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/citcoms.in 2006-11-16 14:40:41 UTC (rev 5302)
@@ -1,45 +0,0 @@
-#!@INTERPRETER@
-# -*- Python -*-
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-#<LicenseText>
-#
-# CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-# Copyright (C) 2002-2005, California Institute of Technology.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-#</LicenseText>
-#
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#
-
-__requires__ = "CitcomS"
-
-# re-create the PYTHONPATH at 'configure' time
-import os.path, sys
-path = '@PYTHONPATH@'.split(':')
-path.reverse()
-for directory in path:
- if directory:
- directory = os.path.abspath(directory)
- sys.path.insert(1, directory)
-
-from CitcomS.SimpleApp import SimpleApp
-app = SimpleApp()
-app.run()
-
-# end of file
Modified: mc/3D/CitcomS/trunk/configure.ac
===================================================================
--- mc/3D/CitcomS/trunk/configure.ac 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/configure.ac 2006-11-16 14:40:41 UTC (rev 5302)
@@ -27,7 +27,7 @@
AC_PREREQ(2.59)
AC_INIT([CitcomS], [2.1.0], [cig-mc at geodynamics.org], [CitcomS])
AC_CONFIG_AUX_DIR([./aux-config])
-AC_CONFIG_SRCDIR([Citcom.c])
+AC_CONFIG_SRCDIR([bin/Citcom.c])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign])
@@ -55,13 +55,17 @@
CIT_PYTHON_SYSCONFIG
# Checks for Python modules and packages.
+
+ save_PYTHONPATH="$PYTHONPATH"
+ PYTHONPATH="`pwd`:$PYTHONPATH"; export PYTHONPATH
+
AC_MSG_NOTICE([checking/downloading Python dependencies])
- AS_IF([AC_TRY_COMMAND([$PYTHON setup.py install_deps -x -d . >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])],
+ AS_IF([AC_TRY_COMMAND([$PYTHON $srcdir/setup.py install_deps -x -d . >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])],
[],
[AC_MSG_FAILURE([cannot check/download 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])],
+ AS_IF([AC_TRY_COMMAND([$PYTHON $srcdir/setup.py egg_flags >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD])],
[AC_MSG_RESULT(ok)
eval `cat egg-flags.sh`
rm -f egg-flags.sh
@@ -69,6 +73,8 @@
[AC_MSG_RESULT(failed)
AC_MSG_FAILURE([cannot scan Python eggs for flags])])
+ PYTHONPATH="$save_PYTHONPATH"
+
AC_SUBST(PYTHON_EGG_CFLAGS)
AC_SUBST(PYTHON_EGG_CPPFLAGS)
AC_SUBST(PYTHON_EGG_LDFLAGS)
@@ -103,6 +109,7 @@
AM_CONDITIONAL([COND_HDF5], [test "$want_hdf5" != no])
AC_CONFIG_FILES([Makefile
+ bin/Makefile
CitcomS/Makefile
etc/Makefile
examples/Makefile
Deleted: mc/3D/CitcomS/trunk/pycitcoms.c
===================================================================
--- mc/3D/CitcomS/trunk/pycitcoms.c 2006-11-16 12:59:42 UTC (rev 5301)
+++ mc/3D/CitcomS/trunk/pycitcoms.c 2006-11-16 14:40:41 UTC (rev 5302)
@@ -1,102 +0,0 @@
-/*
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-//<LicenseText>
-//
-// CitcomS.py by Eh Tan, Eun-seo Choi, and Pururav Thoutireddy.
-// Copyright (C) 2002-2005, California Institute of Technology.
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-//</LicenseText>
-//
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-*/
-
-#include <Python.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <mpi.h>
-#include "CitcomSmodule.h"
-
-#define COMMAND \
-"import sys; " \
-"path = sys.argv[1]; " \
-"requires = sys.argv[2]; " \
-"entry = sys.argv[3]; " \
-"path = path.split(':'); " \
-"path.extend(sys.path); " \
-"sys.path = path; " \
-"from pyre.util import loadObject; " \
-"entry = loadObject(entry); " \
-"entry(sys.argv[3:], kwds={'requires': requires})"
-
-/* include the implementation of _mpi */
-#include "mpi/_mpi.c"
-
-struct _inittab inittab[] = {
- { "_mpi", init_mpi },
- { "CitcomSLib", initCitcomSLib },
- { 0, 0 }
-};
-
-int main(int argc, char **argv)
-{
- int status;
-
-#ifdef USE_MPI
- /* initialize MPI */
- if (MPI_Init(&argc, &argv) != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Init failed! Exiting ...", argv[0]);
- return 1;
- }
-#endif
-
- /* add our extension module */
- if (PyImport_ExtendInittab(inittab) == -1) {
- fprintf(stderr, "%s: PyImport_ExtendInittab failed! Exiting...\n", argv[0]);
- return 1;
- }
-
- if (argc < 3 || strcmp(argv[1], "--pyre-start") != 0) {
- return Py_Main(argc, argv);
- }
-
- /* make sure 'sys.executable' is set to the path of this program */
- Py_SetProgramName(argv[0]);
-
- /* initialize Python */
- Py_Initialize();
-
- /* initialize sys.argv */
- PySys_SetArgv(argc - 1, argv + 1);
-
- /* run the Python command */
- status = PyRun_SimpleString(COMMAND) != 0;
-
- /* shut down Python */
- Py_Finalize();
-
-#ifdef USE_MPI
- /* shut down MPI */
- MPI_Finalize();
-#endif
-
- return status;
-}
-
-/* End of file */
More information about the cig-commits
mailing list