Skip to content

Commit

Permalink
created an ubuntu Eclipse CDT development container for C++.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Feb 2, 2018
1 parent 424dfbd commit 13e9dc6
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ elseif (LINUX)
endif()

project(numerics)
cmake_minimum_required(VERSION 2.8.9)
cmake_minimum_required(VERSION 3.0)
enable_language(CXX)
enable_language(C)
enable_language(Fortran)
Expand Down
1 change: 1 addition & 0 deletions VCell/src/SimTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ void SimTool::start1() {
if (duration >= 2){
percentile = (simulation->getTime_sec() - simStartTime)/(simEndTime - simStartTime);
if (percentile - lastSentPercentile >= increment) {
std::cout << "SimTool.start1() sending JOB_PROGRESS to SimulationMessaging: percentile=" << percentile << ", time=" << simulation->getTime_sec() << std::endl;
SimulationMessaging::getInstVar()->setWorkerEvent(new WorkerEvent(JOB_PROGRESS, percentile, simulation->getTime_sec()));
lastSentPercentile = percentile;
oldTime = currentTime;
Expand Down
20 changes: 5 additions & 15 deletions VagrantBoxes/linux64-ubuntu/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,16 @@
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.box = "ubuntu/xenial64"
config.vm.synced_folder "../..", "/vagrant_numerics"
config.ssh.forward_x11 = true
config.vm.provider "virtualbox" do |vb|
vb.name = "vcell-solvers-ubuntu64"
end

config.vm.provision "shell", inline: <<-SHELL
sudo apt-get install -y -qq -o=Dpkg::Use-Pty=0 build-essential
sudo apt-get install -y -qq -o=Dpkg::Use-Pty=0 gfortran
sudo apt-get install -y -qq -o=Dpkg::Use-Pty=0 zlib1g-dev
sudo apt-get install -y -qq -o=Dpkg::Use-Pty=0 libhdf5-dev
#wget https://cmake.org/files/v3.8/cmake-3.8.1.tar.gz
#sudo tar xzf cmake-3.8.1.tar.gz
#cd cmake-3.8.1
#sudo ./configure --prefix=/opt/cmake
#sudo make --quiet
#sudo make --quiet install
sudo apt-get install -y -qq -o=Dpkg::Use-Pty=0 cmake3
apt-get -y update && apt-get install -y apt-utils && \
apt-get install -y -qq -o=Dpkg::Use-Pty=0 build-essential gfortran zlib1g-dev \
libhdf5-dev libcurl4-openssl-dev libboost-dev cmake
SHELL
end
33 changes: 33 additions & 0 deletions docker/Dockerfile-ide
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM ubuntu:xenial as build

RUN apt-get -y update && apt-get install -y apt-utils && \
apt-get install -y -qq -o=Dpkg::Use-Pty=0 build-essential gfortran gdb cmake expect

RUN apt-get install -y software-properties-common python-software-properties

RUN add-apt-repository ppa:ubuntu-desktop/ubuntu-make
RUN apt -y update
RUN apt-get install -y ubuntu-make

#RUN umake -v ide eclipse-cpp
RUN export COMMAND="spawn umake ide eclipse-cpp;" \
SLEEP="sleep 3;" \
EXPECT_PROMPT="expect -re \"Choose installation path: /root/.local/share/umake/ide/eclipse-cpp\";" \
SEND="send \"\r\n\";" \
TIMEOUT="set timeout -1;" \
EXPECT_DONE="expect -re \"Installation done\";" && \
expect -c "$COMMAND $SLEEP $EXPECT_PROMPT $SEND $TIMEOUT $EXPECT_DONE"


RUN apt-get install -y -qq -o=Dpkg::Use-Pty=0 zlib1g-dev libhdf5-dev libcurl4-openssl-dev libboost-dev


# RUN useradd -ms /bin/bash developer
# USER developer
# ENV HOME /home/developer
WORKDIR /workspace/build-docker

VOLUME /workspace

CMD /root/.local/share/umake/ide/eclipse-cpp/eclipse -data /workspace

11 changes: 11 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

DIR="$(cd "$(dirname "$0")"; pwd)"
echo "dir is $DIR"

cd $DIR

image_name="localhost:5000/vcell-solvers-ide:dev"

docker build -f ./Dockerfile-ide --tag $image_name .

22 changes: 22 additions & 0 deletions docker/cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

mkdir -p /workspace/vcell-solvers-build
cd /workspace/vcell-solvers-build

cmake \
-G "Eclipse CDT4 - Unix Makefiles" \
-DCMAKE_BUILD_TYPE="Debug" \
-DOPTION_TARGET_MESSAGING=ON \
-DOPTION_TARGET_PARALLEL=OFF \
-DOPTION_TARGET_CHOMBO2D_SOLVER=OFF \
-DOPTION_TARGET_CHOMBO3D_SOLVER=OFF \
-DOPTION_TARGET_SMOLDYN_SOLVER=OFF \
-DOPTION_TARGET_FV_SOLVER=ON \
-DOPTION_TARGET_STOCHASTIC_SOLVER=OFF \
-DOPTION_TARGET_NFSIM_SOLVER=OFF \
-DOPTION_TARGET_MOVINGBOUNDARY_SOLVER=OFF \
-DOPTION_TARGET_SUNDIALS_SOLVER=OFF \
-DOPTION_TARGET_HY3S_SOLVERS=OFF \
../vcell-solvers


30 changes: 30 additions & 0 deletions docker/eclipse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

THIS_DIR="$(cd "$(dirname "$0")"; pwd)"
PROJECT_DIR="$(cd "$(dirname "$0")"; cd ..; pwd)"
WORKSPACE_DIR="$(cd "$(dirname "$0")"; cd ..; cd ..; pwd)"
echo "dir is $THIS_DIR"
echo "projectDir is $PROJECT_DIR"
echo "workspaceDir is $WORKSPACE_DIR"


# https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc
# https://blog.alexellis.io/linux-desktop-on-mac/

# > brew install socat
# > socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

# to test ability to run an X program:
# docker run -e DISPLAY=$IP gns3/xeyes

# (socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\") &

IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')

image_name="localhost:5000/vcell-solvers-ide:dev"
WORKSPACE_DIR=/Users/schaff/Documents/workspace-modular
ECLIPSE="/root/.local/share/umake/ide/eclipse-cpp/eclipse"

docker run -it \
-v "$WORKSPACE_DIR:/workspace" -e DISPLAY=$IP:0 $image_name \
$ECLIPSE -data /workspace
27 changes: 27 additions & 0 deletions docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

THIS_DIR="$(cd "$(dirname "$0")"; pwd)"
PROJECT_DIR="$(cd "$(dirname "$0")"; cd ..; pwd)"
WORKSPACE_DIR="$(cd "$(dirname "$0")"; cd ..; cd ..; pwd)"
echo "dir is $THIS_DIR"
echo "projectDir is $PROJECT_DIR"
echo "workspaceDir is $WORKSPACE_DIR"


# https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc
# https://blog.alexellis.io/linux-desktop-on-mac/

# > brew install socat
# > socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"

# to test ability to run an X program:
# docker run -e DISPLAY=$IP gns3/xeyes

# (socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\") &

IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')

image_name="localhost:5000/vcell-solvers-ide:dev"

echo docker run -it \
-v "$WORKSPACE_DIR:/workspace" -e DISPLAY=$IP:0 $image_name /bin/bash

0 comments on commit 13e9dc6

Please sign in to comment.