CompressonatorCLI 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. # ----------------------------------------------------------------------------------------------------------------------------------
  3. # This script launches the CompressonatorCLI executable after configuring the environment.
  4. # (c) 2017 Advanced Micro Devices Inc. All Rights Reserved.
  5. # ----------------------------------------------------------------------------------------------------------------------------------
  6. if echo "$0" | grep '^/' ; then
  7. thisScriptFullPath="$0"
  8. else
  9. thisScriptFullPath=`pwd`/$0
  10. fi
  11. # Enable the use of symbolic links to the script
  12. if [ -h ${thisScriptFullPath} ]
  13. then
  14. LINKTARGET=`readlink -f "$thisScriptFullPath"`
  15. thisScriptFullPath=${LINKTARGET}
  16. fi
  17. CMPCLI_BIN_PATH=`dirname "$thisScriptFullPath"`
  18. # Add CompressonatorCLI's binaries directory to PATH:
  19. export PATH="${CMPCLI_BIN_PATH}:$PATH"
  20. # Add CompressonatorCLI's binaries directory to LD_LIBRARY_PATH:
  21. if [ -z "$LD_LIBRARY_PATH" ]; then
  22. export LD_LIBRARY_PATH="${CMPCLI_BIN_PATH}"
  23. else
  24. export LD_LIBRARY_PATH="${CMPCLI_BIN_PATH}:$LD_LIBRARY_PATH"
  25. fi
  26. # Call CompressonatorCLI executable
  27. if [ -e $CMPCLI_BIN_PATH/CompressonatorCLI-bin ]; then
  28. $CMPCLI_BIN_PATH/CompressonatorCLI-bin "$@"
  29. else
  30. echo "Error:Cannot find CompressonatorCLI-bin"
  31. fi