I'm on fedora 37, and i have a quartus_setup() function in my .zshrc (should also work with bash):
Code: Select all
function quartus_setup
{
VERSION=$1
if [ -z "$VERSION" ]; then
echo "missing version, reset"
unset LD_LIBRARY_PATH
unset QUARTUS_ROOTDIR
export PATH=/bin:/usr/bin:/usr/local/bin
return
fi
if [ "$VERSION" = "list" ]; then
ls -l /home/svens/altera/
return
fi
if [ ! -d "/home/svens/altera/$VERSION" ]; then
echo "Version doesn't exist"
return
fi
export LD_LIBRARY_PATH=/home/svens/altera/$VERSION/quartus/linux64/
export QUARTUS_ROOTDIR=/home/svens/altera/$VERSION/quartus
export PATH=/bin:/usr/bin:/usr/local/bin:$QUARTUS_ROOTDIR/linux64
}
my /home/svens/altera looks like:
Code: Select all
➜ ~ $ ls -l ~/altera
total 32
drwxr-xr-x 3 svens svens 4096 Mar 12 2018 13.0sp1
drwxr-xr-x 7 svens svens 4096 Dec 29 08:55 13.1
drwxr-xr-x 9 svens svens 4096 Dec 29 08:55 17.0
drwxr-xr-x 9 svens svens 4096 Sep 26 2020 17.0std
drwxr-xr-x 9 svens svens 4096 Sep 10 2020 17.1
drwxr-xr-x 9 svens svens 4096 Dec 29 08:56 20.1
drwxr-xr-x 11 root root 4096 Sep 26 2020 20.2pro
drwxr-xr-x 10 svens svens 4096 Dec 29 08:54 22.1
so with a simple 'quartus_setup <version>' i can switch between quartus versions.