Skip to content

Commit

Permalink
Enable CMake build
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Dec 10, 2018
1 parent bd8cb48 commit 34a2a9c
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 5 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.5)

project(libdftd3 VERSION 0.9.2 LANGUAGES Fortran)

set(LIBRARY_ONLY FALSE CACHE BOOL "Whether only library should be compiled")

set(INSTALL_BIN_DIR "bin")
set(INSTALL_MOD_DIR "include")
set(INSTALL_LIB_DIR "lib")

add_subdirectory(lib)
if(NOT LIBRARY_ONLY)
add_subdirectory(prg)
endif()
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DFTD3
=====

This is a repackaged version of the `DFTD3 program
<https://www.chemie.uni-bonn.de/pctc/mulliken-center/software/dft-d3/get-the-current-version-of-dft-d3>`_
<http://www.thch.uni-bonn.de/tc/index.php?section=downloads&subsection=getd3>`_
by S. Grimme and his coworkers.

The original program (V3.1 Rev 1) was downloaded at 2016-04-03. It has been
Expand All @@ -13,15 +13,14 @@ split into two parts:
* A library with the core functionality. This can be directly used by third
party applications wishing to calculate dispersion with the DFT-D3
approach.

* Additional extensions which are necessary for the command line tool DFTD3 and
the command line tool itself.

* Updated dftd3 code to include refitted/modified zero- and BJ-damped D3
versions of Sherrill and coworkers (-bjm and -zerom)
(Functionality corresponds to V3.2 Rev0)


Compilation
===========

Expand All @@ -47,8 +46,8 @@ When using the library or the dftd3 tool, please cite:

S. Grimme, J. Antony, S. Ehrlich and H. Krieg
J. Chem. Phys, 132 (2010), 154104.

If BJ-damping is used
If BJ-damping is used

S. Grimme, S. Ehrlich and L. Goerigk
J. Comput. Chem, 32 (2011), 1456-1465.
Expand Down
20 changes: 20 additions & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
set(sources
api.f90
common.f90
core.f90
pars.f90
sizes.f90)

add_library(dftd3 ${sources})

set(includedir ${CMAKE_CURRENT_BINARY_DIR}/include)

set_target_properties(dftd3 PROPERTIES Fortran_MODULE_DIRECTORY ${includedir})

target_include_directories(dftd3 INTERFACE ${includedir})

install(TARGETS dftd3
ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR})

install(DIRECTORY ${includedir}/ DESTINATION ${INSTALL_MOD_DIR})
12 changes: 12 additions & 0 deletions prg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(sources
extras.f90
main.f90)

add_executable(dftd3_standalone ${sources})

target_link_libraries(dftd3_standalone dftd3)

set_target_properties(dftd3_standalone PROPERTIES OUTPUT_NAME "dftd3")

install(TARGETS dftd3_standalone
RUNTIME DESTINATION ${INSTALL_BIN_DIR})

0 comments on commit 34a2a9c

Please sign in to comment.