Skip to content

Commit

Permalink
Updating Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
brobey committed Mar 20, 2020
1 parent 1b7bc6a commit affe5f7
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 51 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:18.04 AS builder
WORKDIR /project
RUN apt-get update && \
apt-get install -y cmake git vim gcc g++ wget software-properties-common \
apt-get install -y cmake git vim gcc g++ software-properties-common \
mpich libmpich-dev \
openmpi-bin openmpi-doc libopenmpi-dev && \
apt-get clean && \
Expand All @@ -10,11 +10,15 @@ RUN apt-get update && \
# Installing latest GCC compiler (version 9) for best vectorization
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
RUN apt-get update && \
apt-get install -y gcc-9 g++-9 && \
apt-get install -y gcc-9 g++-9 gfortran-9 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9
# We are installing both OpenMPI and MPICH. We could use the update-alternatives to switch between them
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90\
--slave /usr/bin/g++ g++ /usr/bin/g++-9\
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-9\
--slave /usr/bin/gcov gcov /usr/bin/gcov-9

SHELL ["/bin/bash", "-c"]

Expand Down
98 changes: 50 additions & 48 deletions README.virtualbox
Original file line number Diff line number Diff line change
@@ -1,80 +1,82 @@
# These are instructions to setup a Ubuntu virtual machine for the examples in
# this chapter. The first part of the instructions must be done manually. The
# last half can be done by executing this file as a script as instructed.

Download VirtualBox and install
# Download VirtualBox and install

Download Ubuntu desktop install and save on local disk [ubuntu-18.04.2-desktop-amd64.iso]
# Download Ubuntu desktop install and save on local disk [ubuntu-18.04.2-desktop-amd64.iso]

Setup new machine
# Setup new machine

Click on New
# Click on New

Type in a name [chapter2]
Select Linux and Ubuntu 64-bit
# Type in a name [chapter8]
# Select Linux and Ubuntu 64-bit

Select the amount of memory [4096]
# Select the amount of memory [8192]

Create a virtual hard disk now
Select VDI VirtualBox Disk Image
# Create a virtual hard disk now
# Select VDI VirtualBox Disk Image

Select Fixed Size Disk
Select 10 GB
# Select Fixed Size Disk
# Select 50 GB

Should see the new virtual machine added to the list
# Should see the new virtual machine added to the list

Start Ubuntu virtual machine (Green arrow, start)
# Start Ubuntu virtual machine (Green arrow, start)

Select iso file saved earlier [ubuntu-18.04.2-desktop-amd64.iso]
# Select iso file saved earlier [ubuntu-18.04.2-desktop-amd64.iso]

Select Install Ubuntu
# Select Install Ubuntu

Keyboard -- continue
# Keyboard -- continue

Select minimal, download updates while installing and install third-party
# Select minimal, download updates while installing and install third-party

Select Erase disk and install Ubuntu
Select Install Now
# Select Erase disk and install Ubuntu
# Select Install Now

Select timezone
# Select timezone

Your name [chapter2]
Your computer's name [chapter2-virtualbox]
Username [chapter2]
password [chapter2]
Select "Require my password to log in"
# Your name [chapter8]
# Your computer's name [chapter8-virtualbox]
# Username [chapter8]
# password [chapter8]
# Select "Require my password to log in"

Select continue
# Select continue

Long time ....
# Long time ....

Installation is complete, Restart computer
# Installation is complete, Restart computer

sign in
# sign in

click through whats new
# click through whats new

select dots at bottom left and terminal
# select dots at bottom left and start up a terminal

sudo apt-get update
sudo apt-get install gcc make
# sudo apt-get update
# sudo apt-get install -y build-essential dkms git
# Now go up to devices and insert virtualbox-guest-additions-iso

If Software updater prompts, install updated software --> wait ....
# Make virtualbox window active and select devices from window menus at top of screen
# Shared Clipboard --> bidirectional
# Drag and Drop --> bidirectional
# Install guest additions (under devices pull-down)
# Remove optical disk -- from desktop, right click and eject or from devices-->optical disk-->remove disk from virtual drive
# reboot and test copy paste
# Copy on Mac is command-C and paste in Ubuntu is shift-ctrl-v

Make virtualbox window active and select devices from window menus at top of screen
Shared Clipboard --> bidirectional
Drag and Drop --> bidirectional
Install guest additions
Remove optical disk -- from desktop, right click and eject or from devices-->optical disk-->remove disk from virtual drive
reboot and test copy paste
Copy on Mac is command-C and paste in Ubuntu is shift-ctrl-v
# Reboot to get cut and paste and screen size fixed

sudo apt-get install -y bash cmake git openmpi-bin openmpi-doc libopenmpi-dev g++ vim wget valgrind

git clone https://github.com/essentialsofparallelcomputing/Chapter2.git
# Need script on guest to execute
# git clone --recursive https://github.com/essentialsofparallelcomputing/Chapter8.git

wget ftp://ftp.math.utah.edu/pub/misc/ndiff-2.00.tar.gz; tar -xzvf ndiff-2.00.tar.gz; cd ndiff-2.00; ./configure; make; cd ..
# sudo apt-get install -y bash cmake git openmpi-bin openmpi-doc libopenmpi-dev g++ vim wget valgrind

# If Software updater prompts, install updated software --> wait ....

echo 'export PATH=/project/ndiff-2.00:$PATH' >> ~/.bash_profile
source ~/.bash_profile

cd Chapter2/Listing1 && mkdir build && cd build && cmake .. && make && cd ../../..
cd Chapter2/Listing2 && mkdir build && cd build && cmake .. && make && cd ../../..
cd Chapter2/Listing3 && cd ../..

0 comments on commit affe5f7

Please sign in to comment.