#!/bin/sh export LC_ALL=en_US.UTF-8 MEM_OPTS_SET_BY_USER="no" for o in $@; do case $o in -X* ) MEM_OPTS_SET_BY_USER="yes" ;; esac done if [ $MEM_OPTS_SET_BY_USER = "no" ]; then # memory options physmem_b=$(sysctl -n hw.physmem) physmem_mb=$((physmem_b/1024/1024)) physmem_mb=$((physmem_mb*3/4)) # allow 3/4 of the memory # -Xms set initial Java heap size # -Xmx set maximum Java heap size MEM_OPTS="-Xms512m -Xmx${physmem_mb}m" fi # execute the command # add the LIBBWA_PATH system parameter (not sure whether the env. var or argument alone are sufficient) JAVA_TOOL_OPTIONS="-DLIBBWA_PATH=%%PREFIX%%/lib/libfml.so" \ %%JAVA%% $MEM_OPTS -DLIBBWA_PATH=%%PREFIX%%/lib/libfml.so -jar %%JAVAJARDIR%%/GenomeAnalysisTK-%%PORTVERSION%%.jar "$@"