Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2015 23:07:18 +0000 (UTC)
From:      Don Lewis <truckman@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r386368 - in head/editors: openoffice-4 openoffice-devel
Message-ID:  <201505142307.t4EN7IZ4013281@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: truckman
Date: Thu May 14 23:07:17 2015
New Revision: 386368
URL: https://svnweb.freebsd.org/changeset/ports/386368

Log:
  Do not attempt to override the intent of DISABLE_MAKE_JOBS, which
  does not succeed in any case.
  
  The do-build target does not need to use bash, or even an extra
  level of shell.
  
  There are two levels of parallelism in the openoffice build framework.
  Split MAKE_JOBS_NUMBER between the two levels instead of potentially
  running MAKE_JOBS_NUMBER^2 compilations in parallel.
  
  PR:		199930
  Approved by:	mat (mentor, implicit)

Modified:
  head/editors/openoffice-4/Makefile
  head/editors/openoffice-devel/Makefile

Modified: head/editors/openoffice-4/Makefile
==============================================================================
--- head/editors/openoffice-4/Makefile	Thu May 14 22:40:44 2015	(r386367)
+++ head/editors/openoffice-4/Makefile	Thu May 14 23:07:17 2015	(r386368)
@@ -178,14 +178,9 @@ CONFIGURE_ENV+=	CC="${OOOCC}" CXX="${OOO
 GNU_CONFIGURE=	yes
 WRKSUBDIR=	${WRKDIR}/aoo-${AOOVERSION}
 WRKSRC?=	${WRKSUBDIR}/main
-BASH?=		${PREFIX}/bin/bash
 SUB_FILES=	pkg-message
 SUB_LIST=	EXECBASE=${EXECBASE} AOOTAG=${AOOTAG} AOOUDIR=${AOOUDIR}
 
-.if defined(DISABLE_MAKE_JOBS)
-MAKE_JOBS_NUMBER=	4
-.endif
-
 CONFIGURE_ARGS+=							\
 			--with-system-apache-commons=yes		\
 			--with-commons-codec-jar=${JAVALIBDIR}/commons-codec.jar \
@@ -300,7 +295,42 @@ do-build:
 	cd ${WRKSUBDIR} ; ${PRINTF} "main=active\n" >> source_config
 	cd ${WRKSUBDIR} ; ${PRINTF} "extras=active\n" >> source_config
 	cd ${WRKSRC} ; ./bootstrap
-	cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C" FBSD_LDFLAGS="${LDFLAGS}" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util  ; build.pl --all -P${MAKE_JOBS_NUMBER} -- -P${MAKE_JOBS_NUMBER}"
+	#
+	# numproc controls the number of parallel makes.
+	#
+	# dmproc is passed to dmake and controls parallelization at that
+	# level.
+	#
+	# dmproc > numproc seems to give shorter build times than
+	# numproc > dmproc.
+	#
+	# Select values for numproc and dmproc such that:
+	#  * numproc*dmproc >= MAKE_JOBS_NUMBER
+	#  * minimize numproc*dmproc-MAKE_JOBS_NUMBER
+	#  * dmproc >= numproc
+	#  * dmproc <= 2*numproc if MAKE_JOBS_NUMBER <= 3
+	#
+	cd ${WRKSRC} ; . ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ;  \
+	 export LANG=C LC_ALL=C FBSD_LDFLAGS="${LDFLAGS}" ;		  \
+	 if [ ${MAKE_JOBS_NUMBER} -le 3 ] ; then			  \
+	  numproc=1 ; dmproc=${MAKE_JOBS_NUMBER} ;			  \
+	 else								  \
+	  a=1 ;								  \
+	  while [ $$(( 2 * $${a} * $${a} )) -lt ${MAKE_JOBS_NUMBER} ]; do \
+	   a=$$(( $${a} + 1 )) ;					  \
+	  done ;							  \
+	  b=$$(( $${a} + 1 )) ;						  \
+	  ad=$$(( ( ${MAKE_JOBS_NUMBER} + $${a} - 1 ) / $${a} )) ;	  \
+	  ap=$$(( $${a} * $${ad} )) ;					  \
+	  bd=$$(( ( ${MAKE_JOBS_NUMBER} + $${b} - 1 ) / $${b} )) ;	  \
+	  bp=$$(( $${b} * $${bd} )) ;					  \
+	  if [ $${ap} -le $${bp} ]; then				  \
+	   numproc=$${a} ; dmproc=$${ad} ;				  \
+	  else								  \
+	   numproc=$${b} ; dmproc=$${bd} ;				  \
+	  fi ;								  \
+	 fi ;								  \
+	 build.pl --all -P$${numproc} -- -P$${dmproc}
 
 do-install:
 	cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; ${LS} *.tar.?z > ${WRKDIR}/INSTALLFILES

Modified: head/editors/openoffice-devel/Makefile
==============================================================================
--- head/editors/openoffice-devel/Makefile	Thu May 14 22:40:44 2015	(r386367)
+++ head/editors/openoffice-devel/Makefile	Thu May 14 23:07:17 2015	(r386368)
@@ -192,14 +192,9 @@ CONFIGURE_ENV+=	CC="${OOOCC}" CXX="${OOO
 GNU_CONFIGURE=	yes
 WRKSUBDIR=	${WRKDIR}/aoo-${AOOVERSION}
 WRKSRC?=	${WRKSUBDIR}/main
-BASH?=		${PREFIX}/bin/bash
 SUB_FILES=	pkg-message
 SUB_LIST=	EXECBASE=${EXECBASE} AOOTAG=${AOOTAG} AOOUDIR=${AOOUDIR}
 
-.if defined(DISABLE_MAKE_JOBS)
-MAKE_JOBS_NUMBER=	4
-.endif
-
 CONFIGURE_ARGS+=							\
 			--with-system-apache-commons=yes		\
 			--with-commons-codec-jar=${JAVALIBDIR}/commons-codec.jar \
@@ -312,7 +307,42 @@ do-build:
 	cd ${WRKSUBDIR} ; ${PRINTF} "main=active\n" >> source_config
 	cd ${WRKSUBDIR} ; ${PRINTF} "extras=active\n" >> source_config
 	cd ${WRKSRC} ; ./bootstrap
-	cd ${WRKSRC} ; ${SETENV} "LANG=C" "LC_ALL=C" FBSD_LDFLAGS="${LDFLAGS}" ${BASH} -c "source ${FREEBSD_ENV_SET} ; cd instsetoo_native/util  ; build.pl --all -P${MAKE_JOBS_NUMBER} -- -P${MAKE_JOBS_NUMBER}"
+	#
+	# numproc controls the number of parallel makes.
+	#
+	# dmproc is passed to dmake and controls parallelization at that
+	# level.
+	#
+	# dmproc > numproc seems to give shorter build times than
+	# numproc > dmproc.
+	#
+	# Select values for numproc and dmproc such that:
+	#  * numproc*dmproc >= MAKE_JOBS_NUMBER
+	#  * minimize numproc*dmproc-MAKE_JOBS_NUMBER
+	#  * dmproc >= numproc
+	#  * dmproc <= 2*numproc if MAKE_JOBS_NUMBER <= 3
+	#
+	cd ${WRKSRC} ; . ${FREEBSD_ENV_SET} ; cd instsetoo_native/util ;  \
+	 export LANG=C LC_ALL=C FBSD_LDFLAGS="${LDFLAGS}" ;		  \
+	 if [ ${MAKE_JOBS_NUMBER} -le 3 ] ; then			  \
+	  numproc=1 ; dmproc=${MAKE_JOBS_NUMBER} ;			  \
+	 else								  \
+	  a=1 ;								  \
+	  while [ $$(( 2 * $${a} * $${a} )) -lt ${MAKE_JOBS_NUMBER} ]; do \
+	   a=$$(( $${a} + 1 )) ;					  \
+	  done ;							  \
+	  b=$$(( $${a} + 1 )) ;						  \
+	  ad=$$(( ( ${MAKE_JOBS_NUMBER} + $${a} - 1 ) / $${a} )) ;	  \
+	  ap=$$(( $${a} * $${ad} )) ;					  \
+	  bd=$$(( ( ${MAKE_JOBS_NUMBER} + $${b} - 1 ) / $${b} )) ;	  \
+	  bp=$$(( $${b} * $${bd} )) ;					  \
+	  if [ $${ap} -le $${bp} ]; then				  \
+	   numproc=$${a} ; dmproc=$${ad} ;				  \
+	  else								  \
+	   numproc=$${b} ; dmproc=$${bd} ;				  \
+	  fi ;								  \
+	 fi ;								  \
+	 build.pl --all -P$${numproc} -- -P$${dmproc}
 
 do-install:
 	cd ${WRKSRC}/instsetoo_native/unxfbsd?.pro/Apache_OpenOffice/archive/install/${LOCALIZED_LANG}/ ; ${LS} *.tar.?z > ${WRKDIR}/INSTALLFILES



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505142307.t4EN7IZ4013281>