Changeset 28117
- Timestamp:
- 02/29/24 15:53:35 (13 months ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/packagers/mac/package-issm-mac-binaries-python-3.sh
r28116 r28117 2 2 3 3 ################################################################################ 4 # Packages and tests ISSM distributable package with MATLAB API for macOS.4 # Packages and tests ISSM distributable package for macOS with Python 3 API. 5 5 # 6 6 # Options: … … 8 8 # for some reason but build is valid. 9 9 # 10 # NOTE: The following variables *must* be defined in order for this script to11 # work properly,10 # NOTE: 11 # - Assumes that the following constants are defined, 12 12 # 13 13 # COMPRESSED_PKG … … 34 34 ## Override certain other aliases 35 35 # 36 alias cp=$(which cp)37 36 alias grep=$(which grep) 38 37 39 38 ## Constants 40 39 # 41 MATLAB_NROPTIONS="'benchmark','all','exclude',[125,126,129,234,235,418,420,435,444,445,701,702,703,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1201,1202,1203,1204,1205,1206,1207,1208,1301,1302,1303,1304,1401,1402,1601,1602,2002,2003,2004,2006,2007,2008,2010,2011,2012,2013,2020,2021,2051,2052,2053,2084,2085,2090,2091,2092,2101,2424,2425,3001:3300,3480,3481,4001:4100]" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded 42 MATLAB_PATH="/Applications/MATLAB_R2023b.app" 40 PYTHON_NROPTIONS="--benchmark all --exclude 125 126 129 234 235 418 420 435 444 445 701 702 703 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1201 1202 1203 1204 1205 1206 1207 1208 1301 1302 1303 1304 1401 1402 1601 1602 2002 2003 2004 2005 2006 2007 2008 2010 2011 2012 2013 2020 2021 2051 2052 2053 2084 2085 2090 2091 2092 2101 2424 2425 3001:3300 3480 3481 4001:4100" # NOTE: Combination of test suites from basic, Dakota, and Solid Earth builds, with tests that require a restart and those that require the JVM excluded 43 41 44 42 ## Environment 45 43 # 46 export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages' ; used when running tests44 export PATH="${ISSM_DIR}/bin:$(getconf PATH)" # Ensure that we pick up binaries from 'bin' directory rather than 'externalpackages' 47 45 48 46 ## Parse options … … 62 60 fi 63 61 64 # Check if MATLAB exists65 if ! [ -d ${MATLAB_PATH} ]; then66 echo "${MATLAB_PATH} does not point to a MATLAB installation! Please modify MATLAB_PATH variable in $(basename $0) and try again."67 exit 168 fi69 70 62 # Clean up from previous packaging 71 63 echo "Cleaning up existing assets" … … 78 70 79 71 echo "Modify generic" 80 cat generic_static. m | sed -e "s/generic_static/generic/g" > generic.m72 cat generic_static.py | sed -e "s/generic_static/generic/g" > generic.py 81 73 82 74 echo "Moving MPICH binaries to bin/" … … 140 132 echo "Running tests" 141 133 cd ${ISSM_DIR}/test/NightlyRun 142 rm matlab.log 2> /dev/null 134 rm python.log 2> /dev/null 135 136 # Set Python environment 137 export PYTHONPATH="${ISSM_DIR}/src/m/dev" 138 export PYTHONSTARTUP="${PYTHONPATH}/devpath.py" 139 export PYTHONUNBUFFERED=1 # We don't want Python to buffer output, otherwise issm.exe output is not captured 143 140 144 141 # Run tests, redirecting output to logfile and suppressing output to console 145 ${MATLAB_PATH}/bin/matlab -nojvm -nosplash -nojvm -r "try, addpath ${ISSM_DIR}/bin ${ISSM_DIR}/lib ${ISSM_DIR}/share; runme(${MATLAB_NROPTIONS}); exit; catch me,fprintf('%s',getReport(me)); exit; end" &> matlab.log142 ./runme.py ${PYTHON_NROPTIONS} &> python.log 2>&1 146 143 147 # Check that MATLAB did not exit in error 148 matlabExitedInError=`grep -c -E "Activation cannot proceed|Error in|Illegal|Invalid MEX-file|license|Warning: Name is nonexistent or not a directory" matlab.log` 144 # Check that Python did not exit in error 145 pythonExitCode=`echo $?` 146 pythonExitedInError=`grep -c -E "Error|No such file or directory|Permission denied|Standard exception|Traceback|bad interpreter|syntax error" python.log` 149 147 150 if [ ${matlabExitedInError} -ne 0]; then151 echo "---------- MATLABexited in error!----------"152 cat matlab.log153 echo "-----------End of matlab.log-----------"148 if [[ ${pythonExitCode} -ne 0 || ${pythonExitedInError} -ne 0 ]]; then 149 echo "----------Python exited in error!----------" 150 cat python.log 151 echo "-----------End of python.log-----------" 154 152 155 153 # Clean up execution directory … … 160 158 161 159 # Check that all tests passed 162 sed -i '' "/FAILED TO establish the default connection to the WindowServer/d" matlab.log # First, need to remove WindowServer error message163 numTestsFailed=`grep -c -E "FAILED|ERROR" matlab.log`160 sed -i '' "/FAILED TO establish the default connection to the WindowServer/d" python.log # First, need to remove WindowServer error message 161 numTestsFailed=`grep -c -E "FAILED|ERROR" python.log` 164 162 165 163 if [ ${numTestsFailed} -ne 0 ]; then 166 164 echo "One or more tests FAILED" 167 cat matlab.log165 cat python.log 168 166 exit 1 169 167 else … … 181 179 mkdir ${PKG}/execution 182 180 cp packagers/mac/issm-executable_entitlements.plist ${PKG}/bin/entitlements.plist 181 # ${ISSM_DIR}/scripts/py_to_pyc.sh ${PKG}/bin # Compile Python source files 183 182 echo "Cleaning up unneeded/unwanted files" 183 # rm -f ${PKG}/bin/*.py # Remove all Python scripts 184 184 rm -f ${PKG}/bin/generic_static.* # Remove static versions of generic cluster classes 185 185 rm -f ${PKG}/lib/*.a # Remove static libraries from package
Note:
See TracChangeset
for help on using the changeset viewer.