[Swift-commit] r5114 - in SwiftApps/SwiftR: . Swift Swift/src Swift/src/swift-patches

tga at ci.uchicago.edu tga at ci.uchicago.edu
Wed Sep 14 13:22:30 CDT 2011


Author: tga
Date: 2011-09-14 13:22:30 -0500 (Wed, 14 Sep 2011)
New Revision: 5114

Added:
   SwiftApps/SwiftR/Swift/src/
   SwiftApps/SwiftR/Swift/src/Makefile
   SwiftApps/SwiftR/Swift/src/download-src.sh
   SwiftApps/SwiftR/Swift/src/make.include
   SwiftApps/SwiftR/Swift/src/swift-patches/
   SwiftApps/SwiftR/checkout-swift.sh
Removed:
   SwiftApps/SwiftR/swift-patches/
Modified:
   SwiftApps/SwiftR/IMMEDIATE-TODO
   SwiftApps/SwiftR/Makefile
Log:
Changed built process to generate CRAN and full versions of package, and to support downloading swiftsrc via wget

Modified: SwiftApps/SwiftR/IMMEDIATE-TODO
===================================================================
--- SwiftApps/SwiftR/IMMEDIATE-TODO	2011-09-14 18:02:40 UTC (rev 5113)
+++ SwiftApps/SwiftR/IMMEDIATE-TODO	2011-09-14 18:22:30 UTC (rev 5114)
@@ -2,14 +2,7 @@
 
 
 
-3) speed: where is bottleneck?  how to measure and tune?
-- ParallelCI and ParallelBoostrap benchmarks
-- smaller focused micro-tests to create plots of speed vs param size and efficiency vs runtime of the evaluated function.
-
 HIGH:
--- Check that 0.2.6 works on mac.
-
-HIGH:
 -- OpenMx Benchmarking on Beagle
 
 HIGH:
@@ -17,10 +10,18 @@
     only observed when running locally and on sge)
 
 HIGH:
+-- Merge canonical portions of wiki documentation into R man pages
+-- Generate html from R man pages
+
+HIGH:
 -- Benchmark ideas
     - Beagle
     - Sarah Kenny FMRI
+3) speed: where is bottleneck?  how to measure and tune?
+- ParallelCI and ParallelBoostrap benchmarks
+- smaller focused micro-tests to create plots of speed vs param size and efficiency vs runtime of the evaluated function.
 
+
 MED: 
 -- Have a more user-friendly way to specify some of the more common
     custom setups:

Modified: SwiftApps/SwiftR/Makefile
===================================================================
--- SwiftApps/SwiftR/Makefile	2011-09-14 18:02:40 UTC (rev 5113)
+++ SwiftApps/SwiftR/Makefile	2011-09-14 18:22:30 UTC (rev 5114)
@@ -1,74 +1,106 @@
 
+include Swift/src/make.include
+
 # All files that go into package
 PKG_FILES = $(shell find Swift/R -name '*.R'; find Swift/man -name '*.Rd'; find Swift/exec/ -type f -not -path '*/.svn*'; find Swift/inst/ -type f -not -path '*/.svn*')
 
+
 PKG_FILES += Swift/DESCRIPTION
-PKG_FILES += Swift/NAMESPACE
+PKG_FILES += Swift/NAMESPACE 
+PKG_FILE +=  Swift/src/Makefile Swift/src/make.include Swift/src/download-src.sh
+PKG_FILES += $(shell find Swift/src/swift-patches -not -path '*/.svn*') 
 
+PACKAGE_DEPS = $(PKG_FILES) Makefile
 
 # Extract the version number from the R package description file
 # There should be a line in the file of the form:
 # Version: (major).(minor)
 SWIFTR_VERSION=$(shell sed -n -r 's/^Version:(\W*)([[:digit:]]+\.[[:digit:].]+)/\2/p' Swift/DESCRIPTION)
 
-COG_SRC = cog-svn
 
-SWIFT_SRC = $(COG_SRC)/modules/swift
+GEN_PKG_NAME=Swift_$(SWIFTR_VERSION).tar.gz
+FULL_PKG=Swift_$(SWIFTR_VERSION)_full.tar.gz
+CRAN_PKG=Swift_$(SWIFTR_VERSION)_cran.tar.gz
 
-SWIFT_DIST = $(SWIFT_SRC)/dist/swift-svn
 
+COG_SRC = cog-svn
 
-TBALL=Swift_$(SWIFTR_VERSION).tar.gz
 
+SWIFT_SRC = $(COG_SRC)/modules/swift
 
-all: build
+SWIFT_DIST = $(SWIFT_SRC)/dist/swift-svn
 
-build: 	$(TBALL)
+SWIFT_INST = Swift/inst/swift
 
-$(COG_SRC)/.checkedout: 
-	if [ -d $(COG_SRC) ] ; then rm -rf $(COG_SRC); fi
-	echo Checking out CoG source
-	svn co https://cogkit.svn.sourceforge.net/svnroot/cogkit/tags/swift_0.92.1 $(COG_SRC)
-	echo Checking out Swift source
-	(cd $(COG_SRC)/modules; \
-		svn co https://svn.ci.uchicago.edu/svn/vdl2/tags/release-0.92.1 swift)
-	patch -d cog-svn/ -p0 < swift-patches/swift-0.92.1-changes.patch # hacky way to apply customisations
-	touch $(COG_SRC)/.checkedout
+SWIFT_PATCH_DIR = Swift/src/swift-patches
 
+all: $(FULL_PKG) $(CRAN_PKG)
 
-$(SWIFT_SRC)/.built: $(COG_SRC)/.checkedout
-	(cd $(SWIFT_SRC) && ant dist && touch .built)
+build: 	$(FULL_PKG)
 
+install: $(FULL_PKG)
+	R CMD INSTALL $(FULL_PKG)
 
-# Target to make sure that swift exists
-Swift/inst/swift/bin/swift: $(SWIFT_SRC)/.built
-	mkdir -p Swift/inst/
-	cp -r $(SWIFT_DIST) Swift/inst/swift
+installcran: $(CRAN_PKG)
+	R CMD INSTALL $(CRAN_PKG)
 
-publish: $(TBALL)
-	cp $(TBALL) ~/public_html
 
-install: $(TBALL)
-	R CMD INSTALL $(TBALL)
+check: $(FULL_PKG)
+	R CMD check $(FULL_PKG)
 
-check: $(TBALL)
-	R CMD check $(TBALL)
+checkcran: $(CRAN_PKG)
+	R CMD check $(CRAN_PKG)
 
 test: install
 	Rscript Swift/tests/runtests.R
 
+testcran: installcran
+	Rscript Swift/tests/runtests.R
+
 clean: 
-	rm -rf $(COG_SRC)
-	rm -rf Swift/inst/swift/
-	rm -f $(TBALL)
+	rm -f ./$(FULL_PKG)
+	rm -f ./$(CRAN_PKG)
+	rm -rf ./$(SWIFT_INST)
+	rm -rf ./$(COG_SRC)
 
 
-$(TBALL): Swift/inst/swift/bin/swift $(PKG_FILES) Makefile
+$(CRAN_PKG): $(PACKAGE_DEPS) $(SWIFT_SRC_NAME).shasum
 	- if [ -d .svn -a -x "`which svn`" ]; then svn info > Swift/svninfo; fi
+	(cd Swift/src; make removeall)
+	cp $(SWIFT_SRC_NAME).shasum Swift/src
 	R CMD build Swift
+	mv $(GEN_PKG_NAME) $(CRAN_PKG) 
 
+$(FULL_PKG): $(PACKAGE_DEPS) $(SWIFT_SRC)/.built
+	mkdir -p Swift/inst
+	rm -Rf ./$(SWIFT_INST)
+	cp -r $(SWIFT_DIST) $(SWIFT_INST)
+	- if [ -d .svn -a -x "`which svn`" ]; then svn info > Swift/svninfo; fi
+	R CMD build Swift
+	mv $(GEN_PKG_NAME) $(FULL_PKG) 
 
 
+swiftsrc: $(SWIFT_SRC_NAME).shasum $(SWIFT_SRC_NAME).tar.gz
+
+$(SWIFT_SRC_NAME).tar.gz:
+	sh checkout-swift.sh $(SWIFT_SRC_NAME) $(SWIFT_PATCH_DIR)/$(SWIFT_SRC_PATCH) $(SWIFT_SRC_TAG) $(COG_SRC_TAG)
+	cp -r $(SWIFT_PATCH_DIR) $(SWIFT_SRC_NAME)/SwiftR-patches
+	tar cvvzf $(SWIFT_SRC_NAME).tar.gz $(SWIFT_SRC_NAME)
+	rm -rf ./$(SWIFT_SRC_NAME)
+
+$(SWIFT_SRC_NAME).shasum: $(SWIFT_SRC_NAME).tar.gz
+	shasum $(SWIFT_SRC_NAME).tar.gz > $(SWIFT_SRC_NAME).shasum
+
+
+	
+
+$(SWIFT_SRC)/.built: $(COG_SRC)/.checkedout
+	(cd $(SWIFT_SRC) && ant dist && touch .built)
+
+$(COG_SRC)/.checkedout: Swift/src/Makefile
+	sh checkout-swift.sh $(COG_SRC) $(SWIFT_PATCH_DIR)/$(SWIFT_SRC_PATCH) $(SWIFT_SRC_TAG) $(COG_SRC_TAG)
+	touch $(COG_SRC)/.checkedout
+
 checkversion: 
 	echo SwiftR version is $(SWIFTR_VERSION) according to Swift/DESCRIPTION file
 

Added: SwiftApps/SwiftR/Swift/src/Makefile
===================================================================
--- SwiftApps/SwiftR/Swift/src/Makefile	                        (rev 0)
+++ SwiftApps/SwiftR/Swift/src/Makefile	2011-09-14 18:22:30 UTC (rev 5114)
@@ -0,0 +1,45 @@
+# This is a makefile that checks outs and builds Swift
+# This is done to allow distribution of a pure source-only Swift package
+# A fresh copy of the source is only checked out if swift isn't included
+# in the package.
+include make.include
+
+
+SWIFT_MODULE_SRC = $(SWIFT_SRC_NAME)/modules/swift
+
+SWIFT_DIST = $(SWIFT_MODULE_SRC)/dist/swift-svn
+
+SWIFT_INST = ../inst/swift
+
+SWIFT_BIN = $(SWIFT_INST)/bin/swift
+
+all: $(SWIFT_BIN)
+
+$(SWIFT_SRC_NAME)/.downloadedok: 
+	# hack to avoid redoing
+	if [ ! -f $(SWIFT_BIN) ]; then \
+	  sh ./download-src.sh $(SWIFT_SRC_NAME) && \
+	  touch $(SWIFT_SRC_NAME)/.downloadedok ; \
+	fi
+
+
+$(SWIFT_MODULE_SRC)/.built: $(SWIFT_SRC_NAME)/.downloadedok
+	# hack to avoid rebuilding
+	if [ ! -f $(SWIFT_BIN) ]; then \
+	  (cd $(SWIFT_MODULE_SRC) && ant dist && touch .built); \
+	fi
+
+# Target to make sure that swift exists
+$(SWIFT_BIN): $(SWIFT_MODULE_SRC)/.built
+	# hack to avoid recopying
+	if [ ! -f $(SWIFT_BIN) ]; then \
+	  mkdir -p ../inst && \
+	  rm -Rf ./$(SWIFT_INST) && \
+	  cp -r $(SWIFT_DIST) $(SWIFT_INST); \
+	fi
+
+removeall: removesrc
+	rm -rf ./$(SWIFT_INST)
+
+removesrc:
+	rm -rf ./$(SWIFT_SRC_NAME)

Added: SwiftApps/SwiftR/Swift/src/download-src.sh
===================================================================
--- SwiftApps/SwiftR/Swift/src/download-src.sh	                        (rev 0)
+++ SwiftApps/SwiftR/Swift/src/download-src.sh	2011-09-14 18:22:30 UTC (rev 5114)
@@ -0,0 +1,13 @@
+#!/bin/sh
+set -e
+SWIFT_SRC_NAME=$1
+
+if [ "$SWIFT_SRC_NAME" = "" ] ; then
+    echo Package name not specified
+    exit 1
+fi
+
+wget http://cs.uchicago.edu/~tga/swiftR/swift-source/${SWIFT_SRC_NAME}.tar.gz
+shasum --check ${SWIFT_SRC_NAME}.shasum
+
+tar xvzf ${SWIFT_SRC_NAME}.tar.gz

Added: SwiftApps/SwiftR/Swift/src/make.include
===================================================================
--- SwiftApps/SwiftR/Swift/src/make.include	                        (rev 0)
+++ SwiftApps/SwiftR/Swift/src/make.include	2011-09-14 18:22:30 UTC (rev 5114)
@@ -0,0 +1,6 @@
+# Variables shared between makefiles
+
+SWIFT_SRC_TAG = release-0.92.1
+COG_SRC_TAG = swift_0.92.1
+SWIFT_SRC_NAME = swift-0.92.1-SwiftR-r1
+SWIFT_SRC_PATCH = swift-0.92.1-changes.patch


Property changes on: SwiftApps/SwiftR/Swift/src/swift-patches
___________________________________________________________________
Added: svn:mergeinfo
   + 

Added: SwiftApps/SwiftR/checkout-swift.sh
===================================================================
--- SwiftApps/SwiftR/checkout-swift.sh	                        (rev 0)
+++ SwiftApps/SwiftR/checkout-swift.sh	2011-09-14 18:22:30 UTC (rev 5114)
@@ -0,0 +1,31 @@
+#!/bin/sh
+set -e
+COG_SRC=$1
+SWIFT_PATCH=$2
+SWIFT_TAG=$3
+COG_TAG=$4
+
+if [ "$COG_SRC" = "" ] ; then
+    COG_SRC=cogsrc
+fi
+
+if [ "$SWIFT_TAG" = "" ] ; then
+    echo Need to provide Swift tag
+    exit 1
+fi
+
+if [ "$COG_TAG" = "" ] ; then
+    echo Need to provide CoG tag
+    exit 1
+fi
+
+if [ -d ${COG_SRC} ] ; then rm -rf ${COG_SRC}; fi
+
+echo Checking out CoG source
+
+svn export https://cogkit.svn.sourceforge.net/svnroot/cogkit/tags/${COG_TAG} ${COG_SRC}
+echo Checking out Swift source 
+(cd ${COG_SRC}/modules &&
+    svn export https://svn.ci.uchicago.edu/svn/vdl2/tags/${SWIFT_TAG} swift)
+
+patch -d ${COG_SRC} -p0 < $SWIFT_PATCH




More information about the Swift-commit mailing list