Build from source¶
Set up the environment¶
Prerequisites¶
- Git
- CMake
- Conan 2
- Python 3
- C++20 compiler
- CUDA Toolkit (optional, used for Solvent Excluded Surface computation)
Create the default Conan profile¶
conan profile detect
Add the custom Conan remote¶
To save compilation time, some dependencies are automatically built by the CI and pushed to a custom Conan repository.
conan remote add vtx https://conan.drugdesign.fr
Build VTX¶
Code is split into several Conan packages under /lib and /tool. The application in /app/vtx consumes these packages as dependencies.
Clone the repository and run the following commands from the repository root.
Option 1: Development workspace (best for development)¶
conan build dev/ -b missing -s compiler.cppstd=20 -s build_type=Debug
Output folder: dev/build/Debug/
Option 2: Conan editable mode¶
conan editable add lib/app
conan editable add lib/core
conan editable add lib/io
conan editable add lib/python_binding
conan editable add lib/renderer
conan editable add lib/ui/qt
conan editable add lib/util
conan editable add tool/example
conan editable add tool/mdprep
conan build app/vtx -b missing -b editable -s compiler.cppstd=20 -s build_type=Release
Output folder: app/vtx/build/Release/
Option 3: Conan package¶
conan export lib/app
conan export lib/core
conan export lib/io
conan export lib/python_binding
conan export lib/renderer
conan export lib/ui/qt
conan export lib/util
conan export tool/example
conan export tool/mdprep
conan create app/vtx -b missing -s compiler.cppstd=20 -s build_type=Release
Output folder: <CONAN_HOME>/p/b/<package-cache-id>/p
Linux specific¶
Conan may require some additional parameters to install needed packages:
-c tools.system.package_manager:mode=install -c tools.system.package_manager:sudo=True
Daily development workflow¶
After the first Conan build, regular development can usually be done directly through CMake or your IDE:
- If you only modify existing source files, rebuild normally.
- If you add, remove, or rename source files, rerun the CMake configure step, then rebuild.
- Rerun Conan when dependencies, package options, profiles, or Conan recipes change.
Customize Conan profile (optional)¶
The default Conan profile file is located in your system's user folder:
<CONAN_HOME>/profiles/
Feel free to edit the default profile or create a new one.
Custom profile example (Windows)¶
[settings]
arch=x86_64
# Set default build type to debug.
build_type=Debug
compiler=msvc
# Set default cpp version.
compiler.cppstd=20
compiler.runtime=dynamic
compiler.version=194
os=Windows
[conf]
# Use Ninja generator instead of MSBuild.
tools.cmake.cmaketoolchain:generator=Ninja
This profile already enables Debug mode, C++20, and the Ninja generator instead of the default Visual Studio/MSBuild generator. No extra command-line parameters are needed:
conan build . -b missing