Skip to content
Snippets Groups Projects
Commit 27c0aa88 authored by Mick Jordan's avatar Mick Jordan
Browse files

native: add using pre-built GnuR option

parent 71a09cac
No related branches found
No related tags found
No related merge requests found
......@@ -21,13 +21,16 @@
# questions.
#
.PHONY: all clean
.PHONY: all clean makegnur cleangnur
export TOPDIR = $(CURDIR)
export R_VERSION = 3.1.3
export GNUR_DIR = $(TOPDIR)/gnur/R-$(R_VERSION)
all:
ifndef GNUR_HOME
export GNUR_HOME = $(TOPDIR)/gnur/R-$(R_VERSION)
endif
all:
$(MAKE) -C gnur
$(MAKE) -C include
$(MAKE) -C builtinlibs
......@@ -35,10 +38,11 @@ all:
$(MAKE) -C library
$(MAKE) -C run
clean:
clean:
$(MAKE) -C include clean
$(MAKE) -C builtinlibs clean
$(MAKE) -C fficall clean
$(MAKE) -C library clean
$(MAKE) -C run clean
$(MAKE) -C gnur clean
......@@ -40,7 +40,7 @@ OBJ = lib
C_SOURCES := $(wildcard $(SRC)/*.c)
C_OBJECTS := $(subst $(SRC),$(OBJ),$(C_SOURCES:.c=.o))
F_OBJECTS := $(wildcard $(GNUR_DIR)/src/appl/d*.o)
F_OBJECTS := $(wildcard $(GNUR_HOME)/src/appl/d*.o)
LIBDIR := $(OBJ)
LIB_APPL := $(OBJ)/libappl$(DYLIB_EXT)
......
......@@ -23,12 +23,26 @@
.PHONY: all clean
all:
all: makegnur
$(MAKE) -f Makefile.gnur
$(MAKE) -f Makefile.platform
$(MAKE) -f Makefile.libs
clean:
$(MAKE) -f Makefile.gnur clean
ifeq "$(origin GNUR_HOME)" "environment"
makegnur:
else
makegnur:
$(MAKE) -f Makefile.gnur
endif
clean: cleangnur
$(MAKE) -f Makefile.libs clean
$(MAKE) -f Makefile.platform clean
ifeq "$(origin GNUR_HOME)" "environment"
cleangnur:
else
cleangnur:
$(MAKE) -f Makefile.gnur clean
endif
\ No newline at end of file
......@@ -36,9 +36,6 @@
# Portions of the Makeconf file are then extracted to use in building the native
# parts of FastR, especially packages with native code.
# Building GnuR takes several minutes, so in some environments, e.g. repository gates,
# referring to a pre-built GnuR would be of value. This is TBD.
.PHONY: all config config_update build clean
OSNAME := $(shell uname)
......@@ -51,37 +48,39 @@ all:
@false
endif
all: Makefile $(GNUR_DIR) config build
all: Makefile $(GNUR_HOME) config build
$(GNUR_DIR):
$(GNUR_HOME):
tar xf $(TOPDIR)/../lib/R-$(R_VERSION).tar.gz
config: $(GNUR_DIR)/Makefile config_update
config: $(GNUR_HOME)/Makefile config_update
ifeq ($(OSNAME), Linux)
config_update: Makeconf.done
Makeconf.done: edMakeconf
ed $(GNUR_DIR)/Makeconf < edMakeconf
ed $(GNUR_HOME)/Makeconf < edMakeconf
touch Makeconf.done
else
config_update:
endif
$(GNUR_DIR)/Makefile:
(cd $(GNUR_DIR); ./configure --with-x=no --without-recommended-packages >& gnur_configure.log)
$(GNUR_HOME)/Makefile:
(cd $(GNUR_HOME); ./configure --with-x=no --without-recommended-packages >& gnur_configure.log)
build: $(GNUR_DIR)/bin/R
build: $(GNUR_HOME)/bin/R
$(GNUR_DIR)/bin/R: $(GNUR_DIR)/Makeconf
(cd $(GNUR_DIR); make >& gnur_make.log)
$(GNUR_HOME)/bin/R: $(GNUR_HOME)/Makeconf
(cd $(GNUR_HOME); make >& gnur_make.log)
HAVE_MAKEFILE := $(shell [ -f $(GNUR_DIR)/Makefile ] && echo "Makefile.exists")
ifeq ($(HAVE_MAKEFILE),Makefile.exists)
clean:
HAVE_MAKEFILE := $(shell [ -f $(GNUR_HOME)/Makefile ] && echo "Makefile.exists")
clean: cleangnur
rm -f Makeconf.done
(cd $(GNUR_DIR); make distclean)
ifeq ($(HAVE_MAKEFILE),Makefile.exists)
cleangnur:
(cd $(GNUR_HOME); make distclean)
else
clean:
cleangnur:
endif
......@@ -37,13 +37,13 @@ all: $(TARGET_DIR) $(BLAS_TARGET) $(LAPACK_TARGET) $(PCRE_TARGET)
$(TARGET_DIR):
mkdir -p $(TARGET_DIR)
$(BLAS_TARGET): $(GNUR_DIR)/lib/libRblas$(DYLIB_EXT)
cp $(GNUR_DIR)/lib/libRblas$(DYLIB_EXT) $(BLAS_TARGET)
$(BLAS_TARGET): $(GNUR_HOME)/lib/libRblas$(DYLIB_EXT)
cp $(GNUR_HOME)/lib/libRblas$(DYLIB_EXT) $(BLAS_TARGET)
$(LAPACK_TARGET): $(GNUR_DIR)/lib/libRlapack$(DYLIB_EXT)
cp $(GNUR_DIR)/lib/libRlapack$(DYLIB_EXT) $(LAPACK_TARGET)
$(LAPACK_TARGET): $(GNUR_HOME)/lib/libRlapack$(DYLIB_EXT)
cp $(GNUR_HOME)/lib/libRlapack$(DYLIB_EXT) $(LAPACK_TARGET)
PCRE_OBJS := $(wildcard $(GNUR_DIR)/src/extra/pcre/pcre_*.o)
PCRE_OBJS := $(wildcard $(GNUR_HOME)/src/extra/pcre/pcre_*.o)
$(PCRE_TARGET): $(PCRE_OBJS) $(TOPDIR)/platform.mk
$(DYLIB_LD) $(DYLIB_LDFLAGS) -o $(PCRE_TARGET) $(PCRE_OBJS)
......
......@@ -31,7 +31,7 @@ OS_DIR := $(shell echo $(OS_NAME) | tr '[:upper:]' '[:lower:]' )
all: $(TOPDIR)/platform.mk
$(TOPDIR)/platform.mk: sedMakeconf
sed -f sedMakeconf $(GNUR_DIR)/Makeconf >& /dev/null
sed -f sedMakeconf $(GNUR_HOME)/Makeconf >& /dev/null
echo OS_NAME = $(OS_NAME) >> platform.mk.temp
echo OS_DIR = $(OS_DIR) >> platform.mk.temp
mv platform.mk.temp $(TOPDIR)/platform.mk
......
......@@ -27,12 +27,12 @@
SRC=src
R_EXT_HEADERS := $(wildcard $(GNUR_DIR)/include/R_ext/*.h)
R_EXT_HEADERS := $(wildcard $(GNUR_HOME)/include/R_ext/*.h)
R_EXT_HEADERS_FILENAMES := $(notdir $(R_EXT_HEADERS))
R_EXT_HEADERS_LOCAL := $(wildcard $(SRC)/R_ext/*.h)
R_EXT_HEADERS_TO_LINK := $(filter-out $(notdir $(R_EXT_HEADERS_LOCAL)),$(R_EXT_HEADERS_FILENAMES))
R_HEADERS := $(wildcard $(GNUR_DIR)/include/*.h)
R_HEADERS := $(wildcard $(GNUR_HOME)/include/*.h)
R_HEADERS_FILENAMES := $(notdir $(R_HEADERS))
#$(info R_HEADERS_FILENAMES=$(R_HEADERS_FILENAMES))
R_HEADERS_LOCAL := src/libintl.h src/Rinternals.h
......@@ -45,10 +45,10 @@ all: linked
linked:
mkdir -p include
mkdir -p include/R_ext
$(foreach file,$(R_HEADERS_TO_LINK),ln -sf $(GNUR_DIR)/include/$(file) include/$(file);)
$(foreach file,$(R_HEADERS_TO_LINK),ln -sf $(GNUR_HOME)/include/$(file) include/$(file);)
cp src/libintl.h include
ed $(GNUR_DIR)/include/Rinternals.h < ed_Rinternals
$(foreach file,$(R_EXT_HEADERS_TO_LINK),ln -sf $(GNUR_DIR)/include/R_ext/$(file) include/R_ext/$(file);)
ed $(GNUR_HOME)/include/Rinternals.h < ed_Rinternals
$(foreach file,$(R_EXT_HEADERS_TO_LINK),ln -sf $(GNUR_HOME)/include/R_ext/$(file) include/R_ext/$(file);)
cp $(R_EXT_HEADERS_LOCAL) include/R_ext
touch linked
......
......@@ -39,7 +39,7 @@ endif
PKG = $(PACKAGE)
ifeq ($(GNUR_DIR),)
ifeq ($(GNUR_HOME),)
$(error must be run from top-level)
endif
......@@ -72,8 +72,8 @@ endif
libcommon: $(PKGDIR)
$(PKGDIR): $(GNUR_DIR)/library/$(PKG)
(cd $(GNUR_DIR)/library; tar cf - $(PKG)) | (cd $(FASTR_LIBDIR); tar xf -)
$(PKGDIR): $(GNUR_HOME)/library/$(PKG)
(cd $(GNUR_HOME)/library; tar cf - $(PKG)) | (cd $(FASTR_LIBDIR); tar xf -)
touch $(FASTR_LIBDIR)/$(PKG)
$(C_OBJECTS): | $(OBJ)
......
......@@ -24,7 +24,7 @@
.PHONY: cleanfft
LIB_PKG_PRE = $(OBJ)/fft.o
GNUR_FFT := $(GNUR_DIR)/src/library/stats/src/fft.c
GNUR_FFT := $(GNUR_HOME)/src/library/stats/src/fft.c
CLEAN_PKG := cleanfft
include ../lib.mk
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment