Compiling from source¶
The Python package is the recommended way to install AUSAXS, but compiling it yourself is also fairly straightforward. It only requires the curl library and its development headers. Since the codebase is written in modern C++20, a recent compiler supporting this is also required. The compilation has been verified to work with GCC v11+, AppleClang (macOS), and MSVC 2022+.
Linux¶
-
Make sure you have the prerequisites installed
sudo apt-get install cmake make g++ git libcurl4-openssl-dev -
Clone the repository
git clone https://github.com/AUSAXS/AUSAXS.git -
Configure the build from the root directory
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release -
Compile the executable
cmake --build build --target ausaxs -jX
where X is the number of worker threads. The executable is placed inbuild/bin/. -
(optional) To convert the output
.plotfiles to images, you need a few Python packages.
python -m pip install matplotlib numpy scipy
macOS¶
-
Make sure both CMake and a recent compiler, e.g. Xcode or the Xcode Command Line Tools, are available on your system
brew install cmake -
Follow steps 2 through 5 from the Linux guide.
Windows¶
-
Make sure CURL is available on your system, e.g. through vcpkg
vcpkg install curl --triplet x64-windows-static -
Download or clone the repository
git clone https://github.com/AUSAXS/AUSAXS.git -
Configure the build with vcpkg's toolchain file, so CMake can find CURL
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=<vcpkg root>/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -
Compile the executable
cmake --build build --target ausaxs --config Release -jX
The executable is placed inbuild/bin/Release/. Note that this can be very memory-intensive with the MSVC compiler. -
(optional) To convert the output
.plotfiles to images, you will also needPythonand a few additional packages.
python -m pip install matplotlib numpy scipy
Dependencies¶
The following are automatically fetched by CMake:
- Generalized Constant Expression Math, for constexpr math functions on compilers other than GCC.
-DUSE_SYSTEM_GCEM=ON - BSThreadPool, for multithreading.
-DUSE_SYSTEM_THREADPOOL=ON - CLI11, for interpreting command line arguments.
-DUSE_SYSTEM_CLI11=ON - pocketfft, for the Fourier transform of the grid-based excluded volume.
-DUSE_SYSTEM_POCKETFFT=ON - miniz, for unpacking the GPU driver in
ausaxs gpu install.-DUSE_SYSTEM_MINIZ=ON - Catch2, for running tests.
-DUSE_SYSTEM_CATCH=ON, or-DBUILD_TESTS=OFFto skip the tests entirely.
Each of these can be replaced by a system-provided version with the CMake option listed next to it.
Using your build from Python¶
The Python package bundles its own copy of the AUSAXS library. To make it use one you compiled yourself instead, e.g. to try your changes to the library in the graphical interface, build the shared library:
cmake --build build --target libausaxs -jX
ausaxs setup:
ausaxs setup --relink build/lib/libausaxs.so
libausaxs.dylib on macOS, and on Windows it is libausaxs.dll in build/bin/Release/. The path is checked by loading the library, and remembered across sessions, so rebuilding the library is enough to pick up later changes. The other options are:
| Command | Effect |
|---|---|
ausaxs setup |
Show which library is in use, and where it comes from. |
ausaxs setup --reset |
Go back to the bundled library. |
For a one-off run, the AUSAXS_LIB environment variable can be set to the library path instead. A relinked path takes precedence over it.
Next steps¶
Check that the build works by running build/bin/ausaxs --version, then continue with the next steps.