[Rsiena-commits] r297 - in pkg/RSiena: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 28 19:54:18 CEST 2016


Author: fschoenen
Date: 2016-08-28 19:54:18 +0200 (Sun, 28 Aug 2016)
New Revision: 297

Added:
   pkg/RSiena/Makefile
   pkg/RSiena/configure.ac
   pkg/RSiena/configure.win
   pkg/RSiena/src/Makevars.in
Modified:
   pkg/RSiena/.Rbuildignore
   pkg/RSiena/ChangeLog
   pkg/RSiena/DESCRIPTION
   pkg/RSiena/cleanup
   pkg/RSiena/cleanup.win
Log:
RSiena: new buildsystem


Modified: pkg/RSiena/.Rbuildignore
===================================================================
--- pkg/RSiena/.Rbuildignore	2016-08-18 07:45:44 UTC (rev 296)
+++ pkg/RSiena/.Rbuildignore	2016-08-28 17:54:18 UTC (rev 297)
@@ -1,6 +1,17 @@
-inst/.*[.]log
-inst/.*[.]bbl
-inst/.*[.]blg
-inst/.*[.]aux
-inst/.*[.]out
-inst/.*[.]toc
+^doc
+^RSienaTest_.*\.tar\.gz
+
+Makefile
+
+src/Makefile.profile
+src/SienaProfile\..*
+
+src/RMath.dll
+src/libpgSn.a
+
+tests/testrefs
+tests/effectsTest.R
+tests/slowtest.R
+tests/sampson.r
+
+inst/.*\.(log|bbl|blg|aux|out|toc|bak)

Modified: pkg/RSiena/ChangeLog
===================================================================
--- pkg/RSiena/ChangeLog	2016-08-18 07:45:44 UTC (rev 296)
+++ pkg/RSiena/ChangeLog	2016-08-28 17:54:18 UTC (rev 297)
@@ -1,3 +1,7 @@
+2016-08-28 R-Forge Revision 297
+Changes in RSiena:
+   * buildsystem: added Makefile and src/sources.list
+
 2016-08-17 R-Forge Revision 296
 Changes in RSiena and RSienaTest:
    * Warning if includeEffects is used with parameter initialValue.

Modified: pkg/RSiena/DESCRIPTION
===================================================================
--- pkg/RSiena/DESCRIPTION	2016-08-18 07:45:44 UTC (rev 296)
+++ pkg/RSiena/DESCRIPTION	2016-08-28 17:54:18 UTC (rev 297)
@@ -1,7 +1,7 @@
 Package: RSiena
 Type: Package
 Title: Siena - Simulation Investigation for Empirical Network Analysis
-Version: 1.1-296
+Version: 1.1-297
 Date: 2016-08-17
 Author: Ruth Ripley, Krists Boitmanis, Tom A.B. Snijders, Felix Schoenenberger
 Depends: R (>= 2.15.0), utils

Added: pkg/RSiena/Makefile
===================================================================
--- pkg/RSiena/Makefile	                        (rev 0)
+++ pkg/RSiena/Makefile	2016-08-28 17:54:18 UTC (rev 297)
@@ -0,0 +1,115 @@
+# Build System
+#
+# With the introduction of MPI and therfore the need of autoconf things got
+# little more complicated. This is a Makefile providing simple targets. Short
+# run down of the manual build system:
+#
+# 1. Running `autoconf` transforms 'configure.ac' to 'configure'. The
+#    configure.ac/configure.win files contain the logic for MPI discovery.
+#
+# 2. Calling `R CMD INSTALL {pkg}` will run configure and make.
+#
+# 2.1 `configure` builds the 'Makevars' file from the 'Makevars.in' template
+#   replacing Variables enclosed in '@'. This includes compiler and linker
+#   flags (@PKG_CPPFLAGS@, @PKG_LIBS@) as well as the list of source files
+#   (@PKG_SOURCES@) which is stored in the 'src/sources.list' file and
+#   generated by this 'Makefile'.
+
+# High level targets for this file:
+#
+# clean
+#   Remove temporary files.
+# build, check, install
+#   Correspond the to `R CMD *` versions.
+# test_capture, test
+#   Trigger the regression testing. regsave captures the state, regtest
+#   tests against the saved state.
+
+# Parse DESCRIPTION file.
+PKG_VERSION := $(shell grep -i ^version DESCRIPTION | cut -d\  -f2-)
+PKG_REVISION := $(shell echo $(PKG_VERSION) | cut -d- -f2-)
+PKG_NAME := $(shell grep -i ^package DESCRIPTION | cut -d\  -f2-)
+PKG_DATE := $(shell grep -i ^date DESCRIPTION | cut -d\  -f2-)
+PKG_TARBALL := $(PKG_NAME)_$(PKG_VERSION).tar.gz
+PKG_IMPORTS := $(shell grep -i ^imports DESCRIPTION | cut -d\  -f2-)
+PKG_SUGGESTS := $(shell grep -i ^suggests DESCRIPTION | cut -d\  -f2-)
+
+# Actual source information.
+# SRC_REVISION := $(shell svn info --show-item revision)
+SRC_LIST = src/sources.list
+
+# Top level source files containing the R binding.
+SRC_BINDING = \
+	siena07internals.cpp \
+	siena07models.cpp \
+	siena07setup.cpp \
+	siena07utilities.cpp
+
+# Folders in src/ needed entirely.
+SRC_MODULES = data model network utils
+
+# R command settings.
+R = R
+R_RUN = $(R) -e
+R_BUILD = $(R) CMD build
+R_CHECK = $(R) CMD check --as-cran
+R_INSTALL = $(R) CMD INSTALL
+
+.PHONY:
+all: clean check
+
+.PHONY:
+clean:
+# ifeq ($(OS),Windows_NT)
+# 	sh ./cleanup.win
+# else
+# 	./cleanup
+# endif
+	-rm -rf $(PKG_NAME).Rcheck
+	-rm -f $(PKG_TARBALL)
+	-rm -f $(SRC_LIST)
+
+.PHONY:
+check: $(PKG_TARBALL)
+	$(R_CHECK) $<
+
+.PHONY:
+install: $(PKG_TARBALL)
+	$(R_INSTALL) $<
+
+.PHONY:
+build: $(PKG_TARBALL)
+$(PKG_TARBALL): configure $(SRC_LIST)
+	$(R_BUILD) .
+
+.PHONY:
+commitchecks: # test
+	# test $(PKG_REVISION) -eq $$(($(SRC_REVISION)+1)) # DESCRIPTION revision
+	test $(PKG_DATE) = $$(date -I) # DESCRIPTION date
+	chmod a+x configure cleanup # script permissions
+
+configure: configure.ac
+	autoconf
+
+# build the list of source files
+$(SRC_LIST): $(shell find src -iname '*.cpp')
+	echo -n "$(SRC_BINDING)" >$@
+	cd src && find $(SRC_MODULES) -iname '*.cpp' -printf ' %p' >>$(@:src/%=%)
+
+# dependencies
+.PHONY:
+install_dep:
+	$(R_RUN) "options(repos='http://stat.ethz.ch/CRAN');\
+	pkgs <- c(strsplit('$(PKG_IMPORTS)', ', '), strsplit('$(PKG_SUGGESTS)', ', '));\
+	for (pkg in pkgs) install.packages(pkg)"
+
+# regression tests
+.PHONY:
+test_capture:
+	cd inst/unitTests && \
+	$(R_RUN) "require($(PKG_NAME)); record_values <- T; RSienaTest:::run_tests(dir='.')"
+
+.PHONY:
+test:
+	cd inst/unitTests && \
+	$(R_RUN) "require($(PKG_NAME)); RSienaTest:::run_tests(dir='.')"


Property changes on: pkg/RSiena/Makefile
___________________________________________________________________
Added: svn:mime-type
   + text/plain;charset=UTF-8
Added: svn:eol-style
   + native

Modified: pkg/RSiena/cleanup
===================================================================
--- pkg/RSiena/cleanup	2016-08-18 07:45:44 UTC (rev 296)
+++ pkg/RSiena/cleanup	2016-08-28 17:54:18 UTC (rev 297)
@@ -1,3 +1,17 @@
-rm -f  src/*/*.o
-rm -f  src/*/*/*.o
-rm -f  src/*/*/*/*.o
+#!/usr/bin/env bash
+pushd "$(dirname "$0")"
+
+# autoconf
+rm -rf autom4te.cache
+rm -f config.log
+rm -f config.status
+rm -f src/Makedeps
+rm -f src/Makevars
+rm -f src/Makevars.win
+rm -f src/symbols.rds
+# binaries
+rm -f src/*.{so,d,dll,a,rc}
+# objects
+find src -name '*.o' -exec rm '{}' \;
+
+popd

Modified: pkg/RSiena/cleanup.win
===================================================================
--- pkg/RSiena/cleanup.win	2016-08-18 07:45:44 UTC (rev 296)
+++ pkg/RSiena/cleanup.win	2016-08-28 17:54:18 UTC (rev 297)
@@ -1,6 +1,21 @@
+rm -f src/Makedeps
+rm -f src/Makevars
+rm -f src/Makevars.win
+
+rm -f src/*.so
+rm -f src/*.d
+rm -f src/*.dll
+rm -f src/*.a
+rm -f src/*.rc
+
+rm -f src/*.o
 rm -f src/*/*.o
 rm -f src/*/*/*.o
 rm -f src/*/*/*/*.o
+rm -f src/*/*/*/*/*.o
+rm -f src/*/*/*/*/*/*.o
+rm -f src/*/*/*/*/*/*/*.o
+
 rm -f src/RSiena.dll
 rm -f src/libSn1.a
 rm -f src/libSn2.a

Added: pkg/RSiena/configure.ac
===================================================================
--- pkg/RSiena/configure.ac	                        (rev 0)
+++ pkg/RSiena/configure.ac	2016-08-28 17:54:18 UTC (rev 297)
@@ -0,0 +1,298 @@
+# vim:fdm=marker:
+
+# Based on the autoconf.ac from the Rmpi package
+# <http://www.stats.uwo.ca/faculty/yu/Rmpi/>. Run `autoconf` to produce the
+# 'configure' script.
+
+# - Run with automatic detection: `R CMD INSTALL {pkg}`
+
+# - Run with a prefix folder. Subfolders will be searched for binarys.
+#   `R CMD INSTALL {pkg} --configure-args=--with-mpi=/path/to/location`
+
+# - Fully specify paths and type.
+#   `R CMD INSTALL {pkg} --configure-args="        \\
+#    --with-Rmpi-include=/path/to/mpi_include_dir  \\
+#    --with-Rmpi-libpath=/path/to/mpi_lib_dir      \\
+#    --with-Rmpi-type={OPENMPI,MPICH,MPICH2,LAM}"`
+
+AC_PREREQ([2.69])
+AC_INIT([RSienaTest], 1.1-289)
+AC_CONFIG_SRCDIR([src])
+
+# Checks (autoscan)                                                       {{{1
+AC_PROG_CXX
+AC_PROG_CC
+# Checks for header files
+AC_CHECK_HEADERS([sys/time.h unistd.h])
+# Checks for typedefs, structures, and compiler characteristics
+AC_CHECK_HEADER_STDBOOL
+AC_C_INLINE
+AC_C_RESTRICT
+AC_TYPE_SIZE_T
+AC_CHECK_TYPES([ptrdiff_t])
+# Checks for library functions.
+AC_FUNC_ERROR_AT_LINE
+AC_FUNC_MALLOC
+AC_HEADER_MAJOR
+AC_FUNC_REALLOC
+AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset pow select sqrt])
+
+# Args (mpi discovery)                                                    {{{1
+dnl --with-mpi-include-path
+MPI=yes
+AC_ARG_WITH([mpi-include-path],
+            AS_HELP_STRING([--with-mpi-include-path=DIR], [location of MPI header files]),
+            [if test "${withval}" != "no" ; then
+             MPI_INCLUDE_PATH="${withval}"
+             if test ! -f "${MPI_INCLUDE_PATH}/mpi.h"; then
+               AC_MSG_ERROR([Value of --with-include-path does not contain mpi.h])
+               fi
+             else
+               if test -n "${MPI_INCLUDE_PATH}" ; then
+                 MPI_INCLUDE_PATH="${MPI_INCLUDE_PATH}"
+                 if test ! -f "${MPI_INCLUDE_PATH}/mpi.h"; then
+                   AC_MSG_ERROR([Value of MPI_INCLUDE_PATH does not contain mpi.h])
+                   fi
+                   echo "Setting MPI include path from MPI_INCLUDE_PATH"
+                 fi
+               fi])
+
+dnl --with-mpi-lib-path
+AC_ARG_WITH([mpi-lib-path],
+            AS_HELP_STRING([--with-mpi-lib-path=DIR], [location of MPI library files]),
+            [if test "${withval}" != "no" ; then
+             MPI_LIB_PATH="${withval}"
+           else
+             if test -n "${MPI_LIB_PATH}" ; then
+               MPI_LIB_PATH="${MPI_LIB_PATH}"
+               echo "Setting MPI lib path from MPI_LIB_PATH"
+             fi
+           fi])
+
+if test -n "${MPI_INCLUDE_PATH}" -a -n "${MPI_LIB_PATH}" ; then
+  MPI_INCLUDES="-I${MPI_INCLUDE_PATH}"
+  MPI_LIBS="-L${MPI_LIB_PATH}"
+elif test -n "${MPI_INCLUDE_PATH}" -o -n "${MPI_LIB_PATH}" ; then
+  AC_MSG_ERROR([Must specify both the include and lib path])
+fi
+
+dnl --with-mpi-type
+AC_ARG_WITH([mpi-type],
+            AS_HELP_STRING([--with-mpi-type=MPI_TYPE], [the type of MPI: OPENMPI, LAM or MPICH]),
+            [if test "${withval}" != "no" ; then
+              MPI_TYPE="${withval}"
+            else
+              if test -n "${MPI_TYPE}" ; then
+                MPI_TYPE="${MPI_TYPE}"
+                echo "Setting MPI type from MPI_TYPE"
+              fi
+            fi])
+
+dnl begin auto configure paths
+if test -z "${MPI_INCLUDE_PATH}" ; then
+
+  dnl --with-mpi-root
+  AC_ARG_WITH(mpi-root,
+              AS_HELP_STRING([--with-mpi-root=DIR], [location of top-level MPI directory]),
+              [if test "${withval}" != "no" ; then
+                MPI_ROOT="${withval}"
+                MPI_INCLUDE_PATH="${MPI_ROOT}/include"
+                MPI_LIB_PATH="${MPI_ROOT}/lib"
+              fi])
+
+  if test -z "$MPI_ROOT" ; then
+    dnl auto configure MPI_ROOT, (MPI_TYPE, MPI_INCLUDE_PATH)
+    AC_MSG_CHECKING([for mpi root directory])
+    for d in /opt/lib /usr/lib /usr /usr/local/lib /usr/local \
+      /usr/lib64/mpi/gcc/openmpi; do
+      if test -f $d/include/mpi.h && test -d $d/lib/openmpi; then
+        MPI_ROOT=$d
+        MPI_TYPE="OPENMPI"
+        break
+      elif test -f $d/include/openmpi/mpi.h && test -d $d/lib/openmpi; then
+        MPI_ROOT=$d
+        MPI_TYPE="OPENMPI"
+        MPI_INCLUDE_PATH=$d/include/openmpi
+        break
+      elif test -f $d/include/openmpi/mpi.h && test -d $d/lib64/openmpi; then
+        MPI_ROOT=$d
+        MPI_TYPE="OPENMPI"
+        MPI_INCLUDE_PATH=$d/include/openmpi
+        break
+      elif test -f $d/openmpi/include/mpi.h && test -d $d/openmpi/lib; then
+        MPI_ROOT=$d/openmpi
+        MPI_TYPE="OPENMPI"
+        MPI_INCLUDE_PATH=$d/include/openmpi
+        break
+      elif test -f $d/include/mpi.h && test -d $d/lib64; then
+        MPI_ROOT=$d
+        MPI_TYPE="OPENMPI"
+        MPI_INCLUDE_PATH=$d/include
+        break
+      elif test -f $d/lam/include/mpi.h && test -f $d/lam/lib/libmpi.so; then
+        MPI_ROOT=$d/lam
+        MPI_TYPE="LAM"
+        MPI_INCLUDE_PATH=$d/include/lam
+        break
+      elif test -f $d/include/lam/mpi.h && test -f $d/lib/lam/libmpi.so; then
+        MPI_ROOT=$d
+        MPI_TYPE="LAM"
+        MPI_INCLUDE_PATH=$d/include/lam
+        break
+      elif test -f $d/include/lam/mpi.h && test -f $d/lib64/lam/libmpi.so; then
+        MPI_ROOT=$d
+        MPI_TYPE="LAM"
+        MPI_INCLUDE_PATH=$d/include/lam
+        break
+      elif test -f $d/mpich/include/mpi.h; then
+        MPI_ROOT=$d/mpich
+        MPI_TYPE="MPICH"
+        MPI_INCLUDE_PATH=$d/mpich/include
+        break
+      elif test -f $d/mpi/include/mpi.h; then
+        MPI_ROOT=$d/mpi
+        MPI_INCLUDE_PATH=$d/mpi/include
+        break
+      elif test -f $d/include/mpi.h; then
+        MPI_ROOT=$d
+        break
+      fi
+    done
+    AC_MSG_RESULT([$MPI_ROOT])
+  fi
+
+  if test -n "$MPI_ROOT"; then
+    dnl auto configure MPI_INCLUDE_PATH
+    AC_MSG_CHECKING([for mpi.h])
+    for d in include include/openmpi include/lam ; do
+      if test -f ${MPI_ROOT}/$d/mpi.h ; then
+        AC_MSG_RESULT([${MPI_ROOT}/$d])
+        MPI_INCLUDE_PATH="${MPI_ROOT}/$d"
+        break
+      fi
+    done
+    if test -z "$MPI_INCLUDE_PATH" ; then
+      AC_MSG_RESULT([no])
+      MPI=no
+    fi
+  else
+    AC_CHECK_HEADER(mpi.h, , [MPI=no])
+  fi
+  if test -n "$MPI_INCLUDE_PATH" ; then
+    MPI_INCLUDES="-I${MPI_INCLUDE_PATH}"
+  fi
+
+  dnl auto configure MPI_LIB_PATH, (MPI_INCLUDES)
+  AC_MSG_CHECKING([for libmpi.{a,so,dylib}])
+  if test -f ${MPI_ROOT}/lib/libmpi.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib"
+  elif test -f ${MPI_ROOT}/libmpi.so; then
+    dnl Fedora 10
+    MPI_LIB_PATH="${MPI_ROOT}"
+  elif test -f ${MPI_ROOT}/lib/openmpi/libmpi.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib/openmpi"
+  elif test -f ${MPI_ROOT}/lib64/openmpi/libmpi.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib64/openmpi"
+  elif test -f ${MPI_ROOT}/lib64/libmpi.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib64"
+  elif test -f ${MPI_ROOT}/lib/lam/libmpi.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib/lam"
+    MPI_INCLUDES="$MPI_INCLUDES -I${MPI_INCLUDE_PATH}/32"
+  elif test -f ${MPI_ROOT}/lib64/lam/libmpi.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib64/lam"
+    MPI_INCLUDES="$MPI_INCLUDES -I${MPI_INCLUDE_PATH}/64"
+  elif test -f ${MPI_ROOT}/lib/libmpich.so; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib"
+    AC_CHECK_DECLS([MPICH2, MPICH2],[  MPI_DEFS="-DMPI2" ],,[#include <mpi.h>])
+  elif test -f ${MPI_ROOT}/lib64/libmpich.a; then
+    MPI_LIB_PATH="${MPI_ROOT}/lib64"
+    AC_CHECK_DECLS([MPICH2, MPICH2],[  MPI_DEFS="-DMPI2" ],,[#include <mpi.h>])
+  elif test -f ${MPI_ROOT}/lib/libmpi.dylib; then
+    dnl OSX (10.6)
+    MPI_LIB_PATH="${MPI_ROOT}/lib"
+  else
+    AC_CHECK_LIB(mpi, main, [MPI_LIB_PATH="${MPI_ROOT}/lib"], )
+  fi
+  if test -n "$MPI_LIB_PATH" ; then
+    AC_MSG_RESULT([$MPI_LIB_PATH])
+  fi
+fi
+dnl end auto configure paths
+if test -z $MPI_TYPE ; then
+  if   test -d ${MPI_ROOT}/openmpi;          then MPI_TYPE="OPENMPI"
+  elif test -d ${MPI_ROOT}/lib/openmpi;      then MPI_TYPE="OPENMPI"
+  elif test -d ${MPI_ROOT}/lib64/openmpi;    then MPI_TYPE="OPENMPI"
+  elif test -f ${MPI_ROOT}/lib/liblam.so;    then MPI_TYPE="LAM"
+  elif test -d ${MPI_ROOT}/lib/lam;          then MPI_TYPE="LAM"
+  elif test -d ${MPI_ROOT}/lib64/lam;        then MPI_TYPE="LAM"
+  elif test -f ${MPI_ROOT}/lib/libmpich.a;   then MPI_TYPE="MPICH"
+  elif test -f ${MPI_ROOT}/lib64/libmpich.a; then MPI_TYPE="MPICH"
+  fi
+fi
+
+if test "$MPI_TYPE" = "OPENMPI" ; then
+  AC_CHECK_PROG(ORTED, orted, yes, no)
+  if test "$ORTED" = no ; then
+    AC_MSG_NOTICE([Cannot find orted. Rmpi needs orted to run.])
+  fi
+fi
+
+if test "$MPI_TYPE" = "LAM" ; then
+  echo "Try to find liblam.so ..."
+  if test -f ${MPI_ROOT}/lib/liblam.so; then
+    echo "Found liblam in ${MPI_ROOT}/lib"
+    MPI_LIB_PATH="${MPI_ROOT}/lib"
+  elif test -f ${MPI_ROOT}/lib/lam/liblam.so; then
+    echo "Found liblam in ${MPI_ROOT}/lib/lam"
+    MPI_LIB_PATH="${MPI_ROOT}/lib/lam"
+  elif test -f ${MPI_ROOT}/lib64/lam/liblam.so; then
+    echo "Found liblam in ${MPI_ROOT}/lib64/lam"
+    MPI_LIB_PATH="${MPI_ROOT}/lib64/lam"
+  else
+    AC_CHECK_LIB(lam, main, [ echo "liblam not found. Probably not LAM-MPI" ])
+  fi
+fi
+
+if test -n "$MPI_LIB_PATH" ; then
+  MPI_LIBS="-L${MPI_LIB_PATH}"
+else
+  MPI=no
+fi
+
+AC_CHECK_LIB(util, openpty, [ MPI_LIBS="$MPI_LIBS -lutil" ])
+AC_CHECK_LIB(pthread, main, [ MPI_LIBS="$MPI_LIBS -lpthread" ])
+
+MPI_DEFS="-D$MPI_TYPE"
+if test "$MPI_TYPE" = "OPENMPI" -o "$MPI_TYPE" = "LAM" -o "$MPI_TYPE" = "MPICH2"; then
+  MPI_DEFS="$MPI_DEFS -DMPI2"
+fi
+OSTYPE="`uname`"
+if test "$OSTYPE" = "Darwin"; then
+  MPI_DEFS="$MPI_DEFS -DMAC"
+fi
+
+PKG_CPPFLAGS="$MPI_INCLUDES $MPI_DEFS"
+if test "$MPI" = "yes" ; then
+  case "$MPI_TYPE" in
+    OPENMPI) PKG_LIBS="-lmpi_cxx -lmpi ${MPI_LIBS}";;
+    LAM)     PKG_LIBS="-lmpi_cxx -llam ${MPI_LIBS}";;
+    MPICH)   PKG_LIBS="-lmpich -lmpl -lopa ${MPI_LIBS}";;
+    MPICH2)  PKG_LIBS="-lmpich -lmpl -lopa ${MPI_LIBS}";;
+    *)
+      AC_MSG_NOTICE([Unknown type of mpi, compiling without mpi support. Use --with-mpi-xxxx to specify it.])
+      PKG_CPPFLAGS=
+      PKG_LIBS=
+      ;;
+  esac
+else
+  PKG_CPPFLAGS=
+  PKG_LIBS=
+fi
+
+PKG_SOURCES=$(cat src/sources.list)
+
+AC_SUBST(PKG_SOURCES)
+AC_SUBST(PKG_CPPFLAGS)
+AC_SUBST(PKG_LIBS)
+
+AC_OUTPUT(src/Makevars)

Added: pkg/RSiena/configure.win
===================================================================
--- pkg/RSiena/configure.win	                        (rev 0)
+++ pkg/RSiena/configure.win	2016-08-28 17:54:18 UTC (rev 297)
@@ -0,0 +1,77 @@
+#!/usr/bin/env ash
+# vim:ft=sh:fdm=marker:
+
+# Searches for the MPI installations in the common places an produces the
+# Makevars.win from the Makevars.in file.
+
+# Dependencies                                                           {{{1
+echo -n "checking sed... "
+if type sed >/dev/null 2>&1 ; then
+  echo "yes"
+else
+  echo "no"
+  echo "Please install Rtools and make sure it's in the PATH." >&2
+  exit 1
+fi
+
+# Parse arguments                                                        {{{1
+while test -n "$1" ; do
+  case "$1" in
+    --with-mpi-include-path) MPI_INCLUDE="$2"; shift ;;
+    --with-mpi-lib-path)     MPI_LIB="$2";     shift ;;
+    --with-mpi-type)         MPI_TYPE="$2";    shift ;;
+    --with-mpi-root)
+      MPI_ROOT="$2"
+      MPI_INCLUDE="$MPI_ROOT/include"
+      MPI_LIB="$MPI_ROOT/lib"
+      shift ;;
+  esac
+  shift
+done
+
+# Search in the usual install paths                                      {{{1
+if test -z "$MPI_INCLUDE" || -z "$MPI_LIB" ; then
+  echo "Trying to find mpi root directory ..."
+  #for d in "$PROGRAMFILES" "$ProgramW6432" ; do
+  for d in "C:/Progra~1" "C:/Progra~2" ; do
+    if test -f "$d/MPICH2/include/mpi.h" \
+      && test -f "$d/MPICH2/lib/libmpi.a" ; then
+      MPI_ROOT="$d/MPICH2"
+      MPI_INCLUDE="$MPI_ROOT/include"
+      MPI_LIB="$MPI_ROOT/lib"
+      MPI_TYPE="MPICH2"
+      echo "I am here $MPI_ROOT and it is $MPI_TYPE"
+      break
+    elif test -f "$d/OpenMPI/include/mpi.h" \
+      && test -f "$d/OpenMPI/bin/libmpi.dll" ; then
+      MPI_ROOT="$d/OpenMPI"
+      MPI_INCLUDE="$MPI_ROOT/include"
+      MPI_LIB="$MPI_ROOT/bin"
+      MPI_TYPE="OPENMPI"
+      echo "I am here $MPI_ROOT and it is $MPI_TYPE"
+      break
+    fi
+  done
+fi # }}}1
+
+if test "$MPI_TYPE" = "OPENMPI" -o "$MPI_TYPE" = "MPICH2"; then
+  MPI_DEFS="-DMPI2"
+fi
+
+PKG_CPPFLAGS="-I${MPI_INCLUDE} ${MPI_DEFS} -D${MPI_TYPE}"
+
+case "$MPI_TYPE" in
+  OPENMPI) PKG_LIBS="-L${MPI_LIB} -lmpi_cxx -lmpi" ;;
+  MPICH2)  PKG_LIBS="-L${MPI_LIB} -lmpi" ;;
+  *) echo "No MPI Installation found. Compiling without MPI support." >&2 ;;
+esac
+
+PKG_SOURCES="$(cat src/sources.list)"
+
+# Take care that variables do not contain '\' backslashes or '#' hashes!
+sed "
+s#@PKG_SOURCES@#$PKG_SOURCES#;
+s#@PKG_LIBS@#$PKG_LIBS#;
+s#@PKG_CPPFLAGS@#$PKG_CPPFLAGS#" \
+src/Makevars.in >src/Makevars.win
+

Added: pkg/RSiena/src/Makevars.in
===================================================================
--- pkg/RSiena/src/Makevars.in	                        (rev 0)
+++ pkg/RSiena/src/Makevars.in	2016-08-28 17:54:18 UTC (rev 297)
@@ -0,0 +1,10 @@
+# -*- Makefile -*-
+# vim:ft=make:
+
+OBJECTS = $(SOURCES:.cpp=.o)
+SOURCES = @PKG_SOURCES@
+
+PKG_CPPFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -I. @PKG_CPPFLAGS@
+PKG_LIBS     = $(SHLIB_OPENMP_CXXFLAGS) $(ARCHLIB) @PKG_LIBS@
+
+all: $(SHLIB)



More information about the Rsiena-commits mailing list