Installation¶
In this section you find the advanced installation instructions, in case you want to compile your code locally and potentially develop new features.
The following programs need to be installed in order to compile MoCSI (see below for detailed instructions): CMake, a C++ compiler and git. Optionally, SPICE and VTK can be installed to leverage the full capatabilities of the code.
Additionally, for running the config generator script, Python needs to be installed.
Minimum installation instructions¶
Linux¶
1 - First, you need to install CMake, a C++ compiler (we recommend gcc), git and Python. You can do this in your shell:
sudo apt-get update && sudo apt-get install -y build-essential cmake git python3 python3-pip
2 - Then, you can navigate to a preferred folder where you can clone the repository and enter the folder.
git clone https://gitlab.git.nrw/uni-ms/ag-gundlach/public/mocsi.git
cd mocsi
3 - Then (without using SPICE or VTK) you can create the build directory, where the make files with cmake are generated. You can run these makefiles to build the executable:
mkdir build
cd build
cmake ..
make
The final executable is called mocsi and located in build/. For instructions on running mocsi we refer to the quickstart section.
Mac¶
1 - First, you need to install CMake, a C++ compiler (we recommend gcc), git and Python. You can do this in your shell:
brew install cmake gcc git python
2 - Then, you can navigate to a preferred folder where you can clone the repository and enter the folder.
git clone https://gitlab.git.nrw/uni-ms/ag-gundlach/public/mocsi.git
cd mocsi
3 - Then (without using SPICE or VTK) you can create the build directory, where the make files with cmake are generated. You can run these makefiles to build the executable:
mkdir build
cd build
cmake ..
make
The final executable is called mocsi and located in build/. For instructions on running mocsi we refer to the Quickstart section.
Windows MSVC + CMake GUI¶
1 - You need to install git, which you can download here, and CMake, which you can download here. Also you need to install Python, which you can get here. Finally, you need to install Visual Studio here. When opening Visual Studio for the first time, select “Desktop Development with C++” and proceed to install the MSVC compiler.
2 - Then, you can navigate to a preferred folder where you can clone the repository and enter the folder.
3 - Open the CMake GUI application. Click on the “Browse Source” button and navigate to the root folder of your MoCSI installation. Create a new folder for your build files. Afterwards, click the “Browse Build” button and navigate to the newly created folder.
4 - Click the “Configure” button and you will be prompted to specify a generator for your project. Select Visual Studio 17 2022 (or the latest version you are using) and hit “Finish”. You should see a few warnings followed by “Configuration done”
5 - Click the “Generate” Button. CMake should build your project and finish with the message “Generate done”
6 - Click the “Open Project” button. It should open a Visual Studio window with the build solution file.
7 - In the top bar next to the undo/redo buttons, there should be a dropdown menu to select your compilation configuration. Select “Release” for the highest optimization level or “Debug” for testing purposes.
7 - Locate the Solution Explorer tab in your Visual Studio version and right click on ALL_BUILD. Select the top option „Build“ in the right-click-menu. It should finish with the message “Build completed”.
8 - Depending on whether you have selected “Debug” or “Release”, you should find your executable ````mocsi.exein your build folder under either the /Debug/ or /Release/ subdirectory. For instructions on runningmocsi.exe``` we refer to the Quickstart section.
Installing additional libraries (optional)¶
SPICE (for usage of accurate orbital data)¶
Linux¶
To use SPICE, the correct CSPICE toolkit needs to be downloaded and specified for CMake. For this you have to navigate to the folder where you want to keep the toolkit. When using the gcc compiler, you can download and extract the package in the following way:
curl -O https://naif.jpl.nasa.gov/pub/naif/toolkit//C/PC_Linux_GCC_64bit/packages/cspice.tar.Z
uncompress cspice.tar.Z
tar -xf cspice.tar
Then you can run the above CMake command, specifying the path to SPICE.
cmake .. -DCSPICE_DIR=/path/to/cspice/
All other steps remain the same.
Windows¶
To use SPICE, the correct CSPICE toolkit needs to be downloaded and specified for CMake. Extract the files to a directory of your chosing.
Open the CMake GUI again and click the “+ Add Entry” button. If your SPICE toolkit is in the folder “D:/cspice” you want to specify:
Name: CSPICE_DIR
Type: Path
Value: D:/cspice
Click “Ok”. From here, you can go continue through the Windows MSVC + CMake GUI installation guide step 4. (If you already selected the compiler before, clicking “Configure” will skip the prompt and directly start the condiguration step.)
VTK (for shapemodel usage)¶
Linux¶
To use VTK, you can install it with the following command:
sudo apt-get install -y --no-install-recommends libvtk9-dev
Then, when following the above instructions from step 3 (running CMake), CMake should automatically discover the installed VTK and consider it for the build files.
Windows¶
Download the latest release on the Kitware VTK website here. Extract the files to a folder of your chosing. Go through the compilation guide, but select the VTK folder as source and a new folder as target. The build process within Visual Studio will take a while. Make sure to select the same configuration (“Release”/”Debug”) as the MoCSI configuration you want to use.
After successfully building the VTK library files, you need to add the library folder to your Path system variable. Navigate to your Windows system variables. Select “Path” in the list and click “Edit”. Add the ../bin/ and ../lib/Release or ../lib/Debug/ folders from your installation. Confirm and exit. CMake should now be able to find your VTK installation during the configuration step.
From here, you can go continue through the Windows MSVC + CMake GUI installation guide step 4. (If you already selected the compiler before, clicking “Configure” will skip the prompt and directly start the condiguration step.)