setup.sh 1.76 KB
Newer Older
1
2
3
4
5
6
if which locate > /dev/null 2>&1; then
  LIBMPFR=`locate -l1 libmpfr`
else
  LIBMPFR=`find /usr -name 'libmpfr*so*' 2>/dev/null | head -1`
fi

7
if [ -n "$BASH_VERSION" ]; then
8
9
	command -v xargs > /dev/null || { echo >&2 "ERROR: xargs program not available."; }

10
11
12
	if [ "`uname`" = "Darwin" ]; then
		export TAPASCO_HOME=`dirname ${BASH_SOURCE[0]} | xargs cd | pwd`
	else
13
14
15
		command -v realpath > /dev/null || command -v readlink > /dev/null ||  { echo "ERROR: neither realpath nor readlink programs are available."; }
		command -v xargs > /dev/null && command -v realpath > /dev/null && export TAPASCO_HOME=`dirname ${BASH_SOURCE[0]} | xargs realpath`
		command -v xargs > /dev/null && command -v readlink > /dev/null && export TAPASCO_HOME=`dirname ${BASH_SOURCE[0]} | xargs readlink -f`
16
17
	fi
elif [ -n "$ZSH_VERSION" ]; then
18
19
20
	command -v realpath > /dev/null || command -v readlink > /dev/null ||  { echo "ERROR: neither realpath nor readlink programs are available."; }
	command -v xargs > /dev/null && command -v realpath > /dev/null && export TAPASCO_HOME=`dirname ${(%):-%x} | xargs realpath`
	command -v xargs > /dev/null && command -v readlink > /dev/null && export TAPASCO_HOME=`dirname ${(%):-%x} | xargs readlink -f`
21
else
22
	echo "WARNING: unknown shell; need to source setup.sh from the TaPaSCo root dir!"
23
24
25
26
27
	export TAPASCO_HOME=$PWD
fi
echo "TAPASCO_HOME=$TAPASCO_HOME"
export PATH=$TAPASCO_HOME/bin:$PATH
export MANPATH=$MANPATH:$TAPASCO_HOME/man
28
29
30
31
32
33
34
35
if [[ -n $LIBMPFR ]]; then
	export LD_PRELOAD=$LIBMPFR
	echo "LD_PRELOAD=$LIBMPFR"
else
	echo "WARNING: awk in modern Linux is incompatible with Vivado's old libmpfr.so" >&2
	echo "This can be fixed by pre-loading a new libmpfr.so, but none was found in /usr/lib." >&2
	echo "If you run into problems (awk: symbols not found), please install libmpfr."
fi