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.

60 lines
1.9 KiB

3 months ago
  1. 16a17,43
  2. > # Check environment variables CXX and COCOA_EXTLIB_DIR
  3. > if [ -z "$CXX" ]
  4. > then
  5. > echo "ERROR: $0: environment variable CXX not set."
  6. > exit 1
  7. > fi
  8. >
  9. > if [ -z "$COCOA_EXTLIB_DIR" ]
  10. > then
  11. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR not set."
  12. > exit 1
  13. > fi
  14. >
  15. > if [ \! "$COCOA_EXTLIB_DIR" -ef "/$COCOA_EXTLIB_DIR" ]
  16. > then
  17. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is not absolute: $COCOA_EXTLIB_DIR."
  18. > exit 1
  19. > fi
  20. >
  21. > if [ \! -d "$COCOA_EXTLIB_DIR" -o \! -d "$COCOA_EXTLIB_DIR/include" -o \! -d "$COCOA_EXTLIB_DIR/lib" ]
  22. > then
  23. > echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is implausible: $COCOA_EXTLIB_DIR."
  24. > exit 1
  25. > fi
  26. >
  27. >
  28. >
  29. 29,30c56,59
  30. < TMP_DIR=gmp-check-cxxflags-$HOSTNAME-$$
  31. < /bin/rm -rf $TMP_DIR && mkdir $TMP_DIR
  32. ---
  33. > TODAY=`date "+%Y-%m-%d"`
  34. > TIME=`date "+%H:%M:%S"`
  35. > TMP_DIR=/tmp/CoCoALib-config-$USER-$TODAY/gmp-check-cxxflags-$TIME-$$
  36. > /bin/rm -rf $TMP_DIR && mkdir -p $TMP_DIR
  37. 53c82
  38. < $CXX $CXXFLAGS $CXXFLAGS_FOR_GMP TestProg.c -o TestProg -I ../ExternalLibs/include -L../ExternalLibs/lib $GMP_LDLIB 2> /dev/null
  39. ---
  40. > $CXX $CXXFLAGS $CXXFLAGS_FOR_GMP TestProg.c -o TestProg -I "$COCOA_EXTLIB_DIR/include" -L"$COCOA_EXTLIB_DIR/lib" $GMP_LDLIB 2> /dev/null
  41. 57a87
  42. > # Deliberately leave $TMP_DIR to assist debugging.
  43. 59,61c89
  44. < echo "ERROR: $CXX $CXXFLAGS $CXXFLAGS_FOR_GMP TestProg.c -o TestProg -I ../ExternalLibs/include -L../ExternalLibs/lib $GMP_LDLIB"
  45. < # cd ..
  46. < # /bin/rm -rf $TMP_DIR
  47. ---
  48. > echo "ERROR: $CXX $CXXFLAGS $CXXFLAGS_FOR_GMP TestProg.c -o TestProg -I \"$COCOA_EXTLIB_DIR/include\" -L\"$COCOA_EXTLIB_DIR/lib\" $GMP_LDLIB"
  49. 71,73c99,100
  50. < echo "ERROR: $0 TestProg crashed"
  51. < # cd ..
  52. < # /bin/rm -rf $TMP_DIR
  53. ---
  54. > # Deliberately leave $TMP_DIR to assist debugging.
  55. > echo "ERROR: $0: TestProg crashed (probably linker problem for libgmp)"
  56. 77c104,105
  57. < cd ..
  58. ---
  59. > # Clean up TMP_DIR
  60. > cd # Leave TMP_DIR