Skip to content

Commit

Permalink
3.0.2 maintenance (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
pprcht authored Jan 27, 2025
2 parents cfbee30 + e1220e6 commit 2fdb721
Show file tree
Hide file tree
Showing 25 changed files with 469 additions and 211 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
build: [cmake]
build-type: [debug]
compiler: [gnu]
version: [11,12]
version: [11,12,14]

include:
- os: ubuntu-latest
Expand All @@ -48,11 +48,17 @@ jobs:
build: cmake
build-type: debugoptimized
compiler: gnu
version: 14

- os: ubuntu-latest
build: cmake
build-type: static
compiler: gnu
version: 12

- os: ubuntu-latest
build: meson
build-type: debugoptimized
build-type: static
compiler: intel
version: 2023.1.0

Expand Down Expand Up @@ -155,12 +161,6 @@ jobs:
--prefix=$PWD/_dist
--libdir=lib
--warnlevel=0
# ${{ env.MESON_ARGS }}
# env:
# COVERAGE: ${{ matrix.build-type == 'coverage' }}
# MESON_ARGS: >-
# ${{ matrix.compiler == 'intel' && '-Dfortran_link_args=-qopenmp -Dapi=false' || '' }}
# ${{ contains(matrix.os, 'macos') && '-Dlapack=openblas' || '' }}
- name: Configure build (CMake, debug)
if: ${{ matrix.build == 'cmake' && matrix.build-type == 'debug' }}
Expand All @@ -179,6 +179,16 @@ jobs:
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-DCMAKE_INSTALL_LIBDIR=lib
- name: Configure build (CMake, static)
if: ${{ matrix.build == 'cmake' && matrix.build-type == 'static' }}
run: >-
cmake -B${{ env.BUILD_DIR }}
-GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
-DCMAKE_INSTALL_LIBDIR=lib
-DWITH_TESTS=OFF
-DSTATICBUILD=ON
- name: Build project
Expand All @@ -198,7 +208,7 @@ jobs:
echo "CREST_PREFIX=$PWD/_dist" >> $GITHUB_ENV
- name: Create package
if: ${{ matrix.build-type == 'debugoptimized' }}
if: ${{ matrix.build-type == 'static' }}
run: |
mkdir crest
cp COPYING crest/LICENSE
Expand All @@ -211,7 +221,7 @@ jobs:
OUTPUT: crest-${{ matrix.compiler }}-${{ matrix.version }}-${{ matrix.os }}.tar

- name: Upload package
if: ${{ matrix.build-type == 'debugoptimized' }}
if: ${{ matrix.build-type == 'static' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.CREST_OUTPUT }}
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
path = subprojects/tblite
url = https://github.com/pprcht/tblite.git
branch = xtb_solvation
[submodule "subprojects/pvol"]
path = subprojects/pvol
url = https://github.com/neudecker-group/libpvol.git
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ if(NOT TARGET "gfn0::gfn0" AND WITH_GFN0)
add_compile_definitions(WITH_GFN0)
endif()

# XHCFF
if(NOT TARGET "xhcff::xhcff" AND WITH_XHCFF)
find_package("xhcff" REQUIRED)
add_compile_definitions(WITH_XHCFF)
# libpvol
if(NOT TARGET "pvol::pvol" AND WITH_LIBPVOL)
find_package("libpvol" REQUIRED)
add_compile_definitions(WITH_LIBPVOL)
endif()

# lwONIOM
Expand Down Expand Up @@ -150,7 +150,7 @@ if(WITH_OBJECT AND NOT STATICBUILD)
$<$<BOOL:${WITH_TBLITE}>:tblite::tblite>
$<$<BOOL:${WITH_GFN0}>:gfn0::gfn0>
$<$<BOOL:${WITH_GFNFF}>:gfnff::gfnff>
$<$<BOOL:${WITH_XHCFF}>:xhcff::xhcff>
$<$<BOOL:${WITH_LIBPVOL}>:pvol::pvol>
$<$<BOOL:${WITH_TOMLF}>:toml-f::toml-f>
$<$<BOOL:${WITH_LWONIOM}>:lwoniom::lwoniom>
$<$<BOOL:${WITH_OpenMP}>:OpenMP::OpenMP_Fortran>
Expand Down Expand Up @@ -201,7 +201,7 @@ target_link_libraries(
$<$<BOOL:${WITH_TBLITE}>:tblite::tblite>
$<$<BOOL:${WITH_GFN0}>:gfn0::gfn0>
$<$<BOOL:${WITH_GFNFF}>:gfnff::gfnff>
$<$<BOOL:${WITH_XHCFF}>:xhcff::xhcff>
$<$<BOOL:${WITH_LIBPVOL}>:pvol::pvol>
$<$<BOOL:${WITH_TOMLF}>:toml-f::toml-f>
$<$<BOOL:${WITH_LWONIOM}>:lwoniom::lwoniom>
$<$<BOOL:${STATICBUILD}>:-static>
Expand Down Expand Up @@ -246,7 +246,7 @@ if (WITH_OBJECT AND NOT STATICBUILD)
$<$<BOOL:${WITH_TBLITE}>:tblite::tblite>
$<$<BOOL:${WITH_GFN0}>:gfn0::gfn0>
$<$<BOOL:${WITH_GFNFF}>:gfnff::gfnff>
$<$<BOOL:${WITH_XHCFF}>:xhcff::xhcff>
$<$<BOOL:${WITH_LIBPVOL}>:pvol::pvol>
$<$<BOOL:${WITH_TOMLF}>:toml-f::toml-f>
$<$<BOOL:${WITH_LWONIOM}>:lwoniom::lwoniom>
)
Expand Down
2 changes: 1 addition & 1 deletion assets/template/metadata.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
character(len=*),parameter :: gfn0var = "@gfn0var@"
character(len=*),parameter :: gfnffvar = "@gfnffvar@"
character(len=*),parameter :: tblitevar = "@tblitevar@"
character(len=*),parameter :: xhcffvar = "@xhcffvar@"
character(len=*),parameter :: libpvolvar = "@libpvolvar@"
character(len=*),parameter :: lwoniomvar = "@lwoniomvar@"
7 changes: 4 additions & 3 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ option(WITH_TBLITE "Enable support for tblite" TRUE)
option(WITH_TOMLF "Enable support for toml-f" TRUE)
option(WITH_GFN0 "Enable support for GFN0-xTB" TRUE)
option(WITH_GFNFF "Enable support for GFN-FF" TRUE)
option(WITH_XHCFF "Enable support for XHCFF" FALSE)
option(WITH_LIBPVOL "Enable support for LIBPVOL" FALSE)
option(WITH_LWONIOM "Enable support for lwONIOM" TRUE)
option(WITH_TESTS "Enable unit tests" TRUE)

option(STATICBUILD "Attempt to link everything statically" FALSE) # doesn't work yet
option(STATICBUILD "Attempt to link everything statically" FALSE)
set(PYTHON_BINDINGS OFF CACHE BOOL "Disable python bindings for submodules that have them" FORCE)

#########################################################################################
#########################################################################################
Expand Down Expand Up @@ -100,7 +101,7 @@ set(tomlfvar "${WITH_TOMLF}")
set(gfn0var "${WITH_GFN0}")
set(gfnffvar "${WITH_GFNFF}")
set(tblitevar "${WITH_TBLITE}")
set(xhcffvar "${WITH_XHCFF}")
set(libpvolvar "${WITH_LIBPVOL}")
set(lwoniomvar "${WITH_LWONIOM}")

configure_file(
Expand Down
16 changes: 8 additions & 8 deletions config/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,15 @@ if get_option('WITH_GFNFF')
endif


# XHCFF
if get_option('WITH_XHCFF')
add_project_arguments('-DWITH_XHCFF', language: 'fortran')
xhcff_dep = dependency(
'xhcff',
fallback: ['xhcff', 'xhcfflib_dep'],
# LIBPVOL
if get_option('WITH_LIBPVOL')
add_project_arguments('-DWITH_LIBPVOL', language: 'fortran')
libpvol_dep = dependency(
'libpvol',
fallback: ['libpvol', 'libpvollib_dep'],
default_options: ['default_library=static'],
)
exe_deps += xhcff_dep
exe_deps += libpvol_dep
endif


Expand Down Expand Up @@ -292,7 +292,7 @@ config = configuration_data({
'gfn0var': get_option('WITH_GFN0'),
'gfnffvar': get_option('WITH_GFNFF'),
'tblitevar': get_option('WITH_TBLITE'),
'xhcffvar': get_option('WITH_XHCFF'),
'libpvolvar': get_option('WITH_LIBPVOL'),
'lwoniomvar': get_option('WITH_LWONIOM'),
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# You should have received a copy of the GNU Lesser General Public License
# along with crest. If not, see <https://www.gnu.org/licenses/>.

set(_lib "xhcff")
set(_pkg "XHCFF")
set(_url "https://github.com/zellerf/xhcff-lib")
set(_lib "pvol")
set(_pkg "PVOL")
set(_url "https://github.com/neudecker-group/libpvol.git")

if(NOT DEFINED "${_pkg}_FIND_METHOD")
set("${_pkg}_FIND_METHOD" "subproject" "cmake" "fetch" "pkgconf" )
Expand All @@ -27,10 +27,10 @@ include("${CMAKE_CURRENT_LIST_DIR}/crest-utils.cmake")
crest_find_package("${_lib}" "${${_pkg}_FIND_METHOD}" "${_url}")

set(found FALSE)
if(TARGET "xhcff::xhcff")
if(TARGET "pvol::pvol")
set (found TRUE)
endif()
message(STATUS "Found xhcff: ${found}")
message(STATUS "Found libpvol: ${found}")

unset(_lib)
unset(_pkg)
Expand Down
4 changes: 2 additions & 2 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ option(
description: 'build with toml-f integration',
)
option(
'WITH_XHCFF',
'WITH_LIBPVOL',
type: 'boolean',
value: false,
description: 'build with XHCFF integration',
description: 'build with libpvol integration',
)

option(
Expand Down
3 changes: 2 additions & 1 deletion src/algos/crossing.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ subroutine crest_crossing(env,maxgen,fname,maxpairs)
implicit none
!> INPUT
type(systemdata),intent(inout) :: env
integer,intent(in) :: maxgen
integer,intent(inout) :: maxgen
character(len=*),intent(in),optional :: fname
real(wp),intent(in),optional :: maxpairs
!> LOCAL
Expand Down Expand Up @@ -69,6 +69,7 @@ subroutine crest_crossing(env,maxgen,fname,maxpairs)
call rdensemble(ensnam,nat,nall,at,xyz,eread)
if (nall .lt. 2) then
write (stdout,*) 'Not enough structures to perform GC!'
maxgen=0
return
end if

Expand Down
1 change: 1 addition & 0 deletions src/algos/search_conformers.f90
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ subroutine crest_newcross3(env)
call touch(trim(tmppath))
call crest_crossing(env,imax,trim(refnam),env%gcmaxparent)
if (imax .lt. 1) then
call remove(trim(tmppath))
return
exit
end if
Expand Down
2 changes: 1 addition & 1 deletion src/calculator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ list(APPEND srcs
"${dir}/api_helpers.F90"
"${dir}/api_engrad.f90"
"${dir}/gradreader.f90"
"${dir}/xhcff.F90"
"${dir}/libpvol.F90"
"${dir}/subprocess_types.f90"
"${dir}/xtb_sc.f90"
"${dir}/orca_sc.f90"
Expand Down
39 changes: 22 additions & 17 deletions src/calculator/api_engrad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ module api_engrad
use tblite_api
use gfn0_api
use gfnff_api
use xhcff_api
use libpvol_api
use lj
implicit none
!>--- private module variables and parameters
Expand All @@ -42,7 +42,7 @@ module api_engrad
public :: tblite_engrad
public :: gfn0_engrad,gfn0occ_engrad
public :: gfnff_engrad
public :: xhcff_engrad
public :: libpvol_engrad
public :: lj_engrad !> RE-EXPORT

!=========================================================================================!
Expand Down Expand Up @@ -76,7 +76,7 @@ subroutine tblite_engrad(mol,calc,energy,grad,iostatus)
call tblite_init(calc,loadnew)
!>--- tblite printout handling
call api_handle_output(calc,'tblite.out',mol,pr)
if (pr) then
if (pr .or. calc%prstdout) then
!> tblite uses its context (ctx) type, rather than calc%prch
calc%tblite%ctx%unit = calc%prch
calc%tblite%ctx%verbosity = 1
Expand Down Expand Up @@ -105,7 +105,8 @@ subroutine tblite_engrad(mol,calc,energy,grad,iostatus)
call tblite_singlepoint(mol,calc%chrg,calc%uhf,calc%tblite, &
& energy,grad,iostatus)
if (iostatus /= 0) return
call api_print_e_grd(pr,calc%prch,mol,energy,grad)
if(.not.calc%prstdout) &
& call api_print_e_grd(pr,calc%prch,mol,energy,grad)

!>--- postprocessing, getting other data
!$omp critical
Expand Down Expand Up @@ -160,7 +161,8 @@ subroutine gfn0_engrad(mol,calc,g0calc,energy,grad,iostatus)
if (iostatus /= 0) return
if (pr) then
call gfn0_print(calc%prch,g0calc,res)
call api_print_e_grd(pr,calc%prch,mol,energy,grad)
if(.not.calc%prstdout) &
& call api_print_e_grd(pr,calc%prch,mol,energy,grad)
end if

!>--- postprocessing, getting other data
Expand Down Expand Up @@ -215,7 +217,8 @@ subroutine gfn0occ_engrad(mol,calc,g0calc,energy,grad,iostatus)
if (iostatus /= 0) return
if (pr) then
call gfn0_print(calc%prch,g0calc,res)
call api_print_e_grd(pr,calc%prch,mol,energy,grad)
if(.not.calc%prstdout) &
& call api_print_e_grd(pr,calc%prch,mol,energy,grad)
end if

!>--- postprocessing, getting other data
Expand Down Expand Up @@ -267,7 +270,8 @@ subroutine gfnff_engrad(mol,calc,energy,grad,iostatus)
!>--- printout
if (pr) then
call gfnff_printout(calc%prch,calc%ff_dat)
call api_print_e_grd(pr,calc%prch,mol,energy,grad)
if(.not.calc%prstdout) &
& call api_print_e_grd(pr,calc%prch,mol,energy,grad)
end if

!>--- postprocessing, getting other data
Expand All @@ -280,7 +284,7 @@ end subroutine gfnff_engrad

!========================================================================================!

subroutine xhcff_engrad(mol,calc,energy,grad,iostatus)
subroutine libpvol_engrad(mol,calc,energy,grad,iostatus)
!***************************************************************
!* Interface singlepoint call between CREST and XHC force field
!***************************************************************
Expand All @@ -300,33 +304,34 @@ subroutine xhcff_engrad(mol,calc,energy,grad,iostatus)
pr = .false.
!>--- setup system call information
!$omp critical
call xhcff_initcheck(calc,loadnew)
call libpvol_initcheck(calc,loadnew)
!>--- printout handling
call api_handle_output(calc,'xhcff.out',mol,pr)
call api_handle_output(calc,'libpvol.out',mol,pr)
!>--- populate parameters
if (loadnew) then
!> call xhcff with verbosity turned off
call xhcff_setup(mol,calc%xhcff,calc%extpressure,calc%ngrid,calc%proberad, &
& calc%vdwset,pr,calc%prch,iostatus)
!> call libpvol with verbosity turned off
call libpvol_setup(mol,calc%libpvol,calc%extpressure,calc%pvmodel, &
& calc%ngrid,calc%proberad,calc%vdwset,calc%pvradscal,pr,calc%prch,iostatus)
end if
!$omp end critical
if (iostatus /= 0) return

!>--- do the engrad call
call initsignal()
call xhcff_sp(mol,calc%xhcff,energy,grad,iostatus)
call libpvol_sp(mol,calc%libpvol,energy,grad,iostatus)
if (iostatus /= 0) return

!>--- printout
if (pr) then
!> the xhcff_sp call includes the printout within xhcff-lib
call api_print_e_grd(pr,calc%prch,mol,energy,grad)
!> the libpvol_sp call includes the printout within libpvol-lib
if(.not.calc%prstdout) &
& call api_print_e_grd(pr,calc%prch,mol,energy,grad)
end if

!>--- postprocessing, getting other data

return
end subroutine xhcff_engrad
end subroutine libpvol_engrad

!========================================================================================!
!========================================================================================!
Expand Down
Loading

0 comments on commit 2fdb721

Please sign in to comment.