#!/bin/bash -a #set -x # Note: Option -a means to export all shell variables. # This is the Amira startup script. # Set a default display if needed if [ "$DISPLAY" = "" ] then DISPLAY=":0.0" fi # Find out where Amira is installed. First look at the directory name... dirname=`dirname "$0"` if [ "$dirname" = "$0" ] then dirname="$PWD" fi # This is necessary with Mesa 3.0: MESA_GLX_VISUAL_HACK=1 # This is necessary for multi-threaded multi-pipe OIV OIV_MAX_CACHES=6 # # If $0 is an symbolic link, call target. Otherwise $dirname would not be # the AMIRA_ROOT installation directory... # if [ -h "$0" ] then # Filter out the target the link is pointing to # This should also work if the link or the target contain blanks nextlink=`ls -l "$0" | sed -e's/^.*-> //'` case "$nextlink" in /*) nextdir="$nextlink" ;; .*) nextdir="$dirname/$nextlink" ;; *) nextdir="$dirname/$nextlink";; esac echo Executing $nextdir... exec "$nextdir" "$@" echo Exec failed. exit 0; fi # At this point we are sure that $0 is a real file and that $dirname # is a directory. Lets get the absolute path name. absdir=`cd "$dirname"; pwd` if [ ! -d "${absdir}/bin" ] then absdir=`dirname "$absdir"` fi if [ "$AMIRA_ROOT" = "" ] then AMIRA_ROOT="$absdir" # Workaround for some problems with automounters # (not implemented in sh script...) # AMIRA_ROOT=${absdir#/tmp_mnt} # This message should only be printed if there is a developer version # installed, i.e., if at least the kernel headers exist. if [ -d "$AMIRA_ROOT/kernel" ] then if [ "$1" != "-help" ] then ##### TODO: change message for Avizo ##### echo Please set AMIRA_ROOT=$AMIRA_ROOT for package development. fi fi else echo "AMIRA_ROOT is already defined and set to $AMIRA_ROOT." echo "Searching for a skin file in $AMIRA_ROOT/share/resources/ ..." echo "NOTE: unset AMIRA_ROOT to be sure to load the right skin file." fi ###################################################################### # # Process command line options. All of them are exclusive. # ###################################################################### if [ "$1" = "-help" ] then echo echo " This is the startup script. The following options are supported:" echo echo " -help Displays this help message." echo " -version Displays version string." echo " -cmd command_string [-host hostname] [-port port]" echo " Send TCL command to running the program. Optionally the hostname" echo " and the port number can be specified. Type 'app -listen'" echo " in the console of the receiving program before." echo " -logfile Specify a file to which the program sends all output" echo " from its console." echo " -no_stencils Tell the program not to ask for stencil buffers. Needed on" echo " some PC graphics boards to exploit hardware acceleration." echo " -remoterender Enables Open Inventor's remoterender mechanism." echo " -remoterendergl Enables Open Inventor's remoterender mechanism using OpenGL textures." echo " Using this option might fix color problems occuring with '-remoterender'." echo " Note, $DISPLAY must support OpenGL." echo " -mesa Use Mesa for software rendering (if available)." echo " -nomesa Don't use Mesa for software rendering." echo " -64 Use the 64 bit version (if available)." echo " -32 Use the 32 bit version (if available)." echo echo "The following options are only relevant for the Developer Version:" echo echo " -root Find out where the program is installed" echo " -debug Executes the debug version." echo " -optimize Executes the optimized version." echo " -globus Use the version w/ globus support." echo " -gdb Starts the gdb debugger (Linux)." echo " -kdbg Starts the kdbg debugger (Linux with KDE)." echo " -idb Starts the idb debugger (Linux)." echo " -ddd Starts the ddd debugger (Linux)." echo " -val Starts the program with valgrind (Linux)." echo " -test Executes unit tests (if available). Arguments before -test are" echo " passed to main; arguments after -test are passed to googletest." echo " If you specify --gtest_filter, you also need to add -no_gui" echo " if you wish to run without GUI." echo " -ldd Uses ldd to print library depedencies (ELF system)." echo " -otool-L Uses otool -L to print library depedencies (Mac OS X)." echo exit 1 fi if [ "$1" = "-root" ] then echo echo "The program is installed in $AMIRA_ROOT" echo exit fi if [ "$1" = "-makefile" ] then if [ -f GNUmakefile ] then echo 'Error: A GNUmakefile already exists in the current directory!' exit 1; fi if [ ! -r "$AMIRA_ROOT/GNUmakefile.template" ] then echo "Error: You don't have a developer's version!" exit 1; fi cp "$AMIRA_ROOT/GNUmakefile.template" ./GNUmakefile if [ ! -f ../GNUmakefile.rules ] then if [ ! -r "$AMIRA_ROOT/packages/GNUmakefile.rules" ] then echo "Error: Your version is missing a packages/GNUmakefile.rules file!" exit 1; fi echo 'Warning: No GNUmakefile.rules found in the parent directory - created one!' cp "$AMIRA_ROOT/packages/GNUmakefile.rules" .. fi echo "Created a package Makefile in the current directory." echo "Please edit 'GNUmakefile' for your needs." exit 1 fi ###################################################################### # # Various shell functions # ###################################################################### use_mesa() { HX_MESA=1 MESADIR="${AMIRA_ROOT}/lib/Mesa${arch#arch}" MESADIR=${MESADIR%-Optimize} MESADIR=${MESADIR%-Debug} if test -r "$MESADIR/libGL.so" -o -r "$MESADIR/libGL.sl" then LD_LIBRARY_PATH="${MESADIR}:${LD_LIBRARY_PATH}" SHLIB_PATH="${MESADIR}:${SHLIB_PATH}" HX_MESA=true echo The program will use Mesa library from ${MESADIR}. else echo Mesa library not found in ${MESADIR}. unset HX_MESA fi } use_debugger() { EXEC="exec $1" MALLOC_FASTCHK=1 MALLOC_VERBOSE=2 MAKE_CFG=Debug echo "Starting the program with $1 debugger." } # # If a system libraries is missing, # we have to add the compat folder in the LD_LIBRARY_PATH # check_libraries() { # Save the original Internal Field Separator OLD_IFS=$IFS # Get the list of folders which contain compatibility libraries dirlist=$(find "${AMIRA_ROOT}/lib/compat-LinuxAMD64/" -mindepth 1 -maxdepth 1 -type d) # For each directories for dir in $dirlist do # Get files in the directory filelist=(`ls "$dir"`) # If the first library isn't find by ldconfig if [ ! "`/sbin/ldconfig -p | grep ${filelist[0]}`" ] then # Redefine the Internal Field Separator with ':' in order to run through LD_LIBRARY_PATH easier IFS=: find=0 # For each directories in LD_LIBRARY_PATH for p in ${LD_LIBRARY_PATH}; do # If the first library exists if [ -e ${p}/${filelist[0]} ] then find=1 break fi done # Restore the original Internal Field Separator IFS=$OLD_IFS # If the library hasn't found, the path is add to LD_LIBRARY_PATH if [ $find -eq 0 ] then echo "using embedded ${filelist[0]}" LD_LIBRARY_PATH="$dir:${LD_LIBRARY_PATH}" fi fi done } ###################################################################### # # Parse non-exclusive arguments. For MAKE_LOCAL_CFG see comment below. # ###################################################################### unset EXEC # # Parse startup parameters independent from the given order. # Still startup parameters must precede any filenames. # # Note: If you add options here, also describe them in the -help section AMIRA_FILE=Amira AVIZO_FILE=Avizo AMIRA_FEI_FILE=AmiraFEI AVIZO_FEI_FILE=AvizoFEI AMIRA_ZIB_FILE=AmiraZIBEdition PERGEOS_FILE=PerGeos COREPROFILEASSEMBLY_FILE=CoreProfileAssembly Amira_PRODUCT_NAME=Amira Avizo_PRODUCT_NAME=Avizo AmiraFEI_PRODUCT_NAME=Amira AvizoFEI_PRODUCT_NAME=Avizo AvizoLite_PRODUCT_NAME=Avizo AvizoEarth_PRODUCT_NAME=Avizo AvizoFire_PRODUCT_NAME=Avizo AvizoGreen_PRODUCT_NAME=Avizo AvizoToGo_PRODUCT_NAME=Avizo AmiraZIB_PRODUCT_NAME=Amira PerGeos_PRODUCT_NAME=PerGeos CoreProfileAssembly_PRODUCT_NAME=PerGeos [ "`uname -m`" = "x86_64" ] && AMIRA64=true [[ "`uname -s`" = MINGW* ]] && AMIRA64=true unset EXECUTABLE # Set EXECUTABLE unless this script is named 'start'. basename=`basename "$0"` case "$basename" in start) ;; *) EXECUTABLE="$basename" ;; esac for i in "$@" do case "$i" in -mesa) HX_MESA=1; shift ;; -nomesa) unset HX_MESA; shift ;; -remoterender) OIV_REMOTERENDER=ON; OIV_REMOTERENDER_DEBUG=ON; shift ;; -remoterendergl) OIV_REMOTERENDER=ON; OIV_REMOTERENDER_DEBUG=ON; OIV_LOWRESRENDER=1; shift ;; -64) AMIRA64=true; FORCED_ARCH=true; shift ;; -32) unset AMIRA64; FORCED_ARCH=true; shift ;; -cvd) use_debugger cvd; shift ;; -ddd) use_debugger ddd; shift ;; -dde) use_debugger dde; shift ;; -wdb) use_debugger wdb; shift ;; -gdb) use_debugger "gdb -nx --args"; USE_GDB=1; shift ;; -kdbg) use_debugger kdbg; shift ;; -idb) use_debugger "/opt/intel/idb_9.0/bin/idb -gui "; shift ;; -val|-valgrind) use_debugger "valgrind --show-reachable=yes --leak-check=full --error-limit=no --num-callers=50 --smc-check=all --track-origins=yes"; shift ;; -callgrind) use_debugger "valgrind --tool=callgrind --instr-atstart=no"; shift ;; -drd) use_debugger "valgrind --tool=drd"; shift ;; -helgrind) use_debugger "valgrind --tool=helgrind --num-callers=50 --smc-check=all --error-limit=no"; shift ;; -massif) use_debugger "valgrind --tool=massif"; shift ;; -strace) use_debugger "strace -f -o Avizo.strace"; shift;; -totalview) use_debugger /usr/totalview/bin/totalview; shift ;; -ldd) use_debugger ldd; shift ;; -otool-L) use_debugger "otool -L"; shift ;; -ogldebug) use_debugger ogldebug; shift ;; -debug) MAKE_CFG=Debug; MAKE_LOCAL_CFG=Debug; shift ;; -optimize) MAKE_CFG=Optimize; MAKE_LOCAL_CFG=Optimize; shift ;; -globus) EXECUTABLE=amiraglobusmain; shift ;; -opt) MAKE_CFG=Optimize; MAKE_LOCAL_CFG=Optimize; shift ;; -clusterdaemon) EXECUTABLE=hxvrdaemon; shift ;; -servicemanager) EXECUTABLE=hxservicemanager; shift ;; -Amira) EXECUTABLE=$AMIRA_FILE; shift ;; -Avizo) EXECUTABLE=$AVIZO_FILE; shift ;; -AvizoEarth) EXECUTABLE=AvizoEarth; shift ;; -AvizoLite) EXECUTABLE=AvizoLite; shift ;; -AvizoGreen) EXECUTABLE=AvizoGreen; shift ;; -AvizoToGo) EXECUTABLE=AvizoToGo; shift ;; -AvizoFEI) EXECUTABLE=AvizoFEI; shift ;; -AmiraFEI) EXECUTABLE=AmiraFEI; shift ;; -AmiraZIB) EXECUTABLE=$AMIRA_ZIB_FILE; shift ;; -PerGeos) EXECUTABLE=$PERGEOS_FILE; shift ;; -CoreProfileAssembly) EXECUTABLE=$COREPROFILEASSEMBLY_FILE; shift ;; -test) AMIRA_TEST=true; exec_args=( "${args[@]}" ); args=( ); shift ;; HDF5://*) AMIRA_HDF5_URL="${AMIRA_HDF5_URL} $1"; shift ;; hdf5://*) AMIRA_HDF5_URL="${AMIRA_HDF5_URL} $1"; shift ;; gsiftp://*) AMIRA_HDF5_URL="${AMIRA_HDF5_URL} $1"; shift ;; --) shift; break ;; *) args=( "${args[@]}" "$1" ); shift ;; esac done args=( "${args[@]}" "$@" ) if [ $USE_GDB ]; then SYSPYTHON=$(ldd `which gdb` | grep libpython | sed 's/.*=> \(.*\) .*/\1/') if [ "$SYSPYTHON" != "" ]; then LD_PRELOAD=$SYSPYTHON:$LD_PRELOAD fi fi #Don't mess with with python variables if the installed gdb uses python if [ "$SYSPYTHON" = "" ]; then PYTHONPATH="${AMIRA_ROOT}/lib/python:${AMIRA_LOCAL:+${AMIRA_LOCAL}/lib/$localarch:}${AMIRA_ROOT}/lib/$arch:${PYTHONPATH}" PYTHONHOME=${AMIRA_ROOT} fi EXPLICIT_CFG=1 if [ "$MAKE_CFG" = "" ] then # # By default, start the Optimize variant. # The default must be identical to the default chosen by the # arch script. # # Comment: Might be better no to set MAKE_CFG to default value here # but to get the arch script's default setting by parsing the # arch script's output. MAKE_CFG may be undefined when invoking arch. # (TODO) # MAKE_CFG=Optimize EXPLICIT_CFG=0 fi ###################################################################### # # Setting architecture variable. # # This is the architecture we are running on (Linux, Mac OS X, ...) # When calling $AMIRA_ROOT/bin/arch the variable MAKE_CFG must already # been set. We get some result like 'arch-Linux-Debug'. # arch=`"$AMIRA_ROOT/bin/arch"` ###################################################################### # # To fix the right product to use. # ###################################################################### # # Check whether the requested exec version exists. If it does not exist # try something else. # check_requested_arch() { MSG_DEBUG_TO_OPT="" MSG_OPT_TO_DEBUG="" if [ ! -x "$AMIRA_ROOT/bin/$arch/$1" ] then case $MAKE_CFG in Debug) [ $EXPLICIT_CFG -eq 1 ] && MSG_DEBUG_TO_OPT="This program is not installed in debug version, starting optimize." MAKE_CFG=Optimize ;; Optimize) [ $EXPLICIT_CFG -eq 1 ] && MSG_OPT_TO_DEBUG="This program is not installed in optimized version, starting debug version." MAKE_CFG=Debug ;; *) echo "Can't find a running version for $arch." exit 1; esac # # Note: the arch script uses the environment variable # $arch, if set. Since this is set to a nonfunctional value # at this point, it needs to be unset before invoking the arch # script here. Remember that ALL variables are exported due to # the -a setting at the first line of the shell script. # unset arch arch=`"$AMIRA_ROOT/bin/arch"` fi } # # if architecture was forced by a architecture flag "-32" or "-64" and # executable was not found, retry without any architecture flag. # check_requested_forced_arch() { MSG_32_TO_64="" MSG_64_TO_32="" if [ ! -z "$FORCED_ARCH" ] && [ ! -x "$AMIRA_ROOT/bin/$arch/$1" ] then if [ -z "$AMIRA64" ]; then MSG_32_TO_64="This program is not installed in 32-bit version, trying to start 64-bit version." AMIRA64=true else MSG_64_TO_32="This program is not installed in 64-bit version, trying to start 32-bit version." unset AMIRA64 fi arch=`"$AMIRA_ROOT/bin/arch"` if [ ! -x "$AMIRA_ROOT/bin/$arch/$1" ]; then case $MAKE_CFG in Debug) [ $EXPLICIT_CFG -eq 1 ] && MSG_DEBUG_TO_OPT="This program is not installed in debug version, starting optimize." MAKE_CFG=Optimize ;; Optimize) [ $EXPLICIT_CFG -eq 1 ] && MSG_OPT_TO_DEBUG="This program is not installed in optimized version, starting debug version." MAKE_CFG=Debug ;; *) echo "Can't find a running version for $arch." exit 1; esac arch=`"$AMIRA_ROOT/bin/arch"` fi fi } # # To display messages about arch modifications. # display_msgs() { if [ "$MSG_DEBUG_TO_OPT" != "" ]; then echo $MSG_DEBUG_TO_OPT fi if [ "$MSG_OPT_TO_DEBUG" != "" ]; then echo $MSG_OPT_TO_DEBUG fi if [ "$MSG_32_TO_64" != "" ]; then echo $MSG_32_TO_64 fi if [ "$MSG_64_TO_32" != "" ]; then echo $MSG_64_TO_32 fi } # To know the registry filename according to the product. PRODUCT_REG_FILENAME=".AmiraRegistry" # To save some variables values. OLD_ARCH=$arch OLD_MAKE_CFG=$MAKE_CFG OLD_AMIRA64=$AMIRA64 # # If no product has been specified, we try to launch an amira version. # If no amira version exits, we try to launch Avizo. # If no Amira and Avizo version, try to launch PerGeos. # if [ "$EXECUTABLE" = "" ]; then # Searching for a version. for main in $AVIZO_FILE $AMIRA_FILE $PERGEOS_FILE $AVIZO_FEI_FILE $AMIRA_FEI_FILE $AMIRA_ZIB_FILE do # We had to reset some variables that might have been modified during search in earlier iteration. arch=$OLD_ARCH MAKE_CFG=$OLD_MAKE_CFG AMIRA64=$OLD_AMIRA64 check_requested_arch $main check_requested_forced_arch $main if [ ! -z $AMIRA64 ] && [ ! -f "$AMIRA_ROOT/bin/$arch/$main" ]; then # Unset AMIRA64 and try to find 32-bit arch (for instance on MacX) unset AMIRA64 check_requested_arch $main check_requested_forced_arch $main # If no 32-bit exe is found, then restore AMIRA64 as it was [ ! -f "$AMIRA_ROOT/bin/$arch/$main" ] && AMIRA64=$OLD_AMIRA64 fi if [ -f "$AMIRA_ROOT/bin/$arch/$main" ]; then # An amira version has been found. # Messages about arch modification can be displayed. display_msgs EXECUTABLE=$main break fi done else # Searching for the specified product. check_requested_arch $EXECUTABLE check_requested_forced_arch $EXECUTABLE if [ ! -z $AMIRA64 ] && [ ! -f "$AMIRA_ROOT/bin/$arch/$EXECUTABLE" ]; then # Unset AMIRA64 and try to find 32-bit arch (for instance on MacX) unset AMIRA64 check_requested_arch $EXECUTABLE check_requested_forced_arch $EXECUTABLE # If no 32-bit exe is found, then restore AMIRA64 as it was [ ! -f "$AMIRA_ROOT/bin/$arch/$EXECUTABLE" ] && AMIRA64=$OLD_AMIRA64 fi if [ -f "$AMIRA_ROOT/bin/$arch/$EXECUTABLE" ]; then # Messages about arch modification can be displayed (product was found). display_msgs else echo "$EXECUTABLE file was not found in $arch!" exit 1 fi fi if [ "$EXECUTABLE" = "" ]; then # No product has been found. echo "No product found in $arch!" exit 1 fi PRODUCT_NAME="$(eval echo \${${EXECUTABLE}_PRODUCT_NAME})" echo Using $arch ... if [ "$MAKE_LOCAL_CFG" = "" ] then # # MAKE_LOCAL_CFG specifies whether local packages should be taken from # the Debug or from the Optimize tree. Usually, MAKE_LOCAL_CFG should be # the same as MAKE_CFG. # The official developer version only contains the Optimize tree. In this # case MAKE_CFG is set automatically to Optimize (see above). However, # using the -debug option it is still possible to run local packages in # Debug mode. # MAKE_LOCAL_CFG=$MAKE_CFG fi localarch=`env -i MAKE_CFG=$MAKE_LOCAL_CFG AMIRA64=$AMIRA64 "$AMIRA_ROOT/bin/arch"` # # Handling MESA flag. # if [ "$HX_MESA" = 1 ] then use_mesa; fi ###################################################################### # # Set more required environment variables # ###################################################################### # The variable HX_DATADIR may contain a list of data directories which # are included in the file browser's easy access menu. $AMIRA_ROOT/data # should always be included in this list so that users can easily # execute the tutorials and demos. HX_DATADIR=${HX_DATADIR:-$AMIRA_ROOT/data} case $arch in *Linux*) # This is for Linux. # Detect system libraries and add the compatibility folder needed in the LD_LIBRARY_PATH check_libraries; LD_LIBRARY_PATH="${AMIRA_ROOT}/python/lib:${AMIRA_ROOT}/lib/$arch:${AMIRA_ROOT}/lib/$arch/hxquant2plugin:${AMIRA_ROOT}/lib:${AMIRA_LD_LIBRARY_PATH}:${AVIZO_LD_LIBRARY_PATH}:${AMIRA_ROOT}/share/license/FLEXnet:${LD_LIBRARY_PATH}" ;; *MacX*) # this is for mac DYLD_LIBRARY_PATH="${AMIRA_ROOT}/lib/$arch:${AMIRA_ROOT}/lib/$arch/hxquant2plugin:${AMIRA_ROOT}/lib:/usr/lib:${AMIRA_LD_LIBRARY_PATH}:${AVIZO_LD_LIBRARY_PATH}:${AMIRA_ROOT}/share/license/FLEXnet:${DYLD_LIBRARY_PATH}" ;; *Win*) ;; *) echo "Unexpected architecture $arch" exit ;; esac # This application is based on Open Inventor 3D toolkit, which requires this variables to be set... if [ "$OIVHOME" = "" ] then OIVHOME="${AMIRA_ROOT}/lib/oiv" fi if [ "$OIV_PSFONT_PATH" = "" ] then OIV_PSFONT_PATH="${AMIRA_ROOT}/share/fonts" if [ -d /usr/lib/X11/fonts/Type1 ] then OIV_PSFONT_PATH="/usr/lib/X11/fonts/Type1" fi if [ -d /usr/openwin/lib/X11/fonts/Type1/outline ] then OIV_PSFONT_PATH="/usr/openwin/lib/X11/fonts/Type1/outline" fi if [ -d /usr/lib/X11/fonts/type1.st/typefaces ] then OIV_PSFONT_PATH="/usr/lib/X11/fonts/type1.st/typefaces" fi # echo "OIV_PSFONT_PATH=$OIV_PSFONT_PATH" fi if [ "$HOSTNAME" = "" ] then HOSTNAME=`hostname|tr '[a-z]' '[A-Z]'` fi # Store the architecture string in an environment variable. Some methods # in HxResource.cc rely on this. HX_EXEC_ARCH=$arch # These variables are used to configure Amira's job list. Don't know # exactly the details... HX_SCHEDULE_DEBUG=0 HX_SCHEDULE_PORT=5432 # Set DCMTK DICOM dictionary path DCMDICTPATH="$AMIRA_ROOT/share/dicom/dicom.dic" ###################################################################### # # Execute the application # ###################################################################### # source additional config files APP_ROOT="$AMIRA_ROOT" confdir="$dirname/env.d" if [ -d "$confdir" -a -r "$confdir" -a -x "$confdir" ]; then for i in "$confdir"/*.sh; do if [ -f "$i" -a -r "$i" ] ; then echo "sourcing $i" . "$i" fi done fi unset i if [ "$1" = "-workshop" ] then shift exec workshop -D "${AMIRA_ROOT}/bin/${arch}/$EXECUTABLE" "${args[@]}" echo Couldn\'t start workshop. exit 0 fi if [ "$1" = "-purify-inst" ] then shift echo "Instrumenting executable $EXECUTABLE" purify "${args[@]}" "${AMIRA_ROOT}/bin/${arch}/$EXECUTABLE" mv amira.pure "${AMIRA_ROOT}/bin/${arch}/amira.pure" echo You may start the purified version with -purify now. exit 0 fi if [ "$1" = "-purify" ] then shift echo "Starting purified executable" "${AMIRA_ROOT}/bin/${arch}/amira.pure" "${args[@]}" exit 0 fi LOAD="${AMIRA_ROOT}/lib/${arch}/ld-linux.so.2" if [ -x "$LOAD" ] then export LD_PRELOAD="libGLU.so " EXEC="$LOAD" fi if [ "$EXEC" = "" ] then EXEC=exec fi # Check if SELinux is enabled and optionally adjust the security context. if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then if [ -f "${AMIRA_ROOT}/lib/${arch}/libacml.so" ] || \ [ -f "${AMIRA_ROOT}/lib/${arch}/libacml_mp.so" ] || \ [ -f "${AMIRA_ROOT}/lib/${arch}/libacml_mv.so" ]; then if !(ls --scontext ${AMIRA_ROOT}/lib/${arch}/libacml*.so | grep -q textrel_shlib_t); then echo "SELinux seems to be enabled." echo "" echo "In order to function properly, ${PRODUCT_NAME} requires the modification of the security" echo "context of some shared object files so they can be relocated in memory. By" echo "entering \"y\", you accept the required modifications and the following command" echo "will be applied:" echo "" echo " chcon -v -t texrel_shlib_t "${AMIRA_ROOT}"/lib/${arch}/lib*.so" echo "" echo "By entering \"n\", the command will not be applied and ${PRODUCT_NAME} will not be able" echo "to load some modules and operate properly. Please consult the ${PRODUCT_NAME} console" echo "for details." echo "" echo "Note: If you started this script in the background, you will not be able to" echo "enter your choice directly. In this case, put the script into the foreground" echo "by entering \"fg\" at the prompt below, and then make you choice." echo "" echo "Do you accept the security context modifications? (Y/n)" read choice if [ "$choice" != "n" ] && [ "$choice" != "N" ]; then echo "chcon -v -t texrel_shlib_t "${AMIRA_ROOT}"/lib/${arch}/lib*.so" chcon -v -t texrel_shlib_t "${AMIRA_ROOT}"/lib/${arch}/lib*.so > /dev/null [ $? -ne 0 ] && exit $? fi fi fi fi # Actually start Amira EXECUTABLE="${AMIRA_ROOT}/bin/${arch}/$EXECUTABLE" case $arch in *Win*) unset AMIRA_ROOT ;; esac if [ -n "$AMIRA_TEST" ] then echo "Executing tests ..." if [ "${args[*]/--gtest_filter/}" = "${args[*]}" ] then ${EXEC} "$EXECUTABLE" "${exec_args[@]}" -no_gui -logfile /dev/null -test "${args[@]}" --gtest_filter=-*_FLAKY*:*_DATA*:*_GUI*:*_NETWORK*:*_NPURE*:*_E3MS*:*_E4MS*:*_E5MS*:*_E6MS*:*_E7MS*:*_CUDA*:HXMETROLOGYMEASURESDATA_*:HXMETROLOGYFITTINGPRIMITIVES_* else ${EXEC} "$EXECUTABLE" "${exec_args[@]}" -test "${args[@]}" fi fi if [ "$AMIRA_START_SCRIPT" != "" ] ; then XMODIFIERS="" ${EXEC} "$EXECUTABLE" "$AMIRA_START_SCRIPT" "${args[@]}" else XMODIFIERS="" ${EXEC} "$EXECUTABLE" "${args[@]}" fi