Setup Development Environment
Installation on Linux
- Download Cevelop at https://www.cevelop.com/download/
- Unzip it anywhere locally on your filesystem, e.g. in your home directory.
- Install a suitable C++ compiler using your package manager. - For C++17 GCC 8.3 or newer is a good choice
Installation on MacOS
- Download Cevelop at https://www.cevelop.com/download/ (or use brew)
- Unzip it anywhere locally on your filesystem, e.g. in your home directory.
For Mac Users with Homebrew and XCode
getting GNU g++ compiler in Cevelop on Mac
If you are like me (PeterSommerlad) using a Mac, you might want to use GCC 8.2 or later instead of the llvm-clang based XCode C++ compiler that is also called g++.
From Yosemite on, OS X gives you a hard time to call g++ from /usr/local/bin
instead from XCode within Cevelop (for security reasons :-). On my system I'd like to get:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/texbin
I haven't found a reasonable easy and universal workaround, so there are several options:
- Uninstall XCode after hombrew and its
g++
is installed (haven't tried) - compile only on the command line within the shell (where setting the
PATH
environment variable works), bad idea - start Cevelop only from within a terminal shell and not from the finder, where the shell has
/usr/local/bin
as the first entry in itsPATH
environment variable - experiment with http://stackoverflow.com/questions/30118993/how-to-set-environment-variables-in-yosemite (which didn't work for me)
- Within Cevelop go to
Preferences->C/C++->Build->Environment
and set thePATH
variable there accordingly and select "Replace native environment with specified one"
How do I know which compiler I actually get?
You can look at the virtual "Include" folder in your projects. If it shows some paths starting with
:/Applications/XCode.app/Contents...: you are using XCode's compiler :/usr/local/include: you are using homebrew's g++ compiler
Why can this be a problem?
On Yosemite the llvm-clang compiler should be modern enough for our lecture's exercises. However, at least one XCode clang version broke C++14 support for some C++14 features which have been working before and with the regular llvm-clang of the same release number.
Debug with gdb on Mac with Yosemite
Unfortunately gdb is not working when installed with homebrew, because Yosemite does not allow unsigned processes to control others. For this you have to codesign gdb with a certificate that you trust. Here is how: http://www.patosai.com/blog/post/installing-gdb-on-mac-os-x-yosemite
In addition to the code signing you might need to restart or kill the taskagent as said [http://andresabino.com/2015/04/14/codesign-gdb-on-mac-os-x-yosemite-10-10-2/ here]: Restart the taskagted service, and sign the binary.
$ sudo killall taskgated
$ codesign -fs gdb-cert /usr/local/bin/gdb
Cevelop on Windows
- Download Cevelop at https://www.cevelop.com/download/
- Unzip it anywhere locally on your filesystem, e.g. in your home directory.
- Download a C++ compiler. Suggestion for Windows is MinGW build of Stephan T. Lavavej as it already contains
boost
: http://nuwen.net/mingw.html - Install MinGW (extract it to the location of your choice)
- Check installation by executing
g++ --version
in command prompt. Maybe you need to add thebin
directory to yourPATH
environment variable. - All dynamically loaded compiler-related libraries must be found for compilation and execution of the compiled programms. It may happen that other paths in the PATH environment variable contain the same libraries. The MinGW path must be entered before them. - In order to let Cevelop recognize your MinGW installation you need to have specific executables in the
bin
directory: - Eclipse CDT/Cevelop (Until version 1.13) looks for an executable with the namex86_64-w64-mingw32-gcc.exe
in the path variable to determine whether the MinGW compiler is installed. Create a copy thegcc.exe
namedx86_64-w64-mingw32-gcc.exe
in thebin
directory of the MinGW installation. - Note: In rare cases the specific name above does not work! Try to usemingw32-gcc.exe
instead.
If you prefer a video showing those steps, we have created a quick tutorial to guide you through the installation:
Installation on Windows Video (Shows installation of an older compiler version. The principle stays the same.)
Using the Virtual Machine (Currently not available)
Installing Virtual Machine
First you have to download the virtual appliance from the USB stick...
You can either use VMware or '''Virtualbox''' to run the virtual machine. The virtual appliance file was created using Virtualbox.
VMWare (Linux, Windows)
Download and install the VMware player:
https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0
Start the VMware player, click "Open a Virtual Machine", select the appliance file "arch_64_CPlusPlusHS1614.HS16.ova.ova" and then "Open". Modify the name and storage location of the imported image if required. Take care to not store the imported image on a remote file system. Click "Import", the click on Retry if another modal Dialog appears and then wait... Start the VM. open-vm-tools are installed instead of the native VMWare tools to provide copy/paste possibilities.
Due to the fact that the image was created using Virtualbox, you have to change settings here (in the guest system - Linux): "System->Preferences->Startup Applications". Uncheck the entry '''vboxclient''' but check '''VMWare User Agent''' and click on "Close". You have to log out and log in to reflect the changes.
If you still see the message "VBoxClient: the VirtualBox kernel service is not running", make sure you unchecked '''vboxclient''' during the procedure above.
If you are not able to seamlessly change the display size by dragging a corner of the window, select a preferred size manually in "System->Preferences->Displays".
You should be ready now to start with the exercises.
Virtualbox (Linux, Mac, Windows)
Download and install Virtualbox:
https://www.virtualbox.org/wiki/Downloads or directly via your package manager.
After installation you need to setup the virtual machine. When you started Virtualbox click the "Import Appliance" button, select the appliance file "CPlusPlusHS1614_64.ova" and click "Next". Verify the appliance settings, especially the last entry where your image files are stored and modify if required. Click "Import".
You should be ready now to start with the exercises.
Login
Login to the VM using:
User: hsr
Password: welcome
Mount HSR-Volumes
There exists an interactive python script, hsrmount.py
, to mount some predefined volumes to /home/hsr/hsrmnt
. Open a terminal and execute the following command sudo ./hsrmount.py
.
The script will ask you for your hsr shortname and password and mounts the following shares:
/home/hsr/hsrmnt/root/alg/skripte/Informatik/Fachbereich/C++/CPl
/home/hsr/hsrmnt/scratch
/home/hsr/hsrmnt/<hsruser>
If you need other shares or don't want to have all of these mounted, feel free to adjust the corresponding section within the python script.
To unmount the volumes use sudo umount /home/hsr/hsrmnt/scratch /home/hsr/hsrmnt/root/alg/skripte/Informatik/Fachbereich/C++/CPl /home/hsr/hsrmnt/<hsruser>
.
:Note: Replace <hsruser>
with your real hsr shortname :)