[issm-svn] r23915 - in issm/trunk: externalpackages/boost externalpackages/dakota jenkins m4 packagers/macosx-dakota

jdquinn at issm.ess.uci.edu jdquinn at issm.ess.uci.edu
Fri May 10 20:45:57 PDT 2019


Author: jdquinn
Date: 2019-05-10 20:45:57 -0700 (Fri, 10 May 2019)
New Revision: 23915

Added:
   issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh
   issm/trunk/externalpackages/dakota/install-6.2-macosx64-static.sh
Modified:
   issm/trunk/jenkins/macosx_pine-island_dakota_static
   issm/trunk/m4/issm_options.m4
   issm/trunk/packagers/macosx-dakota/package.sh
Log:
BUG: Corrected linking of boost archives to Dakota for Mac Dakota Binaries.

Added: issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh
===================================================================
--- issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh	                        (rev 0)
+++ issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh	2019-05-11 03:45:57 UTC (rev 23915)
@@ -0,0 +1,47 @@
+#!/bin/bash
+set -eu
+
+# NOTE: Stop after boostrap phase, and run
+#
+#	bjam --debug-configuration
+#
+# to figure out which paths boost is using to include python. Make sure everyone
+# of these paths is covered by python. If not, just make symlinks in
+# externalpackages/python to what boost is expecting. There is NO WAY to get the
+# boost library to include python support without doing that.
+
+#Some cleanup
+rm -rf install boost_1_55_0 src
+mkdir install src
+
+#Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh 'https://issm.ess.uci.edu/files/externalpackages/boost_1_55_0.tar.gz' 'boost_1_55_0.tar.gz'
+
+#Untar
+tar -zxvf  boost_1_55_0.tar.gz
+
+#Move boost into install directory
+mv boost_1_55_0/* src
+rm -rf boost_1_55_0
+
+patch src/boost/atomic/detail/cas128strong.hpp ./configs/1.55/cas128strong.hpp.patch
+patch src/boost/atomic/detail/gcc-atomic.hpp ./configs/1.55/gcc-atomic.hpp.patch
+patch src/tools/build/v2/user-config.jam ./configs/1.55/user-config.jam.patch
+patch src/tools/build/v2/tools/darwin.jam ./configs/1.55/darwin.jam.patch
+patch src/tools/build/v2/tools/darwin.py ./configs/1.55/darwin.py.patch
+
+#Configure and compile
+cd src
+./bootstrap.sh \
+	--prefix="$ISSM_DIR/externalpackages/boost/install" \
+	--with-python=python
+
+#Compile boost
+# Need gcc with iconv installed in a location that has been added to your path
+# export CC=/usr/local/gfortan/bin/gcc
+# export CXX=/usr/local/gfortran/bin/g++
+./bjam toolset=darwin link=static runtime-link=static install
+
+#put bjam into install also:
+mkdir ../install/bin
+cp bjam ../install/bin


Property changes on: issm/trunk/externalpackages/boost/install-1.55-macosx-el_capitan-static.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: issm/trunk/externalpackages/dakota/install-6.2-macosx64-static.sh
===================================================================
--- issm/trunk/externalpackages/dakota/install-6.2-macosx64-static.sh	                        (rev 0)
+++ issm/trunk/externalpackages/dakota/install-6.2-macosx64-static.sh	2019-05-11 03:45:57 UTC (rev 23915)
@@ -0,0 +1,80 @@
+#!/bin/bash
+set -eu
+
+# Constants
+DAK_VER="6.2"
+
+# Some cleanup
+rm -rf build
+rm -rf install
+rm -rf tests
+rm -rf src
+mkdir build install src
+
+# Download from ISSM server
+$ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/dakota-${DAK_VER}-public.src.tar.gz" "dakota-${DAK_VER}-public-src.tar.gz"
+
+# Untar
+tar -zxvf dakota-${DAK_VER}-public-src.tar.gz
+
+# Move Dakota to src directory
+mv dakota-${DAK_VER}.0.src/* src
+rm -rf dakota-${DAK_VER}.0.src
+
+# Set up Dakota and CMake variables
+DAK_PATH=$ISSM_DIR/externalpackages/dakota
+
+export DAK_BUILD=$DAK_PATH/build
+export DAK_INSTALL=$DAK_PATH/install
+export DAK_SRC=$DAK_PATH/src
+export MPIHOME=$ISSM_DIR/externalpackages/mpich/install
+export BOOST_ROOT=$ISSM_DIR/externalpackages/boost/install
+
+# Apply patches
+cp $DAK_SRC/cmake/BuildDakotaTemplate.cmake $DAK_SRC/cmake/BuildDakotaCustom.cmake
+patch $DAK_SRC/cmake/BuildDakotaCustom.cmake configs/$DAK_VER/BuildDakotaCustom.cmake.mac.patch
+patch $DAK_SRC/cmake/DakotaDev.cmake configs/$DAK_VER/DakotaDev.cmake.patch
+patch $DAK_SRC/cmake/InstallDarwinDylibs.cmake configs/$DAK_VER/InstallDarwinDylibs.cmake.patch
+patch $DAK_SRC/CMakeLists.txt configs/$DAK_VER/CMakeLists.txt.patch
+patch src/src/NonDSampling.cpp configs/$DAK_VER/NonDSampling.cpp.patch
+patch src/src/NonDLocalReliability.cpp configs/$DAK_VER/NonDLocalReliability.cpp.patch
+patch src/packages/pecos/src/pecos_global_defs.hpp configs/$DAK_VER/pecos_global_defs.hpp.patch
+
+# Configure and build Dakota
+cd $DAK_BUILD
+cmake \
+	-C$DAK_SRC/cmake/BuildDakotaCustom.cmake \
+	-C$DAK_SRC/cmake/DakotaDev.cmake \
+	-DBUILD_STATIC_LIBS=ON \
+	-DBUILD_SHARED_LIBS=OFF \
+	-DBOOST_ROOT=$BOOST_ROOT \
+	-DBoost_LIBRARY_DIRS=$BOOST_ROOT/lib \
+	-DBoost_NO_BOOST_CMAKE=TRUE \
+	-DBoost_NO_SYSTEM_PATHS=TRUE \
+	-DCMAKE_INSTALL_PREFIX=$DAK_INSTALL \
+	-DCMAKE_C_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpicc \
+	-DCMAKE_CXX_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpicxx \
+	-DCMAKE_Fortran_COMPILER=$ISSM_DIR/externalpackages/mpich/install/bin/mpif77 \
+	-DCMAKE_CXX_FLAGS=-fdelayed-template-parsing \
+	-DHAVE_ACRO=off \
+	-DHAVE_JEGA=off \
+	$DAK_SRC
+
+if [ $# -eq 0 ];
+then
+	make
+	make install
+else
+	make -j $1
+	make -j $1 install
+fi
+
+# Set paths and library paths
+export PATH=$DAK_INSTALL/bin:$DAK_INSTALL/test:$PATH
+
+if [ -z ${DYLD_LIBRARY_PATH+x} ]
+then
+	export DYLD_LIBRARY_PATH=$DAK_INSTALL/lib:$DAK_INSTALL/bin
+else
+	export DYLD_LIBRARY_PATH=$DAK_INSTALL/lib:$DAK_INSTALL/bin:$DYLD_LIBRARY_PATH
+fi


Property changes on: issm/trunk/externalpackages/dakota/install-6.2-macosx64-static.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: issm/trunk/jenkins/macosx_pine-island_dakota_static
===================================================================
--- issm/trunk/jenkins/macosx_pine-island_dakota_static	2019-05-10 22:12:33 UTC (rev 23914)
+++ issm/trunk/jenkins/macosx_pine-island_dakota_static	2019-05-11 03:45:57 UTC (rev 23915)
@@ -12,11 +12,10 @@
 	--enable-standalone-libraries \
 	--with-matlab-dir=$MATLAB_PATH \
 	--with-triangle-dir=$ISSM_DIR/externalpackages/triangle/install \
-	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include  \
+	--with-mpi-include=$ISSM_DIR/externalpackages/mpich/install/include \
 	--with-mpi-libflags="-L$ISSM_DIR/externalpackages/mpich/install/lib -lmpi -lpmpi -lmpifort -lmpicxx" \
 	--with-petsc-dir=$ISSM_DIR/externalpackages/petsc/install  \
 	--with-scalapack-dir=$ISSM_DIR/externalpackages/petsc/install \
-	--with-blas-lapack-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-mumps-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-metis-dir=$ISSM_DIR/externalpackages/petsc/install \
 	--with-m1qn3-dir=$ISSM_DIR/externalpackages/m1qn3/install \
@@ -42,8 +41,8 @@
 						m1qn3        install.sh
 						petsc        install-3.7-macosx64-static.sh
 						triangle     install-macosx64.sh
-						boost        install-1.55-macosx-el_capitan.sh
-						dakota       install-6.2-macosx64.sh
+						boost        install-1.55-macosx-el_capitan-static.sh
+						dakota       install-6.2-macosx64-static.sh
 						shell2junit  install.sh"
 
 #-----------------#
@@ -61,6 +60,5 @@
 #as follows: runme($MATLAB_NROPTIONS). The options must be understandable
 #by Matlab and runme.m
 #ex: "'id',[101 102 103]"
-##                           bamg mesh   FS
-#PYTHON_NROPTIONS="--exclude_name 'Dakota'"
-#MATLAB_NROPTIONS="'exclude',[243,701,702,703,435,IdFromString('Dakota')]"
+#PYTHON_NROPTIONS=""
+#MATLAB_NROPTIONS=""

Modified: issm/trunk/m4/issm_options.m4
===================================================================
--- issm/trunk/m4/issm_options.m4	2019-05-10 22:12:33 UTC (rev 23914)
+++ issm/trunk/m4/issm_options.m4	2019-05-11 03:45:57 UTC (rev 23915)
@@ -477,6 +477,7 @@
 		AC_DEFINE_UNQUOTED([_DAKOTA_VERSION_],"$DAKOTA_VERSION",[Dakota version number])
 
 		DAKOTAFLAGS=""
+		dnl TODO: Should we also be checking if HAVE_BOOST before adding boost libs?
 		case "${host_os}" in
 			*cygwin*)
 				if test x$DAKOTA_VERSION = x5.1 || test x$DAKOTA_VERSION = x5.2; then
@@ -520,8 +521,12 @@
 					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H])
 					AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI])
 				else if test x$DAKOTA_VERSION = x6.1 || test x$DAKOTA_VERSION = x6.2; then
-				   DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
-					DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+					DAKOTAFLAGS="-DDISABLE_DAKOTA_CONFIG_H -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DDAKOTA_PLUGIN -DBOOST_DISABLE_ASSERTS -DDAKOTA_HAVE_BOOST_FS -DHAVE_UNISTD_H -DHAVE_SYSTEM -DHAVE_WORKING_FORK -DHAVE_WORKING_VFORK -DHAVE_SYS_WAIT_H -DHAVE_USLEEP -DDAKOTA_F90 -DDAKOTA_HAVE_MPI -DHAVE_PECOS -DHAVE_SURFPACK -DDAKOTA_UTILIB -DHAVE_ADAPTIVE_SAMPLING -DHAVE_CONMIN -DDAKOTA_DDACE -DHAVE_FSUDACE -DDAKOTA_HOPS -DHAVE_NCSU -DHAVE_NL2SOL -DHAVE_OPTPP -DDAKOTA_OPTPP -DHAVE_PSUADE -DHAVE_AMPL"
+					if test "x$enable_standalone_executables" = "xyes"; then
+						DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid $BOOST_ROOT/lib/libboost_serialization.a $BOOST_ROOT/lib/libboost_signals.a $BOOST_ROOT/lib/libboost_regex.a $BOOST_ROOT/lib/libboost_filesystem.a $BOOST_ROOT/lib/libboost_system.a"
+					else
+						DAKOTALIB="-L$DAKOTA_ROOT/lib -L$BOOST_ROOT/lib -ldakota_src -ldream -lfsudace -lddace -lnomad -lpecos_src -llhs -llhs_mods -loptpp -lsurfpack -lconmin -ldakota_src_fortran -llhs_mod -lncsuopt -lsurfpack_fortran -lteuchos -lamplsolver -lcport -ldfftpack -lfsudace -lhopspack -lnidr -lpecos -lpsuade -lsparsegrid -lboost_serialization -lboost_signals -lboost_regex -lboost_filesystem -lboost_system"
+					fi
 					AC_DEFINE([DISABLE_DAKOTA_CONFIG_H],[1],[disabling DAKOTA_CONFIG_H])
 					AC_DEFINE([DAKOTA_HAVE_MPI],[1],[enabling parallel MPI])
 				else

Modified: issm/trunk/packagers/macosx-dakota/package.sh
===================================================================
--- issm/trunk/packagers/macosx-dakota/package.sh	2019-05-10 22:12:33 UTC (rev 23914)
+++ issm/trunk/packagers/macosx-dakota/package.sh	2019-05-11 03:45:57 UTC (rev 23915)
@@ -1,38 +1,50 @@
 #!/bin/bash
 
-echo "modify generic" 
+MATLAB_PATH="/Applications/MATLAB_R2015b.app"
+PACKAGE="ISSM" # Name of directory to copy distributable files to
+TARBALL_NAME="issm-mac-static_build"
+TARBALL=$TARBALL_NAME.tar.gz
+
+# Clean up from previous packaging
+echo "Cleaning up existing assets"
+cd $ISSM_DIR
+rm -rf $PACKAGE
+mkdir $PACKAGE
+
+# Add/modify required binaries
 cd $ISSM_DIR/bin
+
+echo "Modifying generic"
 cat generic_static.m | sed -e "s/generic_static/generic/g" > generic.m
-echo "move mpiexec to bin" 
-cp ../externalpackages/mpich/install/bin/mpiexec .
-cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
 
-#Check that test101 runs
+echo "Moving mpiexec to bin"
+if [ -f ../externalpackages/mpich/install/bin/mpiexec ]; then
+	cp ../externalpackages/mpich/install/bin/mpiexec .
+	cp ../externalpackages/mpich/install/bin/hydra_pmi_proxy .
+else
+	echo "mpich not found"
+fi
+
+# Check that test218 (first Dakota test) runs
 cd $ISSM_DIR/test/NightlyRun
 rm matlab.log
-/Applications/MATLAB_R2015b.app/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',101);exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
+$MATLAB_PATH/bin/matlab -nodisplay -nojvm -nosplash -nodesktop -r "try, addpath $ISSM_DIR/bin $ISSM_DIR/lib; runme('id',218); exit; catch me,fprintf('%s',getReport(me)); exit; end" -logfile matlab.log
 
 if [[ $(cat matlab.log | grep -c SUCCESS) -lt 10 ]]; then
-	echo "test101 FAILED"
+	echo "test218 FAILED"
 	exit 1;
 else
-	echo "test101 passed"
+	echo "test218 PASSED"
 fi
 
-#Package using the Package Maker from OSX, driven by command line.
-tarball_name='issm-mac-dakota-static_build.tar.gz'
-
-echo "Cleanup first" 
+echo "Creating tarball: ${TARBALL_NAME}"
 cd $ISSM_DIR
-rm $tarball_name
+rm -f $TARBALL
+cp -rf bin lib test examples scripts $PACKAGE/
 
-echo "Creating tarball: ${tarball_name}"
 cd $ISSM_DIR
-rm -rf trunk
-mkdir trunk
-cp -rf bin lib test examples trunk/
-tar -czf $tarball_name trunk
-ls -lah $tarball_name
+tar -czf $TARBALL $PACKAGE
+ls -lah $TARBALL
 
 echo "Shipping binaries to website"
 
@@ -50,7 +62,7 @@
 source ~/.ssh/agent.sh
 ssh-add ~/.ssh/macosx-bins_richese-to-ross
 
-scp $tarball_name ross.ics.uci.edu:/var/www/html/$tarball_name
+scp $TARBALL ross.ics.uci.edu:/var/www/html/$TARBALL
 
 if [ $? -ne 0 ]; then
 	echo "The upload failed."



More information about the issm-svn mailing list