#!/bin/csh NeXtMidas shell instantiation script must be sourced.
#
# @author  J. Czechowski IV
# @version $Id: nmprofile,v 1.2 2007/10/03 21:19:43 ntn Exp $
#

if ($?NM_PROFILER_FLAGS) then
  echo "Starting NeXtMidas with profiler flags:"
  echo "    $NM_PROFILER_FLAGS"
  echo ""
  setenv NM_SAVE_FLAGS "$NM_JVM_FLAGS"
  setenv NM_JVM_FLAGS  "$NM_SAVE_FLAGS $NM_PROFILER_FLAGS"
  source $NM_OS/nm
  setenv NM_JVM_FLAGS  "$NM_SAVE_FLAGS"
  unsetenv NM_SAVE_FLAGS
else
  echo "ERROR: No profiler flags set. Use the following to set the profiler flags"
  echo "       for this session only:"
  echo ""
  echo "           > setenv NM_PROFILER_FLAGS [flags]"
  echo ""
  echo "       If NM_USER_PROFILER_FLAGS is set in .cshrc it will be picked up"
  echo "       by nmstart."
  echo ""
endif

