[Phylobase-commits] r726 - in pkg: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jan 30 22:47:13 CET 2010


Author: edd
Date: 2010-01-30 22:47:13 +0100 (Sat, 30 Jan 2010)
New Revision: 726

Modified:
   pkg/configure
   pkg/configure.in
   pkg/src/NCLInterface.cpp
   pkg/src/ReadWithNCL.cpp
Log:
fixes to the phylobase build to align with the new version of NCL:
 -- src/{NCLInterface,ReadWithNCL}.cpp now use #include <ncl/ncl.h>
 -- src/Makevars gets a -Iinclude from configure as the path is include/ncl/*
 -- adjust configure accordingly
 -- also suppress compile-time output from NCL


Modified: pkg/configure
===================================================================
--- pkg/configure	2010-01-28 15:35:40 UTC (rev 725)
+++ pkg/configure	2010-01-30 21:47:13 UTC (rev 726)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.65 for phylobase 0.2.
+# Generated by GNU Autoconf 2.65 for phylobase 0.5.
 #
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -548,8 +548,8 @@
 # Identity of this package.
 PACKAGE_NAME='phylobase'
 PACKAGE_TARNAME='phylobase'
-PACKAGE_VERSION='0.2'
-PACKAGE_STRING='phylobase 0.2'
+PACKAGE_VERSION='0.5'
+PACKAGE_STRING='phylobase 0.5'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1158,7 +1158,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures phylobase 0.2 to adapt to many kinds of systems.
+\`configure' configures phylobase 0.5 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1219,7 +1219,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of phylobase 0.2:";;
+     short | recursive ) echo "Configuration of phylobase 0.5:";;
    esac
   cat <<\_ACEOF
 
@@ -1299,7 +1299,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-phylobase configure 0.2
+phylobase configure 0.5
 generated by GNU Autoconf 2.65
 
 Copyright (C) 2009 Free Software Foundation, Inc.
@@ -1391,7 +1391,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by phylobase $as_me 0.2, which was
+It was created by phylobase $as_me 0.5, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   $ $0 $@
@@ -1737,7 +1737,12 @@
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+ 	## package name, version
 
+## the CC and CFLAGS variables control configure tests, and they need to
+## be the same as what will be used when the package is built. There is
+## no need to place these flags in Makevars, and if no configure tests are
+## done they are not needed here (see "Writing R Extensions" manual).
 : ${R_HOME=`R RHOME`}
 if test -z "${R_HOME}"; then
     echo "Could not determine R home directory"
@@ -1751,6 +1756,7 @@
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ ## using C++
 
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
@@ -2436,7 +2442,8 @@
 
 
 
-## With thanks to Kurt
+## Make sure we find R_HOME as several R instances could be installed
+## on the same machine -- with thanks to Kurt Hornik for the hint
 : ${R_HOME=`R RHOME`}
 if test -z "${R_HOME}"; then
     as_fn_error "Could not determine R_HOME." "$LINENO" 5
@@ -2494,26 +2501,21 @@
     exit 1
 fi
 
-CPPFLAGS="${CPPFLAGS} ${rcpp_cxxflags} -Iinclude/ncl"
+## configure include/load flags and copy sample source to inst/doc
+CPPFLAGS="${CPPFLAGS} ${rcpp_cxxflags} -Iinclude"
 
 LDFLAGS="${LDFLAGS} ${rcpp_ldflags} -Llib/ncl -lncl"
 
 
-#echo "Building libRcpp.a in RcppSrc..."
-#cd src/RcppSrc
-#make RHOME=${R_HOME}
-#cd ../..
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: starting to build libncl.a in ncl" >&5
-$as_echo "$as_me: starting to build libncl.a in ncl" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: starting to build libncl.a in src/ncl" >&5
+$as_echo "$as_me: starting to build libncl.a in src/ncl" >&6;}
 cd src/ncl
 ./configure --quiet --enable-static --disable-shared --prefix=`pwd`/..
-make
-make install
+make 2>&1 > /dev/null
+make install 2>&1 > /dev/null
 cd ../..
-#ls -ltr src/
-{ $as_echo "$as_me:${as_lineno-$LINENO}: finished building libncl.a in ncl" >&5
-$as_echo "$as_me: finished building libncl.a in ncl" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: finished building libncl.a in src/ncl" >&5
+$as_echo "$as_me: finished building libncl.a in src/ncl" >&6;}
 
 if test \! -d inst
 then
@@ -3065,7 +3067,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by phylobase $as_me 0.2, which was
+This file was extended by phylobase $as_me 0.5, which was
 generated by GNU Autoconf 2.65.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -3118,7 +3120,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-phylobase config.status 0.2
+phylobase config.status 0.5
 configured by $0, generated by GNU Autoconf 2.65,
   with options \\"\$ac_cs_config\\"
 

Modified: pkg/configure.in
===================================================================
--- pkg/configure.in	2010-01-28 15:35:40 UTC (rev 725)
+++ pkg/configure.in	2010-01-30 21:47:13 UTC (rev 726)
@@ -45,16 +45,16 @@
 fi
 
 ## configure include/load flags and copy sample source to inst/doc
-AC_SUBST([CPPFLAGS],["${CPPFLAGS} ${rcpp_cxxflags} -Iinclude/ncl"])
+AC_SUBST([CPPFLAGS],["${CPPFLAGS} ${rcpp_cxxflags} -Iinclude"])
 AC_SUBST([LDFLAGS],["${LDFLAGS} ${rcpp_ldflags} -Llib/ncl -lncl"])
 
-AC_MSG_NOTICE([starting to build libncl.a in ncl])
+AC_MSG_NOTICE([starting to build libncl.a in src/ncl])
 cd src/ncl
 ./configure --quiet --enable-static --disable-shared --prefix=`pwd`/..
-make
-make install
+make 2>&1 > /dev/null
+make install 2>&1 > /dev/null
 cd ../..
-AC_MSG_NOTICE([finished building libncl.a in ncl])
+AC_MSG_NOTICE([finished building libncl.a in src/ncl])
 
 if test \! -d inst
 then

Modified: pkg/src/NCLInterface.cpp
===================================================================
--- pkg/src/NCLInterface.cpp	2010-01-28 15:35:40 UTC (rev 725)
+++ pkg/src/NCLInterface.cpp	2010-01-30 21:47:13 UTC (rev 726)
@@ -21,7 +21,7 @@
 //	59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
 
-#include "ncl.h"
+#include <ncl/ncl.h>
 #include "NCLInterface.h"
 #include <sstream>
 #include <cassert>

Modified: pkg/src/ReadWithNCL.cpp
===================================================================
--- pkg/src/ReadWithNCL.cpp	2010-01-28 15:35:40 UTC (rev 725)
+++ pkg/src/ReadWithNCL.cpp	2010-01-30 21:47:13 UTC (rev 726)
@@ -34,7 +34,7 @@
 //     used here three times
 #define  Rf_length length
 
-#include "ncl.h"
+#include <ncl/ncl.h>
 #include "NCLInterface.h"
 
 using namespace std;
@@ -219,64 +219,4 @@
 }
 
 
-/*
- * Sample function illustrates how to use the Rcpp R/C++ interface library.
- */
-/*
-RcppExport SEXP Rcpp_Example(SEXP params, SEXP nlist, 
-			     SEXP numvec, SEXP nummat,
-			     SEXP df, SEXP datevec, SEXP stringvec,
-			     SEXP fnvec, SEXP fnlist) {
 
-    SEXP  rl=R_NilValue; // Use this when there is nothing to be returned.
-    char* exceptionMesg=NULL;
-}
-*/
-
-
-/*
- * The following class definitions employ advanced features of the Rcpp
- * library and R, permitting the C++ programmer to call user-defined functions
- * on the R side. They should be skipped on first reading.
- */
-
-/*
- * Define a class that can be used to call an R function that expects a
- * real vector argument and returns a scalar. The R function is defined in
- * the example section of the documentation page for RcppExample (see
- * RcppExample.Rd).
- */
-class MyRVectorFunc : public RcppFunction {
-public:
-    MyRVectorFunc(SEXP fn) : RcppFunction(fn) {}
-
-    // This trivial function will use an R function to compute the
-    // sum of the elements of v!
-    double getSum(vector<double>& v) {
-
-	// Turn vector into a SEXP that can be passed to R as an argument.
-	setRVector(v);
-
-	// Call the R function that was passed in as the paramter fn, with
-	// the SEXP vector that was just set as its argument.
-	SEXP result = vectorCall();
-
-	// Assuming that the R function simply returns a real number we
-	// pass it back to the C++ user as follows. If the R function returns
-	// something more complicated transform result into a C++ object to
-	// be returned, and  clear the part of the protection stack due to
-	// this object before returning (to prevent protection stack overflow).
-	// Note that it is unsafe to do this if the returned result depends
-	// on PROTECT-ed SEXP's. For example, result should not be 
-	// wrapped in a class like RcppParams where objects hold onto the
-	// the PROTECT-ed SEXP that was used to construct them.
-
-	double value = REAL(result)[0];
-
-	// Safe now to clear the contribution of this function to the
-	// protection stack.
-	clearProtectionStack();
-
-	return value;
-    }
-};



More information about the Phylobase-commits mailing list