From 03979e77ab11da3f42a5aa57c0f16711d7a1a7ce Mon Sep 17 00:00:00 2001 From: "xiaojie.wu" Date: Sat, 13 Jan 2024 05:56:03 +0800 Subject: [PATCH] cmake workflow for dftd3 and dftd4 --- gpu4pyscf/lib/CMakeLists.txt | 24 ++++++++++++++++++++++++ setup.py | 5 ++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/gpu4pyscf/lib/CMakeLists.txt b/gpu4pyscf/lib/CMakeLists.txt index f9e74f42..da30884d 100644 --- a/gpu4pyscf/lib/CMakeLists.txt +++ b/gpu4pyscf/lib/CMakeLists.txt @@ -115,3 +115,27 @@ if(BUILD_LIBXC) CMAKE_CACHE_ARGS -DCMAKE_CUDA_ARCHITECTURES:STRING=${CMAKE_CUDA_ARCHITECTURES} ) endif() + +option(BUILD_DFTD3 "Using DFTD3 for DFT" ON) +if(BUILD_DFTD3) + include(ExternalProject) + ExternalProject_Add(dftd3 + GIT_REPOSITORY "https://github.com/dftd3/simple-dftd3" + GIT_TAG v1.0.0 + PREFIX ${PROJECT_BINARY_DIR}/deps + INSTALL_DIR ${PROJECT_SOURCE_DIR}/deps + CMAKE_ARGS -DWITH_OpenMP=OFF + ) +endif() + +option(BUILD_DFTD4 "Using DFTD4 for DFT" ON) +if(BUILD_DFTD4) + include(ExternalProject) + ExternalProject_Add(dftd4 + GIT_REPOSITORY "https://github.com/dftd4/dftd4" + GIT_TAG v3.6.0 + PREFIX ${PROJECT_BINARY_DIR}/deps + INSTALL_DIR ${PROJECT_SOURCE_DIR}/deps + CMAKE_ARGS -DWITH_OpenMP=OFF + ) +endif() \ No newline at end of file diff --git a/setup.py b/setup.py index 3c842953..e6ebcabf 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,6 @@ import subprocess import re import glob -import subprocess from setuptools import setup, find_packages, Extension from setuptools.command.build_py import build_py @@ -87,8 +86,8 @@ def run(self): else: self.spawn(cmd) - self.build_dftd('dftd3', 'https://github.com/dftd3/simple-dftd3/releases/download/v1.0.0/dftd3-1.0.0-sdist.tar.gz') - self.build_dftd('dftd4', 'https://github.com/dftd4/dftd4/releases/download/v3.6.0/dftd4-sdist-3.6.0.tar.gz') + #self.build_dftd('dftd3', 'https://github.com/dftd3/simple-dftd3/releases/download/v1.0.0/dftd3-1.0.0-sdist.tar.gz') + #self.build_dftd('dftd4', 'https://github.com/dftd4/dftd4/releases/download/v3.6.0/dftd4-sdist-3.6.0.tar.gz') super().run()