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

[GR-2311] Fix managed build Makefile.

parents e2231f62 8f0bf1fa
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,15 @@ gateTestLinuxNFI : ${gateTestCommon} {
}
}
gateTestManagedLinux: ${common} {
environment : {
FASTR_MANAGED : "true"
}
run : [
${gateCmd} ["Versions,JDKReleaseInfo,BuildJavaWithJavac"]
]
}
# This performs a number of "style" checks on the code to ensure it confirms to the project standards.
......@@ -161,4 +170,5 @@ builds = [
${gateStyle} {capabilities : [linux, amd64], targets : [gate], name: "gate-style-linux-amd64"}
${rbcheck} {capabilities : [linux, amd64], targets : [gate], name: "gate-rbcheck-linux-amd64"}
${internalPkgtest} {capabilities : [linux, amd64], targets : [gate], name: "gate-internal-pkgtest-linux-amd64"}
${gateTestManagedLinux} {capabilities : [linux, amd64, fast], targets : [gate], name: "gate-test-managed-linux-amd64"}
]
......@@ -22,26 +22,37 @@
#
ifeq ($(FASTR_RFFI),managed)
BASE_UNCOMPRESSED = $(addprefix $(FASTR_LIBRARY_DIR)/base/R/, base.rdb)
BASE_SCRIPT = $(addprefix $(FASTR_LIBRARY_DIR)/base/R/, base)
LIB_PKG_POST = $(BASE_UNCOMPRESSED) $(BASE_SCRIPT)
# lib.mk copies the GNU R library/base dir to the FastR library dir
# so we have to build the "uncompressed" variant of GNU R in the PRE phase.
LIB_PKG_PRE = pre.done
LIB_PKG_POST = post.done
CLEAN_PKG = clean.done
endif
include ../lib.mk
ifeq ($(FASTR_RFFI),managed)
# original base assumes that "base" DLL is loaded, we change it to check for that first
$(BASE_SCRIPT): $(GNUR_HOME)/library/base/R/base
sed 's|## populate C\/Fortran symbols|if (length(getLoadedDLLs()) > 0)|g' $(FASTR_LIBRARY_DIR)/base/R/base > $(FASTR_LIBRARY_DIR)/base/R/base.tmp
mv $(FASTR_LIBRARY_DIR)/base/R/base.tmp $(FASTR_LIBRARY_DIR)/base/R/base
# The following changes GnuR's build script makebasedb.R so that it does not
# compress the lazy load database, then it builds GnuR and copies the
# uncompressed base package database to FastR library location
$(BASE_UNCOMPRESSED): $(GNUR_HOME)/src/library/base/all.R
# compress the lazy load database, then it (re)builds GnuR
pre.done:
cp $(GNUR_HOME)/src/library/base/makebasedb.R $(GNUR_HOME)/src/library/base/makebasedb.R.tmp
sed 's|compress = TRUE|compress = FALSE|g' $(GNUR_HOME)/src/library/base/makebasedb.R.tmp > $(GNUR_HOME)/src/library/base/makebasedb.R
# force a base rebuild
rm $(GNUR_HOME)/src/library/base/all.R
(cd $(GNUR_HOME); $(MAKE))
cp $(GNUR_HOME)/library/$(PKG)/R/base.rd* $(FASTR_LIBRARY_DIR)/base/R/
touch pre.done
# original base assumes that "base" DLL is loaded, we change it to check for that first
post.done:
sed 's|## populate C\/Fortran symbols|if (length(getLoadedDLLs()) > 0)|g' $(FASTR_LIBRARY_DIR)/base/R/base > $(FASTR_LIBRARY_DIR)/base/R/base.tmp
mv $(FASTR_LIBRARY_DIR)/base/R/base.tmp $(FASTR_LIBRARY_DIR)/base/R/base
mv $(GNUR_HOME)/src/library/base/makebasedb.R.tmp $(GNUR_HOME)/src/library/base/makebasedb.R
# force a base rebuild
rm $(GNUR_HOME)/src/library/base/all.R
# rebuild GNU R in compressed mode
(cd $(GNUR_HOME); $(MAKE))
touch post.done
clean.done:
rm -f post.done pre.done
endif
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