Anthony Stone's Gaussian Distributed Multipole Analysis wrapped in CMake
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Anthony Stone's GDMA ( wrapped in CMake for Psi4 (


This is the GDMA project ( by Prof. Anthony J. Stone of Cambridge University.

GDMA is written in Fortran. It has source and manual are available at the above website and, as distributed, builds with make.

This Repository

GDMA has been in the ab initio quantum chemistry package Psi4 (, since March 2016. In Psi4, it builds with cmake and has an interface to C++ and Psi4 internals designed by @andysim. Manual for GDMA+Psi4 at This repository is GDMA wrapped up nicely in CMake.


This codebase was copied from upstream (above website) at 2.2.06. It has been modified to build as a library instead of an executable and to manipulate output.


cmake -H. -Bobjdir
cd objdir && make
make install

The build is also responsive to

  • static/shared toggle BUILD_SHARED_LIBS
  • install location CMAKE_INSTALL_PREFIX
  • of course, CMAKE_Fortran_COMPILER, CMAKE_C_COMPILER, and CMAKE_Fortran_FLAGS

See CMakeLists.txt for options details. All these build options should be passed as cmake -DOPTION.


This project installs with gdmaConfig.cmake, gdmaConfigVersion.cmake, and gdmaTargets.cmake files suitable for use with CMake find_package() in CONFIG mode.

  • find_package(gdma) - find any gdma libraries and headers
  • find_package(gdma 2.2.06 EXACT CONFIG REQUIRED COMPONENTS static) - find gdma exactly version 2.2.06 built with static libraries or die trying

See for details of how to detect the Config file and what CMake variables and targets are exported to your project.


After find_package(gdma ...),

  • test if package found with if(${gdma_FOUND}) or if(TARGET gdma::gdma)
  • link to library (establishes dependency), including header and definitions configuration with target_link_libraries(mytarget gdma::gdma)
  • include header files using target_include_directories(mytarget PRIVATE $<TARGET_PROPERTY:gdma::gdma,INTERFACE_INCLUDE_DIRECTORIES>)
  • compile target applying -DUSING_gdma definition using target_compile_definitions(mytarget PRIVATE $<TARGET_PROPERTY:gdma::gdma,INTERFACE_COMPILE_DEFINITIONS>)