setup.sh 1.7 KB
Newer Older
1
if [ -n "$BASH_VERSION" ]; then
2
3
	command -v xargs > /dev/null || { echo >&2 "ERROR: xargs program not available."; }

4
5
6
	if [ "`uname`" = "Darwin" ]; then
		export TAPASCO_HOME=`dirname ${BASH_SOURCE[0]} | xargs cd | pwd`
	else
7
8
9
		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`
10
11
	fi
elif [ -n "$ZSH_VERSION" ]; then
12
13
14
	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`
15
else
16
	echo "WARNING: unknown shell; need to source setup.sh from the TaPaSCo root dir!"
17
18
19
20
21
	export TAPASCO_HOME=$PWD
fi
echo "TAPASCO_HOME=$TAPASCO_HOME"
export PATH=$TAPASCO_HOME/bin:$PATH
export MANPATH=$MANPATH:$TAPASCO_HOME/man
22
23
24
25
26
#if uname -a | grep -i ubuntu > /dev/null 2>&1; then
	LIB=`locate -l 1 libmpfr`
	if [[ $? -eq 0 ]]; then
		export LD_PRELOAD=$LIB
		echo "LD_PRELOAD=$LIB"
27
28
29
30
31
	else
		echo "WARNING: awk in Ubuntu 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
32
#fi