| 
      
      
      From: <mk...@us...> - 2003-03-20 00:24:50
       | 
| Update of /cvsroot/csp/APPLICATIONS/SimData
In directory sc8-pr-cvs1:/tmp/cvs-serv12601
Modified Files:
	CHANGES.current Makefile README setup.py 
Log Message:
see CHANGES.current
Index: CHANGES.current
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/CHANGES.current,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** CHANGES.current	18 Mar 2003 10:37:27 -0000	1.4
--- CHANGES.current	20 Mar 2003 00:24:47 -0000	1.5
***************
*** 1,5 ****
--- 1,28 ----
  Version 0.3.1 (in progress)
  ===========================
+ 2003-03-19: onsight
+             Changed Enumeration implementation to use std::map<> instead
+ 	    of (non-)std::hash_map<>.
+ 
+ 	    Enumeration __getattr__ in Python now returns new Enum objects 
+ 	    to prevent const subversion (the Enumeration members were
+ 	    mutable from Python).  The logic for __getattr__ is more robust
+ 	    as well.
+ 
+ 	    Added __mul__ and __rmul__ operators to Vector3 and Matrix3
+ 	    to allow: V*V, M*M, V*M, M*V, M*F, F*M, V*F, F*V.
  
+ 	    Optimized Matrix3*Vector3 and Vector3*Matrix3 slightly by
+ 	    using vector members instead of integer indexing (which
+ 	    required nine extra function calls).  Access to the matrix
+ 	    elements is also faster using pointer arithmatic, and the
+ 	    for loops have been unrolled by hand.
+ 
+ 	    Fixed setup.py to preserve file and directory permissions
+ 	    during installation.
+ 
+ 	    Added make_install target to setup.py which is used by the
+ 	    standard Makefile to install SimData (make install).
+ 	    
  2003-03-17: onsight
              Fixes to MS VC.net fixes.  Lather, rinse, repeat... ;-)
Index: Makefile
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Makefile	19 Feb 2003 11:14:31 -0000	1.4
--- Makefile	20 Mar 2003 00:24:47 -0000	1.5
***************
*** 2,8 ****
  
  export GDEBUGF = -g -Wall
! export GCFLAGS = -fPIC -DUSE_NAMESPACE_SIMDATA -O2 # -march=athlon-tbird
  export GLDOPTS = -shared -lswigpy -ldl
! export GSWOPTS = -c -c++ -python -DUSE_NAMESPACE_SIMDATA -noexcept
  export CXX = g++
  export SWIG = swig 
--- 2,8 ----
  
  export GDEBUGF = -g -Wall
! export GCFLAGS = -fPIC -O2 # -march=athlon-tbird
  export GLDOPTS = -shared -lswigpy -ldl
! export GSWOPTS = -c -c++ -python -noexcept
  export CXX = g++
  export SWIG = swig 
***************
*** 23,24 ****
--- 23,27 ----
  	rm Source/cSimData_wrap.cpp || true;
  	make -C Source all
+ 
+ install:
+ 	python setup.py make_install
Index: README
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/README,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** README	18 Mar 2003 10:03:59 -0000	1.3
--- README	20 Mar 2003 00:24:47 -0000	1.4
***************
*** 83,90 ****
  INSTALLING AND USING SIMDATA
  
! Currently you should not do anything to install SimData.  CSPSim expects
! SimData to be in the same relative path as it is in the CVS tree.  This
! situation is not optimal and will change as soon as the DistUtils 
! installer is working.
  
  
--- 83,111 ----
  INSTALLING AND USING SIMDATA
  
! Note that installation under Windows is not yet supported.  This is
! being worked on, and information will be added here as soon as it is
! available.
! 
! Under Linux, depending on which method you used to build SimData, do
! either:
! 
! 
! $ make install
! 
! or 
! 
! $ python setup.py install
! 
! 
! SimData installs itself as a package in the Python site-packages
! directory. The C++ headers are placed under SimData in the same
! directory as Python.h.
! 
! To use the SimData headers for development, just add the usual Python
! include path (e.g. /usr/local/include/python2.2) to your list of include
! paths, and include the header using the prefix "SimData/". For example,
! 
! #include <SimData/Types.h>
! 
  
  
Index: setup.py
===================================================================
RCS file: /cvsroot/csp/APPLICATIONS/SimData/setup.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** setup.py	18 Mar 2003 10:04:01 -0000	1.1
--- setup.py	20 Mar 2003 00:24:47 -0000	1.2
***************
*** 1,11 ****
  from distutils.core import setup
  from distutils.core import Extension
  import distutils.command.build_ext
  from distutils.command.build_ext import build_ext
! import os, os.path, string
  
  # REMEMBER TO 'touch Version.cpp' OR REBUILD ALL
  VERSION = "\"0.3.1\""
  
  
  class build_swig_ext(build_ext):
--- 1,70 ----
+ # SimDataCSP: Data Infrastructure for Simulations
+ # Copyright (C) 2002 Mark Rose <tm...@st...>
+ # 
+ # This file is part of SimDataCSP.
+ # 
+ # 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.
+ 
+ 
+ ###
+ # This script has many warts, but should be functional.  It will
+ # be cleaned up in due course....
+ #
+ # -MR
+ 
+ 
  from distutils.core import setup
  from distutils.core import Extension
  import distutils.command.build_ext
  from distutils.command.build_ext import build_ext
! import os, os.path, string, sys
  
  # REMEMBER TO 'touch Version.cpp' OR REBUILD ALL
  VERSION = "\"0.3.1\""
  
+ def copy_dir(src, dst, files):
+     from distutils.file_util import copy_file
+     from distutils.dir_util import mkpath
+     from distutils.errors import DistutilsFileError, DistutilsInternalError
+     from stat import ST_ATIME, ST_MTIME, ST_MODE, S_IMODE
+     if not os.path.isdir(src):
+         raise DistutilsFileError, \
+               "cannot copy dir '%s': not a directory" % src
+     mkpath(dst)
+     st = os.stat(src)
+     os.chmod(dst, S_IMODE(st[ST_MODE]))
+     for n in files:
+         src_name = os.path.join(src, n)
+         dst_name = os.path.join(dst, n)
+         if not os.path.isdir(src_name):
+             copy_file(src_name, dst_name)
+ 
+ def make_install():
+ 	from distutils import sysconfig, dir_util
+ 	lib = sysconfig.get_python_lib()
+ 	inc = sysconfig.get_python_inc()
+ 	modpath = os.path.join(lib, "SimData")
+ 	incpath = os.path.join(inc, "SimData")
+ 	try:
+ 		print "Installing SimData package to", modpath
+ 		copy_dir("SimData", modpath, ['__init__.py', 'Debug.py', 'Parse.py', 'Compile.py', 'cSimData.py', '_cSimData.so'])
+ 		print "Installing SimData headers to", incpath
+ 		copy_dir("Include/SimData", incpath, headers)
+ 	except Exception, e:
+ 		print e
+ 		sys.exit(1)
+ 	sys.exit(0)
  
  class build_swig_ext(build_ext):
***************
*** 153,156 ****
--- 212,216 ----
  	"Types.h",
  	"Vector3.h",
+ 	"Vector3.inl",
  	"Version.h",
  ]
***************
*** 165,176 ****
  sources = fullpath("Source/", ".cpp", sources)
  interfaces = fullpath("Source/", ".i", interfaces)
! headers = fullpath("Include/SimData/", "", headers)
  
! build_swig_ext.options = "-DUSE_NAMESPACE_SIMDATA -IInclude -noexcept"
  includes = ["Include"]
! defines = [("USE_NAMESPACE_SIMDATA", None), ("SIMDATA_VERSION", VERSION)]
  libraries = ["swigpy", "dl"]
  cflags = []
  
  cSimData = Extension("SimData._cSimData", 
                       sources + interfaces, 
--- 225,240 ----
  sources = fullpath("Source/", ".cpp", sources)
  interfaces = fullpath("Source/", ".i", interfaces)
! headers_fullpath = fullpath("Include/SimData/", "", headers)
  
! build_swig_ext.options = "-IInclude -noexcept"
  includes = ["Include"]
! defines = [("SIMDATA_VERSION", VERSION)]
  libraries = ["swigpy", "dl"]
  cflags = []
  
+ 
+ if len(sys.argv)==2 and sys.argv[1]=="make_install":
+ 	make_install()
+ 
  cSimData = Extension("SimData._cSimData", 
                       sources + interfaces, 
***************
*** 188,192 ****
        url="http://csp.sourceforge.net/wiki/",
        packages=['SimData'],
! 	  headers = headers,
  	  ext_modules = [cSimData],
  	  )
--- 252,256 ----
        url="http://csp.sourceforge.net/wiki/",
        packages=['SimData'],
! 	  headers = headers_fullpath,
  	  ext_modules = [cSimData],
  	  )
 |