dustsim is a circumplanetary dust simulator that can be used to study dust dynamics, as a result of gravitational and non-gravitational forces acting on a dust particle.
- General directory structure common to C++ projects
- Install script (
make install
) - CPack script for packaging (
make package
) - Automatic documentation generation (Doxygen)
- Separate file to specify location of project files (
ProjectFiles.cmake
)
To install this project, please ensure that you have installed the following (install guides are provided on the respective websites):
Run the following commands to download, build, and install this project. The --depth 1
parameter passed to git clone
ensures that the git history is not downloaded. In case you would like to preserve the history of this project, omit that option.
git clone https://www.github.com/kartikkumar/dustsim --depth 1
cd dustsim
git submodule init && git submodule update
mkdir build && cd build
cmake .. && cmake --build .
To push this project to your own remote repository, you can run the following command, which will overcome the issues with utilizing a shallow clone:
git commit --amend .
This rewrites the last commit and ensures that you can then push the repository to a remote (e.g., Github, BitBucket, Gitlab, etc.).
To install the header files, run the following from within the build
directory:
make install
Note that dependencies are installed by fetching them online, in case they cannot be detected on your local system. If the build process fails, check the error log given. Typically, building fails due to timeout. Simply run the cmake --build .
command once more.
You can pass the following, general command-line options when running CMake:
-DCMAKE_INSTALL_PREFIX[=$install_dir]
: set path prefix for install script (make install
); if not set, defaults to usual locations-DBUILD_SHARED_LIBS=[ON|OFF (default)]
: build shared libraries instead of static-DBUILD_DOXYGEN_DOCS[=ON|OFF (default)]
: build the Doxygen documentation (LaTeX must be installed withamsmath
package)-DBUILD_DEPENDENCIES[=ON|OFF (default)]
: force local build of dependencies, instead of first searching system-wide usingfind_package()
This project has been set up with a specific file/folder structure in mind. The following describes some important features of this setup:
cmake/Modules
: ContainsCMake
modulesconfig
: Contains templates for configuration files to run dustsim (for C++ simulator and Python plotting scripts)docs
: Contains code documentation generated by Doxygeninclude
: Project header files (*.hpp)python
: Python plotting scripts for data generated by simulatorsrc
: Project source files (*.cpp), includingmain.cpp
CMakeLists.txt
: mainCMakelists.txt
file for project (should not need to be modified for basic build)Dependencies.cmake
: list of dependencies and automated build, triggered if dependency cannot be found locallyDoxyfile.in
: Doxygen configuration fileLICENSE.md
: license file for projectProjectFiles.cmake
: list of project source files to buildREADME.md
: project readme file
Once you've made your great commits:
- Fork dustsim
- Create a topic branch -
git checkout -b my_branch
- Push to your branch -
git push origin my_branch
- Create a Pull Request from your branch
- That's it!
The copyright holders are not liable for any damage(s) incurred due to improper use of dustsim.
@todo Find a way to have nested variables in Doxygen
config file so that e.g., @@CMAKE_PROJECT_NAME@_VERSION@
works.
@todo Add version detection in CMake
module so that find_package respects minimum version required.
@todo Find a way to provide an option to clean installation.
@todo Find a way to remove \cond \endcond workaround to get Doxygen to not throw warnings in readme.