The source code and dockerfile for the GSW2024 AI Lab.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

65 lines
2.1 KiB

2 months ago
  1. 4c4
  2. < # Assumes that CXX is set, and that a link to GMP header file is in ExternalLibs/include
  3. ---
  4. > # Assumes that env variable CXX is set, and that a link to GMP header file is in $COCOA_EXTLIB_DIR/include
  5. 22c22
  6. < if [ ! -d configuration ]
  7. ---
  8. > if [ -z "$COCOA_EXTLIB_DIR" ]
  9. 24c24,36
  10. < echo "$0: ERROR: please run in the CoCoALib root directory"
  11. ---
  12. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR not set."
  13. > exit 1
  14. > fi
  15. >
  16. > if [ \! "$COCOA_EXTLIB_DIR" -ef "/$COCOA_EXTLIB_DIR" ]
  17. > then
  18. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is not absolute: $COCOA_EXTLIB_DIR."
  19. > exit 1
  20. > fi
  21. >
  22. > if [ \! -d "$COCOA_EXTLIB_DIR" -o \! -d "$COCOA_EXTLIB_DIR/include" -o \! -d "$COCOA_EXTLIB_DIR/lib" ]
  23. > then
  24. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is implausible: $COCOA_EXTLIB_DIR."
  25. 28d39
  26. < umask 22
  27. 31,35c42,46
  28. < # Create tmp directory, put C prog in it, compile, run, get output, delete directory.
  29. < # TMP_DIR depends on hostname, userid, and process number to try to avoid unfortunate
  30. < # name clashes if several people try to install CoCoALib simultaneously.
  31. < TMP_DIR=configuration/gmp-version-$UID@$HOSTNAME-$$
  32. < /bin/rm -rf $TMP_DIR && mkdir $TMP_DIR
  33. ---
  34. > umask 22
  35. > TODAY=`date "+%Y-%m-%d"`
  36. > TIME=`date "+%H:%M:%S"`
  37. > TMP_DIR=/tmp/CoCoALib-config-$USER-$TODAY/gmp-version-$TIME-$$
  38. > /bin/rm -rf $TMP_DIR && mkdir -p $TMP_DIR
  39. 37c48
  40. < echobox "ERROR: $0: failed to create temporary directory \"$TMP_DIR\"";
  41. ---
  42. > echo "ERROR: $0 failed to create temporary directory \"$TMP_DIR\""
  43. 40c51,53
  44. < pushd $TMP_DIR >/dev/null
  45. ---
  46. >
  47. > cd $TMP_DIR
  48. >
  49. 52c65
  50. < $CXX -I ../ExternalLibs/include TestProg.C -o TestProg 2> /dev/null
  51. ---
  52. > $CXX -I "$COCOA_EXTLIB_DIR/include" TestProg.C -o TestProg 2> /dev/null
  53. 57,60c70,71
  54. < echo "ERROR: unable to determine version of GMP library" > /dev/stderr
  55. < echo "ERROR: (compilation failed in gmp-version.sh)" > /dev/stderr
  56. < popd
  57. < /bin/rm -rf $TMP_DIR
  58. ---
  59. > echo "ERROR: $0: unable to determine version of GMP library" > /dev/stderr
  60. > echo "ERROR: $0: (compilation failed in gmp-version.sh)" > /dev/stderr
  61. 67c78,79
  62. < popd >/dev/null
  63. ---
  64. > # Clean up TMP_DIR
  65. > cd # Leave TMP_DIR