User Tools

Site Tools


computer_setup

Computer Setup

Printing

To print in Pratt 392 login to an eecg machine and run:

lpr -Plw392

To print single sided:

lpr -o sides=one-sides -Plw392

To Setup Local Printing (thanks for figuring this out Jongsok)

First ask eecg for a samba account. They will provide an ID and a password. If you want to change the password ssh on to samba.eecg.toronto.edu (with your eecg unix username and password) and use the command /var/samba/bin/smbpasswd. Note that you can't ssh to that machine directly from Tier 2: you need to ssh to one of the eecg servers (ra, anubis, seth, etc) first and from there you can ssh to samba.eecg.

Now set up lpadmin:

1. install cupsys in your linux client machine: sudo apt-get install cupsys cupsys-bsd cupsys-client (no longer needed in Ubuntu 14.04)
2. run: lpadmin -p lw392 -v "smb://<SAMBA ID>:<SAMBA PASSWORD>@samba.eecg.toronto.edu/lw392" -E 
3. run: lpadmin -d lw392

Once that's set up, configure the printer in your Ubuntu. To do this in Ubuntu 14.04,

1. Go into Printers
2. Click on Add
3. In Enter URI, smb://samba.eecg.toronto.edu/lw392 (This is the printer in Pratt 392)
4. Choose the driver (HP Laser Jet 4100n in Pratt 392)

Printing should now work. However, it may keep on asking for password every time you print. To get rid of this, do the following:

1. Stop cups (sudo service cups stop)
2. sudo vim /etc/cups/printers.conf 
3. Near the top of file "/etc/cups/printers.conf" is a line: AuthInfoRequired username,password. Comment this out (#AuthInfoRequired username,password)
4. Save file
5. Restart cups (sudo service cups start)

Enjoy printing!

Samba Mount

To mount the eecg samba drive:

sudo apt-get install smbfs
mkdir <FOLDER>
sudo mount -t smbfs -o username=<USERNAME> //samba.eecg.toronto.edu/<USERNAME> <FOLDER>

To auto mount. Add this to /etc/fstab:

//samba.eecg.toronto.edu/<USERNAME> /home/<USERNAME>/<FOLDER> smbfs username=<USERNAME>,password=<PASSWORD>,uid=<USERNAME> 0 0

Then run:

sudo umount -a

Quartus

The Quartus license file is located at 1802@ra.eecg.toronto.edu

You can either enter this manually in Quartus → Tools → License Setup or append it to your $LM_LICENSE_FILE environment variable.

export LM_LICENSE_FILE=1802@ra.eecg.toronto.edu

This license works for any Quartus version.

Quartus 10.1 sp1 is available in /brown/r/r0/choijon5/altera/10.1/quartus

Quartus 9.1 sp2 is available in /brown/r/r0/choijon5/altera/9.1/quartus

*Note: To run Quartus GUI for 9.1sp2, run qgui inside /quartus/bin instead of quartus

Quartus 8.1 is available in /jayar/b/b3/tools/altera/quartus/quartus8.1

*Update : On the latest Kernel Version 2.6.32-32, Installing for Q10.1 and device families work fine, however, after installing SP1, Q10.1 may not launch. It will give an error similar to export: 137: 800.000: bad variable name

If this occurs, simply comment out line 137 in quartus/adm/qenv.sh. You may not need to do 1, 2 below.

If you want to install Quartus on your own machine and you are running Ubuntu, make sure it is Ubuntu 10.04. It's the only recent version that can run both Quartus 9.1 and 10.1. There are three things you need to do to get Quartus 10.1 working.

1. When installing the device families for quartus, their installation script doesn't work. So you need to manually install each device family you want by doing the following:

bash YOUR_QUARTUS_DIR/bin/quartus_sh –qinstall -qda 10.1_devices_linux/altera_installer/bin/../../devices/subscription/stratixv.qda

2. After installing quartus, run this patch to fix the frequency scaling problem.

— YOUR_QUARTUS_DIR/adm/qenv.sh 2010-11-30 07:25:42.000000000 +0100

+++ YOUR_QUARTUS_DIR/adm/qenv.sh 2010-12-09 13:29:29.601384224 +0100

@@ -134,7 +134,7 @@ export QENV_STATUS=-1 fi

-export QTB_CPU_FREQ=`cat /proc/cpuinfo | grep “cpu MHz” | cut -c 12-18 | uniq`

+export QTB_CPU_FREQ=`cat /proc/cpuinfo | grep “cpu MHz” | cut -c 12-18 | head -1`

##### Check if should be using 64-bit processing

To run this path, copy and save this content to a text file (i.e patch.txt). Than run : patch < patch.txt

3. To get usb-blaster working (this applies for both quartus 9.1 and 10.1), you need to do two things:

a. add this to the end of /etc/rc.local

mount --bind /dev/bus /proc/bus
ln -s /sys/kernel/debug/usb/devices /proc/bus/usb/devices

b. run the following:

killall jtagd
sudo /opt/altera/quartus/bin/jtagd

Contact Jongsok Choi if any questions.

Installing Quartus II in Ubuntu 14.04

Quartus II requires several 32-bit libraries. They need to be install one-by-one. When you try to install it, you'll see errors such as:

Error: save_system : /home/blair/altera/12.0/quartus/linux/jre/lib/i386/xawt/libmawt.so: libXi.so.6: 
cannot open shared object file: No such file or directory

Which can be fixed by running:

sudo apt-get install libXi6:i386

Modelsim GUI does not work with the latest version of the libfreetype6 package. Installing version 2.4.7 seems to work.

For more info, see: http://communities.mentor.com/mgcx/message/48524
https://launchpad.net/ubuntu/+source/freetype/2.4.7-2/+build/2880427
https://launchpad.net/ubuntu/+source/freetype/2.4.7-2/+build/2880429

Installing ModelSim and Quartus II 11.1 on Ubuntu 14.04 64-bit

You will need several 32-bit libraries:

$ sudo apt-get install libXi6:i386 libpng12-dev:i386 libfreetype6-dev:i386 libfontconfig1:i386 libxft2:i386 libncurses5:i386 libsm6:i386 libxtst6:i386

When you download Quartus II 11.1 from Altera you will get a file called 11.1_173_quartus_linux.sh. To get the installer to work you may need to run the following commands:

$ chmod a+x 11.1_173_quartus_linux.sh
$ ./11.1_173_quartus_linux.sh
$ cd 11.1_173_quartus_linux
$ rm altera_installer/bin/libpng12.so.0
$ bash ./setup

You will probably need to take the same steps to install the device support files and ModelSim.

  • 11.1_devices_cyclone_max_legacy_linux.sh for DE2 support and
  • 11.1_devices_stratix_hardcopy_linux.sh for DE4 support
  • 11.1_modelsim_ae_linux.sh

ModelSim requires a few extra steps:

export LD_LIBRARY_PATH=${dir}/lib32
  • edit line ~204 of altera/11.1/modelsim_ae/vco and change “linux_rh60” to “linux”.

Quartus II 64-bit

To run 64-bit Quartus II on Linux, you need to do one of two things:

1) Give a –64bit command line argument to Quartus II

quartus --64bit

or

quartus_map --64bit

2) Set a $QUARTUS_64BIT environment variable

export QUARTUS_64BIT=1

More info at: http://www.altera.com/support/kdb/solutions/rd11182008_614.html

Removing “Inconsistency detected by ld.so” Warning

In some configurations you may see the warning when you run a quartus tool:

“Inconsistency detected by ld.so: dl-close.c: 762: _dl_close: Assertion `map→l_init_called' failed!”

This occurs, for example, with Quartus II 64-Bit 15.0.1 on Ubuntu 14.04 x64.

To remove this warning:

cd ~/altera/15.0/quartus/linux64
mv libcurl.so.4 libcurl.so.4.bak
mv libccl_curl_drl.so libccl_curl_drl.so.bak
mv libcrypto.so.1.0.0 libcrypto.so.1.0.0.bak
mv libssl.so.1.0.0 libssl.so.1.0.0.bak

Modelsim

Run the following command once. (Tip: ssh no password)

Download and install Modelsim SE (http://model.com/content/modelsim-downloads) *Note: link broken. Get the installation file from another member of the LegUp team. *Note: Do not download Modelsim SE Version 10, it does not work with the site license. Use version 6 instead.

1. Go to www.cmc.ca and sign up for an account. Indicate Jason Anderson as your supervisor.

2. Once Jason approves, your subscription level will become “Designer Subscription”. You will receive a confirmation email from CMC registrar.

3. Go to http://www.cmc.ca/whatweoffer/design/cadactivate.aspx and download the CADActivate script on a tier-1 linux machine (anubis.eecg) and run it with firefox (ssh -X <login>@anubis.eecg.toronto.edu, run firefox and download the script in that firefox window). To run this script from the command line on the eecg machines: “javaws launch.jnlp”. Log in with your CMC account. You will receive another confirmation stating that your request has been received.

4. After approximately one business day, you should have access to the license. If you're on a tier-1 machine, simply source /CMC/tools/CSHRCs/MGLS_license and you're good to go. If you're on a non tier-1 machine like me, you have will have to set up SSH tunnels through a tier-1 machine. I did the following:

ssh -f -L 6056:u10e.vrg.utoronto.ca:6056 -L 7056:u10e.vrg.utoronto.ca:7056 -L 16056:u10e.vrg.utoronto.ca:16056 -L 17056:u10e.vrg.utoronto.ca:17056 seth.eecg.utoronto.ca sleep 100000000

Note: You may want to put this line in your crontab (run: $ crontab -e ) so you don't have to run this command every time you restart your computer:

@reboot /bin/sleep 30 ; ssh -f -L 6056:u10e.vrg.utoronto.ca:6056 -L 7056:u10e.vrg.utoronto.ca:7056 -L 16056:u10e.vrg.utoronto.ca:16056 -L 17056:u10e.vrg.utoronto.ca:17056 seth.eecg.utoronto.ca sleep 100000000

This will forward your local 6056 port to port 6056 on u10e.vrg through seth.eecg. The -f option means ssh is forked into background, and sleep 100000000 keeps the ssh session open for ~3 years.

Then you will have to make your environment variable to point to those ports in your .bashrc:

export MGLS_LICENSE_FILE=7056@localhost:6056@localhost:17056@localhost:16056@localhost

Also add Modelsim to your path.

export PATH=/path/to/modelsim/modeltech/linux:$PATH

Test that modelsim works:

vsim -c

QEMU

MIPS and ARM emulation support is provided by QEMU. To install QEMU in Ubuntu run the following command:

sudo apt-get install qemu-system-arm qemu-system-mips

Alternatively you can build QEMU from source (QEMU Downloads). When building from source may need to run:

sudo apt-get install zlib1g-dev libglib2.0-dev

to resolve some dependencies.

Graphviz Package

The scheduleviewer's graph display option has been enabled by default. The feature requires an additional package, graphviz-2.26 (other versions do not seem to work). Before installing graphviz, install its depedency first.

sudo apt-get install libfreetype6-dev

Now to install graphviz,

wget http://www.graphviz.org/pub/graphviz/ARCHIVE/graphviz-2.26.3.tar.gz
tar xvf graphviz-2.26.3.tar.gz
cd graphviz-2.26.3
./configure
make
sudo make install

If you do not want to install graphviz and want to disable graph display, change the line in file LEGUP_REPO/gui/scheduleviewer/scheduleviewer.pro to this,

CONFIG += debug_and_release #display_graphs

Commit Access

To get commit access to the git repository send your ~/.ssh/id_rsa.pub file to Andrew or anyone else with commit access who should follow: Getting Git Access. If this file doesn't exist run:

ssh-keygen -t rsa 

Also run the following command to add RSA identities to the authentication agent after generating a new rsa key.

ssh-add

Ensure your name and email is configured:

git config --global user.name "Full Name"
git config --global user.email "yourname@gmail.com"

If you already checked out the git repository then give yourself commit access with (run the command in the directory where the git repository is saved):

git config remote.origin.url git@legup.org:legup

You will now be able to push changes to the public repository:

git add <modified files>
git commit
git push

All commits are sent to the mailing list: legup-commits@legup.org

Make sure you subscribe here

If this is your first time using git then re-checkout the repository with commit access. NOTE: This has a different url than the public read-only git clone command on the main page and will give you commit access:

git clone git@legup.org:legup legup

To checkout the public git without commit access:

git clone git://legup.org:7326/legup legup 

Git Tips

Print off this cheat sheet before you use git: http://cheat.errtheblog.com/s/git

Use the gui:

git gui

If you want to 'git pull' but have local changes that you don't want to commit (for instance to Makefile.config). Run git stash first to save your local changes.

git stash
git pull
git stash pop

To undo a pull:

git reset --hard
  abandon everything since your last commit; this command can be DANGEROUS.  If
  merging has resulted in conflicts and you'd like to just forget about the
  merge, this command will do that.

git reset --hard ORIG_HEAD
  undo your most recent *successful* merge *and* any changes that occurred
  after.  Useful for forgetting about the merge you just did.  If there are
  conflicts (the merge was not successful), use "git reset --hard" (above)
  instead.

Setting up the cross compiler for MIPS

Note: crosstool-ng has a bunch of dependencies (libncurses5-dev, gawk, flex, bison, gpref). apt-get these first.

Go to http://crosstool-ng.org/ and download the latest version, extract the tar file and run ./configure, make, make install.

create the directory you would like to install crosstool-ng (i.e. mkdir crosstool-ng), cd crosstool-ng, ct-ng menuconfig.

this launches a GUI which allows you to choose the proper settings. Choose MIPS Little Endian 32 bit with a software FPU, and Target OS as baremetal with hardware. Choose Newlib and proper gcc version. Then run sudo ct-ng build

Building the tool takes around ~10 minutes but everything is done automatically. The MIPS binutils should be installed under ~/x-tools/mipsel-unknown-elf/bin. Add this directory to your path.

computer_setup.txt · Last modified: 2016/06/15 16:20 by bain