Makefile revision 5690
4737N/A#
4737N/A# CDDL HEADER START
4737N/A#
4737N/A# The contents of this file are subject to the terms of the
4737N/A# Common Development and Distribution License (the "License").
4737N/A# You may not use this file except in compliance with the License.
4737N/A#
4737N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
4737N/A# or http://www.opensolaris.org/os/licensing.
4737N/A# See the License for the specific language governing permissions
4737N/A# and limitations under the License.
4737N/A#
4737N/A# When distributing Covered Code, include this CDDL HEADER in each
4737N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
4737N/A# If applicable, add the following below this CDDL HEADER, with the
4737N/A# fields enclosed by brackets "[]" replaced with your own identifying
4737N/A# information: Portions Copyright [yyyy] [name of copyright owner]
4737N/A#
4737N/A# CDDL HEADER END
4737N/A#
4737N/A
4737N/A#
5336N/A# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
4737N/A#
5680N/ABUILD_BITS= 64
4737N/Ainclude ../../make-rules/shared-macros.mk
4737N/A
4737N/ACOMPONENT_NAME= R
5363N/ACOMPONENT_VERSION= 3.2.3
4737N/ACOMPONENT_PROJECT_URL= http://www.r-project.org/
4737N/ACOMPONENT_ARCHIVE_HASH= \
5363N/A sha256:b93b7d878138279234160f007cb9b7f81b8a72c012a15566e9ec5395cfd9b6c1
4737N/ACOMPONENT_ARCHIVE_URL= http://cran.mtu.edu/src/base/R-3/$(COMPONENT_ARCHIVE)
4737N/ACOMPONENT_BUGDB= utility/r
4737N/A
5363N/ATPNO= 26540
4737N/A
5680N/A# Need to build the tests before using them.
5680N/ASYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64)
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
4737N/A
4737N/ACOMPONENT_PRE_CONFIGURE_ACTION = \
4737N/A ($(CLONEY) $(SOURCE_DIR) $(@D))
4737N/A
4737N/A# Get rid of compiler path set in RUNPATH
4737N/ALDFLAGS += $(studio_NORUNPATH)
4737N/A
4737N/ALDFLAGS += $(CC_BITS)
4737N/A
4737N/ALDFLAGS += $(studio_PIC)
4737N/ALDFLAGS += $(LD_DEF_LIBS)
4737N/A
5680N/ASTUDIO_LIBS_PATH = $(USRLIBDIR)/studio/64
5690N/A# R_LIBS_PATH is used when creating /usr/lib/64/R/etc/Makeconf
5690N/A# Using a resolved pathname here (rather than say $(USRLIBDIR64)/R/lib) so
5690N/A# that the Makeconf-GNU.patch patch used by the COMPONENT_POST_INSTALL_ACTION
5690N/A# will just work on both platforms.
5690N/AR_LIBS_PATH = /usr/lib/64/R/lib
4737N/AJAVA_LIBS_PATH = $(JAVA8_HOME)/jre/lib/$(MACH64)/server
4737N/A
4737N/ALDFLAGS += -L$(STUDIO_LIBS_PATH) -R$(STUDIO_LIBS_PATH) \
4737N/A -lsunperf -lfsu -lmtsk -lpicl -lkstat
4737N/A
5487N/A# Augment the PATH and set CC/CXX/F95 such that the build environment doesn't
5487N/A# leak into usr/lib/64/etc/Makeconf and force consumers to have a setup like
5487N/A# our build environment to build R modules.
5680N/Aexport PATH=$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
5487N/ACC = cc
5487N/ACXX = CC
5487N/AF95 = f95
5672N/Aifeq ($(strip $(PARFAIT_BUILD)),yes)
5680N/Aexport PATH=$(PARFAIT_TOOLS):$(SPRO_VROOT)/bin:$(USRBINDIR):$(GNUBIN)
5672N/Aendif
5672N/A
4737N/A
4737N/ACONFIGURE_ENV += F77="$(F95) $(CC_BITS)"
4737N/ACONFIGURE_ENV += FC="$(F95) $(CC_BITS)"
4737N/A
5680N/A# For now, R is built with a very specific set of optimization flags to match
5680N/A# Oracle-provided builds. These should be re-evaluated when upgrading to
5680N/A# Studio 12.5 or later or when next upgrading R.
5680N/Astudio_OPT= -xO3
5680N/Astudio_XBITS=
5680N/Astudio_XREGS=
5680N/Astudio_IROPTS=
5680N/Astudio_C99MODE= $(studio_C99_ENABLE)
5680N/Astudio_ALIGN=
5680N/Astudio_MT=
5594N/A
5680N/ACFLAGS.studio += -xlibmieee
5680N/ACXXFLAGS += -std=c++11
5594N/A# We (the Userland) team don't need -D__MATHERR_RENAME_EXCEPTION for the
5594N/A# creation of the R packages we provide in Solaris. It would be needed by
5594N/A# our customers that try to install R packages that use C++. And they would
5594N/A# be using the version of the Studio compilers on their machine(s) to do this.
5594N/A# Studio 12.5 will hopefully automatically provide this definition when C++
5594N/A# code is compiled with "-std=c++11". When that version of the Studio
5594N/A# compilers is released, we should encourage customers to install it, but
5594N/A# for those still using Studio 12.4, this definition will continue to be needed.
5680N/ACXXFLAGS += -D__MATHERR_RENAME_EXCEPTION
5680N/ALDFLAGS += -L$(R_LIBS_PATH) -R$(R_LIBS_PATH)
5680N/A
5680N/ACONFIGURE_ENV += CPICFLAGS="$(studio_PIC)"
4737N/ACONFIGURE_ENV += FPICFLAGS="$(studio_PIC)"
5680N/ACONFIGURE_ENV += FFLAGS="$(studio_OPT) $(CC_BITS)"
5680N/ACONFIGURE_ENV += FCFLAGS="$(studio_OPT) $(CC_BITS)"
4737N/ACONFIGURE_ENV += FCLIBS="-lsunperf -lfsu -lsunmath"
4737N/ACONFIGURE_ENV += FLIBS="-lsunperf -lfsu -lsunmath"
5450N/A# Needed so that R packages using C++ code can link against the standard
5450N/A# C++ libraries.
5487N/ACONFIGURE_ENV += SHLIB_CXXLDFLAGS="-lCrunG3"
4737N/A
4737N/A# Set the various Java variables otherwise it auto-detects the 32-bit ones.
4737N/ACONFIGURE_ENV += JAVA_CPPFLAGS="-I$(JAVA8_HOME)/jre/../include -I$(JAVA8_HOME)/jre/../include/solaris"
4737N/ACONFIGURE_ENV += JAVA_LIBS="-L$(JAVA_LIBS_PATH) -R$(JAVA_LIBS_PATH) -ljvm"
4737N/A
4737N/A# From Brian Whitney:
4737N/A# You need to define this option on SPARC, otherwise you will get quad
4737N/A# arithmetic on SPARC but not on x86. Really makes some R functions run
4737N/A# very slow on SPARC (COR path).
5680N/ACONFIGURE_OPTIONS.sparc += --disable-long-double
4737N/A
4737N/ACONFIGURE_OPTIONS += --enable-R-shlib
4737N/ACONFIGURE_OPTIONS += --with-blas='-lsunperf'
4737N/ACONFIGURE_OPTIONS += --with-ICU
4737N/ACONFIGURE_OPTIONS += --with-lapack
4737N/ACONFIGURE_OPTIONS += --with-recommended-packages
4737N/ACONFIGURE_OPTIONS += --with-tcltk
4737N/ACONFIGURE_OPTIONS += --enable-prebuilt-html
4737N/A
5684N/A# Supply Makeconf files for both the Studio and the GNU C, C++ and Fortran
5684N/A# compilers.
5684N/ACOMPONENT_POST_INSTALL_ACTION += \
5684N/A $(MV) $(PROTOUSRLIBDIR64)/R/etc/Makeconf \
5684N/A $(PROTOUSRLIBDIR64)/R/etc/Makeconf.Studio ; \
5684N/A $(CP) $(PROTOUSRLIBDIR64)/R/etc/Makeconf.Studio \
5684N/A $(PROTOUSRLIBDIR64)/R/etc/Makeconf.GNU ; \
5684N/A (cd $(PROTOUSRLIBDIR64)/R/etc ; $(GPATCH) --strip=0 \
5684N/A < $(COMPONENT_DIR)/files/Makeconf-GNU.patch) ;
5684N/A
4737N/ACOMPONENT_PRE_TEST_ACTION = \
4737N/A $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
4737N/A
4897N/ACOMPONENT_PRE_SYSTEM_TEST_ACTION = \
4897N/A $(RM) $(BUILD_DIR_64)/tests/Examples/*.prev
4897N/A
4737N/A# Increase stack limit to allow the "infinite recursion" test to work.
4737N/ACOMPONENT_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
4897N/ACOMPONENT_SYSTEM_TEST_ENV_CMD = ulimit -Ss 32768 ; $(ENV)
4737N/A
5336N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
4737N/A
4737N/ACOMPONENT_TEST_TRANSFORMS += \
4737N/A '-n ' \
4737N/A '-e "/^Testing examples for package /p" ' \
4737N/A '-e "/^running /p" ' \
5336N/A '-e "/^ expect some differences/p" ' \
5336N/A '-e "/comparing.*datetime.Rout/d" ' \
5336N/A '-e "/comparing.*reg-examples3.Rout/d" ' \
5336N/A '-e "/^ comparing /p" '
4737N/A
4897N/A# Use the installed version of R, not the one in the build area.
4897N/A# These definitions override those found in .../test/Makefile.
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += R="LANGUAGE=en LC_ALL=C SRCDIR=$(BUILD_DIR_64)/tests R_DEFAULT_PACKAGES= $(USRBINDIR)/R --vanilla"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += R2="R_DEFAULT_PACKAGES= $(USRBINDIR)/R --vanilla"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += R3="$(USRBINDIR)/R CMD check"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += RDIFF="$(USRBINDIR)/R CMD Rdiff"
5680N/ACOMPONENT_SYSTEM_TEST_ARGS += RDCONV="LC_CTYPE=C $(USRBINDIR)/R CMD Rdconv"
4897N/A
4897N/ACOMPONENT_TEST_ARGS = -k -i
4897N/ACOMPONENT_SYSTEM_TEST_ARGS += -k -i
4737N/A
4737N/AREQUIRED_PACKAGES += image/library/libjpeg
4737N/AREQUIRED_PACKAGES += image/library/libpng
4737N/AREQUIRED_PACKAGES += image/library/libtiff
4737N/AREQUIRED_PACKAGES += library/desktop/cairo
4737N/AREQUIRED_PACKAGES += library/desktop/pango
4737N/AREQUIRED_PACKAGES += library/glib2
4896N/AREQUIRED_PACKAGES += library/icu
4737N/AREQUIRED_PACKAGES += library/pcre
4739N/AREQUIRED_PACKAGES += library/readline
4737N/AREQUIRED_PACKAGES += library/zlib
4737N/AREQUIRED_PACKAGES += shell/bash
4737N/AREQUIRED_PACKAGES += system/library/fortran-runtime
4898N/AREQUIRED_PACKAGES += system/library/iconv
4737N/AREQUIRED_PACKAGES += system/library/math
4737N/AREQUIRED_PACKAGES += system/library/sunperf
4737N/AREQUIRED_PACKAGES += web/curl
4737N/AREQUIRED_PACKAGES += x11/library/libx11
4737N/AREQUIRED_PACKAGES += x11/library/libxmu
4737N/AREQUIRED_PACKAGES += x11/library/toolkit/libxt