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

native build changes for Solaris/Intel

parent fb049e18
No related branches found
No related tags found
No related merge requests found
......@@ -21,13 +21,18 @@
# questions.
#
.PHONY: all clean makegnur cleangnur
# If GNUR_HOME is defined we take that as a pre-built, immutable, entity
.PHONY: all clean
export TOPDIR = $(CURDIR)
export R_VERSION = 3.1.3
ifndef GNUR_HOME
export GNUR_HOME = $(TOPDIR)/gnur/R-$(R_VERSION)
export GNUR_HOME_ORIGIN = local
else
export GNUR_HOME_ORIGIN = environment
endif
all:
......
......@@ -24,11 +24,10 @@
.PHONY: all clean
all: makegnur
$(MAKE) -f Makefile.gnur
$(MAKE) -f Makefile.platform
$(MAKE) -f Makefile.libs
ifeq "$(origin GNUR_HOME)" "environment"
ifeq ($(GNUR_HOME_ORIGIN), environment)
makegnur:
else
makegnur:
......@@ -39,9 +38,11 @@ clean: cleangnur
$(MAKE) -f Makefile.libs clean
$(MAKE) -f Makefile.platform clean
ifeq "$(origin GNUR_HOME)" "environment"
ifeq ($(GNUR_HOME_ORIGIN), environment)
$(info E)
cleangnur:
else
$(info NE)
cleangnur:
$(MAKE) -f Makefile.gnur clean
endif
......@@ -39,23 +39,65 @@
.PHONY: all config config_update build clean
OSNAME := $(shell uname)
$(info cmd=$(MAKECMDGOALS))
ifeq ($(OSNAME), Linux)
FORCE_PIC := true
else ifeq ($(OSNAME), SunOS)
FORCE_PIC := true
else ifeq ($(OSNAME), Darwin)
else
all:
@echo "This Makefile does not know how to compile for $(OSNAME)"
@false
$(error OS $(OSNAME) is not supported)
endif
all: Makefile $(GNUR_HOME) config build
all: Makefile $(GNUR_HOME) iconv config build
$(GNUR_HOME):
tar xf $(TOPDIR)/../lib/R-$(R_VERSION).tar.gz
ifeq ($(OSNAME), SunOS)
#
# Configuring GnuR for Solaris is slightly complicated for three reasons:
# 1. the default iconv utility is inadequate and has to be replaced by Gnu iconv
# 2. there is a choice of compilers, gcc or solaris studio, the latter requiring
# more configuration options
# 3. Solaris runs on x64 and Sparc
#
# Currently we only support gcc and x64 (gcc assumed to be on the PATH)
#
OS_ARCH := $(shell uname -p)
ifneq ($(OS_ARCH), i386)
$(error Solaris/SPARC not supported)
endif
ICONV := libiconv-1.14
$(shell mkdir -p iconv_install)
ICONV_INSTALL := $(abspath iconv_install)
$(info ICONV_INSTALL=$(ICONV_INSTALL))
ICONV_FLAGS := "-L$(ICONV_INSTALL)/lib -I$(ICONV_INSTALL)/include"
ICONV_CONFIG_FLAGS := CFLAGS=$(ICONV_FLAGS) CPPFLAGS=$(ICONV_FLAGS) LDFLAGS=$(ICONV_FLAGS)
iconv: $(ICONV) iconv_config iconv_build
$(ICONV):
tar xf $(TOPDIR)/../lib/$(ICONV).tar.gz
iconv_config: $(ICONV)/Makefile
$(ICONV)/Makefile:
(cd $(ICONV); ./configure --prefix $(ICONV_INSTALL) $(ICONV_CONFIG_FLAGS) > iconv_configure.log 2>&1)
iconv_build: $(ICONV)/lib/libcharset.so
$(ICONV)/lib/libcharset.so:
(cd $(ICONV); $(MAKE) && $(MAKE) install > iconv_make.log 2>&1)
else
iconv:
endif
config: $(GNUR_HOME)/Makefile config_update
ifeq ($(OSNAME), Linux)
ifeq ($(FORCE_PIC), true)
config_update: Makeconf.done
Makeconf.done: edMakeconf
......@@ -66,16 +108,25 @@ config_update:
endif
$(GNUR_HOME)/Makefile:
(cd $(GNUR_HOME); ./configure --with-x=no --without-recommended-packages >& gnur_configure.log)
(cd $(GNUR_HOME); ./configure --with-x=no --without-recommended-packages $(ICONV_CONFIG_FLAGS) > gnur_configure.log 2>&1)
build: $(GNUR_HOME)/bin/R
$(GNUR_HOME)/bin/R: $(GNUR_HOME)/Makeconf
(cd $(GNUR_HOME); make >& gnur_make.log)
(cd $(GNUR_HOME); $(MAKE) > gnur_make.log 2>&1)
clean: cleangnur
clean: cleangnur cleaniconv
rm -f Makeconf.done
cleangnur:
rm -rf R-$(R_VERSION)
ifeq ($(OSNAME), SunOS)
cleaniconv:
rm -rf $(ICONV)
rm -rf $(ICONV_INSTALL)
else
cleaniconv:
endif
......@@ -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_HOME)/Makeconf >& /dev/null
sed -f sedMakeconf $(GNUR_HOME)/Makeconf > /dev/null 2>&1
echo OS_NAME = $(OS_NAME) >> platform.mk.temp
echo OS_DIR = $(OS_DIR) >> platform.mk.temp
mv platform.mk.temp $(TOPDIR)/platform.mk
......
......@@ -26,7 +26,8 @@
# It is a "real" package, and loaded in the same way as any R package.
# We use a 'tar' file of the sources as the sentinel for whether the INSTALL step is needed
# Since this is just R code, we use GnuR to do the INSTALL
# Since this is just R code, we use GnuR to do the INSTALL. In case the system does not have R
# installed we use the one we built.
.PHONY: all
......@@ -42,7 +43,7 @@ $(PKG_TAR): $(PKG_FILES)
(cd src; tar cf ../$(PKG_TAR) *)
$(INSTALL_SENTINEL): $(PKG_TAR)
R CMD INSTALL --library=$(FASTR_LIBDIR) src
$(GNUR_HOME)/bin/R CMD INSTALL --library=$(FASTR_LIBDIR) src
clean:
rm -f $(PKG_TAR)
......
......@@ -30,6 +30,12 @@ suite = {
"sha1" : "2c9165060b91e45ac73d8cb7507ee9e52816f8b3"
},
"GNU_ICONV" : {
"path" : "lib/libiconv-1.14.tar.gz",
"urls" : ["http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz"],
"sha1" : "be7d67e50d72ff067b2c0291311bc283add36965"
},
"JDK_TOOLS" : {
"path" : "${JAVA_HOME}/lib/tools.jar",
"sha1" : "NOCHECK",
......@@ -333,7 +339,8 @@ suite = {
"com.oracle.truffle.r.native" : {
"sourceDirs" : [],
"dependencies" : [
"GNUR"
"GNUR",
"GNU_ICONV",
],
"native" : "true",
"workingSets" : "FastR",
......@@ -399,6 +406,7 @@ suite = {
"ANTLR-C",
"ANTLR",
"GNUR",
"GNU_ICONV",
],
"distDependencies" : [
"TRUFFLE",
......
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