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

4c4
< # Assumes that CXX is set, and that a link to GMP header file is in ExternalLibs/include
---
> # Assumes that env variable CXX is set, and that a link to GMP header file is in $COCOA_EXTLIB_DIR/include
22c22
< if [ ! -d configuration ]
---
> if [ -z "$COCOA_EXTLIB_DIR" ]
24c24,36
< echo "$0: ERROR: please run in the CoCoALib root directory"
---
> echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR not set."
> exit 1
> fi
>
> if [ \! "$COCOA_EXTLIB_DIR" -ef "/$COCOA_EXTLIB_DIR" ]
> then
> echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is not absolute: $COCOA_EXTLIB_DIR."
> exit 1
> fi
>
> if [ \! -d "$COCOA_EXTLIB_DIR" -o \! -d "$COCOA_EXTLIB_DIR/include" -o \! -d "$COCOA_EXTLIB_DIR/lib" ]
> then
> echo "ERROR: $0: environment variable COCOA_EXTLIB_DIR is implausible: $COCOA_EXTLIB_DIR."
28d39
< umask 22
31,35c42,46
< # Create tmp directory, put C prog in it, compile, run, get output, delete directory.
< # TMP_DIR depends on hostname, userid, and process number to try to avoid unfortunate
< # name clashes if several people try to install CoCoALib simultaneously.
< TMP_DIR=configuration/gmp-version-$UID@$HOSTNAME-$$
< /bin/rm -rf $TMP_DIR && mkdir $TMP_DIR
---
> umask 22
> TODAY=`date "+%Y-%m-%d"`
> TIME=`date "+%H:%M:%S"`
> TMP_DIR=/tmp/CoCoALib-config-$USER-$TODAY/gmp-version-$TIME-$$
> /bin/rm -rf $TMP_DIR && mkdir -p $TMP_DIR
37c48
< echobox "ERROR: $0: failed to create temporary directory \"$TMP_DIR\"";
---
> echo "ERROR: $0 failed to create temporary directory \"$TMP_DIR\""
40c51,53
< pushd $TMP_DIR >/dev/null
---
>
> cd $TMP_DIR
>
52c65
< $CXX -I ../ExternalLibs/include TestProg.C -o TestProg 2> /dev/null
---
> $CXX -I "$COCOA_EXTLIB_DIR/include" TestProg.C -o TestProg 2> /dev/null
57,60c70,71
< echo "ERROR: unable to determine version of GMP library" > /dev/stderr
< echo "ERROR: (compilation failed in gmp-version.sh)" > /dev/stderr
< popd
< /bin/rm -rf $TMP_DIR
---
> echo "ERROR: $0: unable to determine version of GMP library" > /dev/stderr
> echo "ERROR: $0: (compilation failed in gmp-version.sh)" > /dev/stderr
67c78,79
< popd >/dev/null
---
> # Clean up TMP_DIR
> cd # Leave TMP_DIR