Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add embd to SCC energy #891

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/fortran-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3

uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install CMake
run: pip3 install ninja cmake==3.26.4
run: pip3 install ninja cmake

- name: Configure build
run: cmake -B ${{ env.BUILD_DIR }} -G Ninja
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
python-version: 3.x

- name: Install CMake
run: pip3 install ninja cmake==3.26.4
run: pip3 install ninja cmake

- name: Configure build
run: cmake -B ${{ env.BUILD_DIR }} -DWITH_CPCMX=false -DWITH_TBLITE=false -G Ninja
Expand Down
17 changes: 14 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,20 @@
# You should have received a copy of the GNU Lesser General Public License
# along with xtb. If not, see <https://www.gnu.org/licenses/>.

cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.24)

# Setup the XTB Project
# Buggy CMake versions
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.27.0 AND CMAKE_VERSION VERSION_LESS 3.27.7)
message(WARNING "The project build could be unstable with your current version")
endif()

# Setup the xtb Project
project(
"xtb"
VERSION "6.6.1"
VERSION "6.6.1"
LANGUAGES "C" "Fortran"
)

enable_testing()

# Follow GNU conventions for installing directories
Expand All @@ -30,6 +36,7 @@ include(GNUInstallDirs)
# Include CMake specific configurations
add_subdirectory("cmake")

# Check a specific CMake targets for xtb build & execute corresponding Find scripts
if(NOT TARGET "mctc-lib::mctc-lib")
find_package("mctc-lib" REQUIRED)
endif()
Expand All @@ -38,6 +45,8 @@ if(NOT TARGET "tblite::tblite" AND WITH_TBLITE)
find_package("tblite" REQUIRED)
endif()



if(NOT TARGET "cpcmx::cpcmx" AND WITH_CPCMX)
find_package("cpcmx" REQUIRED)
endif()
Expand All @@ -51,6 +60,7 @@ set(prog)
set(srcs)

add_subdirectory("src")
message(FATAL_ERROR "STOP: ${srcs}")
add_subdirectory("symmetry")

# Find dependencies
Expand All @@ -69,6 +79,7 @@ add_library(
OBJECT
${srcs}
)

set_target_properties(
"${PROJECT_NAME}-object"
PROPERTIES
Expand Down
43 changes: 19 additions & 24 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is part of xtb.
# Thi file is part of xtb.
# SPDX-Identifier: LGPL-3.0-or-later
#
# xtb is free software: you can redistribute it and/or modify it under
Expand All @@ -14,21 +14,11 @@
# You should have received a copy of the Lesser GNU General Public License
# along with xtb. If not, see <https://www.gnu.org/licenses/>.

# Some user-configurable features
option(WITH_OpenMP "Enable support for shared memory parallelisation with OpenMP" TRUE)
option(WITH_TBLITE "Use tblite library as backend for xTB" TRUE)
option(WITH_CPCMX "Use CPCM-X solvation library for xTB" TRUE)
if(NOT DEFINED "${PROJECT_NAME}-dependeny-method")
set(
"${PROJECT_NAME}-dependency-method"
"subproject" "cmake" "pkgconf" "fetch"
)
endif()

set(
module-dir
"${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
)
set(module-dir "${module-dir}" PARENT_SCOPE)

# Set build type as CMake does not provide defaults
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
Expand All @@ -43,29 +33,34 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
)
endif()

# Add modules to the CMake build
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/modules")
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE)

# specify module installation directory
install(
DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}/modules/"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)

# Compiler-specific configurations
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(dialect "-fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fbacktrace")
set(bounds "-fbounds-check")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(dialect "-axAVX2 -r8 -traceback")
set(bounds "-check bounds")
endif()
if(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
set(dialect "-Mbackslash -Mallocatable=03 -r8 -traceback")
set(dialects "-fdefault-real-8 -fdefault-double-8 -ffree-line-length-none -fbacktrace")
set(bounds "-fbounds-check -ffpe-trap=invalid,zero,overflow")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "Intel")
set(dialects "-axAVX2 -r8 -traceback")
set(bounds "-check all -fpe0")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "PGI")
set(dialects "-Mbackslash -Mallocatable=03 -r8 -traceback")
endif()

# Customize compiler flags
set(CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${bounds}" PARENT_SCOPE)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialect}" PARENT_SCOPE)
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${dialects}" PARENT_SCOPE)


# Populate xtb_version.fh
# Populate xtb_version.fh with metadata
set(version ${PROJECT_VERSION})
execute_process(COMMAND git rev-parse HEAD
RESULT_VARIABLE git_return
Expand All @@ -75,7 +70,7 @@ if(git_return)
else()
string(REGEX REPLACE "\n$" "" commit ${commit})
endif()
string(TIMESTAMP date "%m/%d/%Y")
string(TIMESTAMP date "%Y/%m/%d")
set(author $ENV{USERNAME})
set(origin ${CMAKE_HOST_SYSTEM_NAME})
configure_file(
Expand Down
11 changes: 1 addition & 10 deletions cmake/modules/Findcpcmx.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,13 @@ set(_pkg "cpcmx")
set(_url "https://github.com/grimme-lab/CPCM-X")

if(NOT DEFINED "${_pkg}_FIND_METHOD")
if(DEFINED "${PROJECT_NAME}-dependency-method")
set("${_pkg}_FIND_METHOD" "${${PROJECT_NAME}-dependency-method}")
else()
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
endif()
set("_${_pkg}_FIND_METHOD")
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake")

xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}")

if(DEFINED "_${_pkg}_FIND_METHOD")
unset("${_pkg}_FIND_METHOD")
unset("_${_pkg}_FIND_METHOD")
endif()
unset(_lib)
unset(_pkg)
unset(_url)
11 changes: 1 addition & 10 deletions cmake/modules/Findmctc-lib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,13 @@ set(_pkg "MCTCLIB")
set(_url "https://github.com/grimme-lab/mctc-lib")

if(NOT DEFINED "${_pkg}_FIND_METHOD")
if(DEFINED "${PROJECT_NAME}-dependency-method")
set("${_pkg}_FIND_METHOD" "${${PROJECT_NAME}-dependency-method}")
else()
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
endif()
set("_${_pkg}_FIND_METHOD")
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake")

xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}")

if(DEFINED "_${_pkg}_FIND_METHOD")
unset("${_pkg}_FIND_METHOD")
unset("_${_pkg}_FIND_METHOD")
endif()
unset(_lib)
unset(_pkg)
unset(_url)
12 changes: 2 additions & 10 deletions cmake/modules/Findtblite.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,14 @@ set(_pkg "TBLITE")
set(_url "https://github.com/tblite/tblite")

if(NOT DEFINED "${_pkg}_FIND_METHOD")
if(DEFINED "${PROJECT_NAME}-dependency-method")
set("${_pkg}_FIND_METHOD" "${${PROJECT_NAME}-dependency-method}")
else()
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
endif()
set("_${_pkg}_FIND_METHOD")
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
set("_${_pkg}_FIND_METHOD")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake")

xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}")

if(DEFINED "_${_pkg}_FIND_METHOD")
unset("${_pkg}_FIND_METHOD")
unset("_${_pkg}_FIND_METHOD")
endif()
unset(_lib)
unset(_pkg)
unset(_url)
12 changes: 2 additions & 10 deletions cmake/modules/Findtest-drive.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,14 @@ set(_pkg "TEST_DRIVE")
set(_url "https://github.com/fortran-lang/test-drive")

if(NOT DEFINED "${_pkg}_FIND_METHOD")
if(DEFINED "${PROJECT_NAME}-dependency-method")
set("${_pkg}_FIND_METHOD" "${${PROJECT_NAME}-dependency-method}")
else()
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
endif()
set("_${_pkg}_FIND_METHOD")
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
set("_${_pkg}_FIND_METHOD")
endif()

include("${CMAKE_CURRENT_LIST_DIR}/xtb-utils.cmake")

xtb_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}")

if(DEFINED "_${_pkg}_FIND_METHOD")
unset("${_pkg}_FIND_METHOD")
unset("_${_pkg}_FIND_METHOD")
endif()
unset(_lib)
unset(_pkg)
unset(_url)
Loading
Loading