ubuntu, feap, and virtualization - stanford...
TRANSCRIPT
![Page 1: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/1.jpg)
Ubuntu, FEAP, and Virtualiza3on
Jonathan Wong
Lab Mee3ng
11/08/10
![Page 2: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/2.jpg)
Mo3va3on
Compiling and opera3ng FEAP requires knowledge of Unix/Posix systems Being comfortable using command-‐line Naviga3ng the file system
Modifying environment variables
Basic knowledge about compilers Compiler flags
Loca3on of required headers and libraries
Understanding how to interpret compile and run3me errors (requires actual experience!)
Google is some3mes useful.
![Page 3: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/3.jpg)
Mo3va3on -‐ Virtualiza3on
What is soVware virtualiza3on? A virtual machine (VM) is a soVware implementa3on of a machine (i.e. a
computer) that executes instruc3ons like a physical machine.
The main advantages of system VMs are: mul3ple OS environments can co-‐exist on the same computer (isolated) the virtual machine can provide an instruc3on set architecture (ISA) that is
somewhat different from that of the real machine applica3on provisioning, maintenance, high availability and disaster recovery[2]
The main disadvantages of system VMs are: a virtual machine is less efficient than a real machine when it accesses the
hardware indirectly when mul3ple VMs are concurrently running on the same physical host, each VM
may exhibit a varying and unstable performance, which highly depends on the workload imposed on the system by other VMs, unless proper techniques are used for temporal isola3on among virtual machines.
[hbp://en.wikipedia.org/wiki/Virtual_machine]
![Page 4: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/4.jpg)
Virtual Machines
Virtualbox [Oracle/Sun] (hbp://www.virtualbox.org/) VirtualBox is a powerful x86 and AMD64/Intel64 virtualiza3on product
for enterprise as well as home use. Cost : Free Cross-‐plagorm host opera3ng systems
Ubuntu (hbp://ubuntu.com) "humanity towards others“
Cost : Free Popular : Desktop 50% of linux users Feature: Stability, Useability Applica3ons
Extensive debian and Ubuntu repository 3rd party binaries Compile from source
![Page 5: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/5.jpg)
Virtual Machines
Custom virtual machine of Ubuntu 10.10 (32bit) using Virtualbox
FEAP requirements Being comfortable using command-‐line (Ubuntu)
Naviga3ng the file system (Ubuntu) Modifying environment variables (Standardized VM)
Basic knowledge about compilers (Standardized VM) Compiler flags
Loca3on of required headers and libraries
Understanding how to interpret compile and run3me errors (requires actual experience!)
![Page 6: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/6.jpg)
VM -‐ Example
![Page 7: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/7.jpg)
VM -‐ Import
![Page 8: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/8.jpg)
VM -‐ Import
![Page 9: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/9.jpg)
VM -‐ Import
![Page 10: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/10.jpg)
VM -‐ Start
![Page 11: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/11.jpg)
VM -‐ Start
[user: FEAP pass:rlt]
![Page 12: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/12.jpg)
VM -‐ Start
![Page 13: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/13.jpg)
VM – Mul3ple / Simultaneous
![Page 14: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/14.jpg)
VM – Virtual hard disk contents
Specifica3ons Minimal install (theme is ugly!)
Gcc-‐4.4 toolkit is installed (not including gdb) All X11 development files installed
Vanilla FEAP ver83 compiled (makefile.in setup)
Applica3ons Emacs (text editor) [origin: MIT]
Mozilla Firefox
![Page 15: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/15.jpg)
Unix -‐ Introduc3on
FEAP requirements Being comfortable using command-‐line (Ubuntu)
Naviga3ng the file system (Ubuntu) Modifying environment variables (Standardized VM)
Basic knowledge about compilers (Standardized VM) Compiler flags
Loca3on of required headers and libraries
Understanding how to interpret compile and run3me errors (requires actual experience!)
![Page 16: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/16.jpg)
Unix -‐ Introduc3on
Being comfortable using command-‐line (Ubuntu) man – an interface to the on-‐line reference manuals
> man make
> man which
make – GNU make u3lity to maintain groups of programs > make install
> make clean
which – locate a command > which gcc
![Page 17: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/17.jpg)
Unix – Program execu3on
Execu3ng programs in Unix All programs require a path (rela3ve or aboslute)
Examples: > /usr/bin/xeyes
> ~/Desktop/ver83/main/feap
>./feap (only works if you are located in ~/Desktop/ver83/main)
Why did other commands work without paths? If no path is supplied, the system will look through a series of paths set
by ENVIRONMENT variables, specifically $PATH
![Page 18: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/18.jpg)
Unix -‐ Environment
Examples: >echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/games
>which which /usr/bin/which
>which echo /bin/echo
Environment variables: >printenv (shows current environment variables)
>source <file> Executes commands from a file in the current shell
>source .bashrc (sets environment variables described in .bashrc)
![Page 19: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/19.jpg)
Unix – File system naviga3on
Basic commands > pwd – print name of current/working directory
> ls – list directory contents Files that begin with “.” are hidden. You will not be able to see them in the graphical viewer (nau3lus), but they exist. You can s3ll access the files from a text editor such as emacs using the graphical user interface or command-‐line.
> cd – change the shell working directory cd – directory shortcuts
“ “ sends you back to the home directory
“/” references the root directory
“.” references the current directory
“..” references the parent directory
“~” references the home directory
![Page 20: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/20.jpg)
FEAP – Compile 3me
Instruc3ons are in the FEAP manual
Summary 1. Set the FEAPHOME8_3 environment variable to point to wherever
ver83/ folder is located in ~/.bashrc file export FEAPHOME8_3=~/Desktop/ver83 (already done in VM ignore!)
2. Modify makefile.in in FEAPHOME8_3 to point to the correct compiler and libraries (already done in VM ignore!)
3. Run make clean, then make install, in FEAPHOME8_3 (Already done, but you should run it yourself!) This must be done
whenever you update the main program object files or move it to a new machine!)
![Page 21: Ubuntu, FEAP, and Virtualization - Stanford Universitybiomechanics.stanford.edu/talks/JW_feap_in_a_box.pdf · 2010-11-09 · Compiling’and’opera3ng’FEAP’requires’knowledge’of’Unix](https://reader034.vdocuments.us/reader034/viewer/2022042210/5eaeaeef09047d5c4f2abb46/html5/thumbnails/21.jpg)
FEAP -‐ execu3on
To execute FEAP, you can: 1. > $FEAPHOME8_3/main/feap
2. > cd $FEAPHOME8_3/main > ./feap
Finite element analysis program: Input file (contains mesh and loading instruc3ons)
Read more about it in the FEAP documenta3on