Skip to content

Commit 77b5398

Browse files
committed
Merge branch 'master' into gpu-eri-opt.
2 parents 7c786d1 + d5a2d45 commit 77b5398

15 files changed

+121
-76
lines changed

cmake/3rdPartyTools.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ zlib
1414
libbz2
1515
boost
1616
kmmd
17-
libm)
17+
libm
18+
plumed)
1819

1920
set(3RDPARTY_TOOL_USES
2021
"for fundamental linear algebra calculations"
@@ -25,7 +26,8 @@ set(3RDPARTY_TOOL_USES
2526
"for various compression and decompression tasks"
2627
"for supporting the gamma distribution"
2728
"Machine-learning molecular dynamics"
28-
"for fundamental math routines if they are not contained in the C library")
29+
"for fundamental math routines if they are not contained in the C library"
30+
"tools for enchanced sampling, free energies, and trajectory analysis")
2931

3032
else()
3133

cmake/CompilerFlags.cmake

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
7474
if(TARGET_ARCH STREQUAL x86_64)
7575
#-mfpmath=sse is default for x86_64, no need to specific it
7676
set(OPT_CFLAGS ${OPT_CFLAGS} "-mtune=native")
77-
else() # i386 needs to be told to use sse prior to using -mfpmath=sse
78-
set(OPT_CFLAGS "${OPT_CFLAGS} -mtune=native -msse -mfpmath=sse")
7977
endif()
8078
endif()
8179
endif()
@@ -118,8 +116,6 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
118116
if(TARGET_ARCH STREQUAL x86_64)
119117
#-mfpmath=sse is default for x86_64, no need to specific it
120118
set(OPT_CXXFLAGS ${OPT_CXXFLAGS} "-mtune=native")
121-
else() # i386 needs to be told to use sse prior to using -mfpmath=sse
122-
set(OPT_CXXFLAGS "${OPT_CXXFLAGS} -mtune=native -msse -mfpmath=sse")
123119
endif()
124120
endif()
125121
endif()
@@ -156,8 +152,6 @@ if("${CMAKE_Fortran_COMPILER_ID}" STREQUAL "GNU")
156152
if(TARGET_ARCH STREQUAL x86_64)
157153
#-mfpmath=sse is default for x86_64, no need to specific it
158154
set(OPT_FFLAGS ${OPT_FFLAGS} -mtune=native)
159-
else() # i386 needs to be told to use sse prior to using -mfpmath=sse
160-
set(OPT_FFLAGS ${OPT_FFLAGS} -mtune=native -msse -mfpmath=sse)
161155
endif()
162156
endif()
163157
endif()
@@ -195,7 +189,7 @@ endif()
195189
if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang")
196190
add_flags(C -Wall -Wno-unused-function)
197191

198-
list(APPEND OPT_CFLAGS "-mtune=native")
192+
# list(APPEND OPT_CFLAGS "-mtune=native")
199193

200194
#if we are crosscompiling and using clang, tell CMake this
201195
if(CROSSCOMPILE)
@@ -214,7 +208,7 @@ endif()
214208
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
215209
add_flags(CXX -Wall -Wno-unused-function)
216210

217-
list(APPEND OPT_CXXFLAGS "-mtune=native")
211+
# list(APPEND OPT_CXXFLAGS "-mtune=native")
218212

219213
if(CROSSCOMPILE)
220214
set(CMAKE_CXX_COMPILER_TARGET ${TARGET_TRIPLE})

cmake/ExternalPrograms.cmake

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ check_library_exists(dl dlopen "" HAVE_LIBDL)
1010
#-----------------------------------
1111
# M4 for XLeap
1212
#-----------------------------------
13-
find_program(M4 m4)
13+
if(BSD)
14+
find_program(M4 gm4)
15+
if(NOT M4)
16+
find_program(M4 m4)
17+
endif()
18+
else()
19+
find_program(M4 m4)
20+
endif()
1421

1522
#------------------------------------------------------------------------------
1623
# Flex
@@ -38,5 +45,9 @@ option(CAN_BUILD_AUTOMAKE "Whether it is possible to build dependencies which us
3845
#------------------------------------------------------------------------------
3946
# make, for configure scripts
4047
#------------------------------------------------------------------------------
41-
set(MAKE_COMMAND make CACHE STRING "Command to run to make 3rd party projects with autotools / make-based build systems.")
48+
if(BSD)
49+
set(MAKE_COMMAND gmake CACHE STRING "Command to run to make 3rd party projects with autotools / make-based build systems.")
50+
else()
51+
set(MAKE_COMMAND make CACHE STRING "Command to run to make 3rd party projects with autotools / make-based build systems.")
52+
endif()
4253

cmake/FixCondaShebang/FixCondaShebang.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# figure out bad shebang to replace, and replacement
1313
set(BUILD_TREE_SHEBANG "#!${MINICONDA_INSTALL_DIR}/bin/python")
14+
set(BUILD_TREE_SHEBANGB "#!python")
1415
set(INSTALL_TREE_SHEBANG "#!${AMBER_INSTALL_DIR}/miniconda/bin/python")
1516

1617
# get files to fix
@@ -46,4 +47,5 @@ configuretime_file_replace(${JUPYTER_KERNEL_JSON} ${JUPYTER_KERNEL_JSON} TO_REPL
4647

4748
foreach(FILE ${FILES_NEEDING_REPLACEMENT})
4849
configuretime_file_replace(${FILE} ${FILE} TO_REPLACE ${BUILD_TREE_SHEBANG} REPLACEMENT ${INSTALL_TREE_SHEBANG})
50+
configuretime_file_replace(${FILE} ${FILE} TO_REPLACE ${BUILD_TREE_SHEBANGB} REPLACEMENT ${INSTALL_TREE_SHEBANG})
4951
endforeach()

cmake/ModulePaths.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ set(SANDER_COMMON_OMP_MOD_DIR "${MODULE_BASE_DIR}/sander/omp")
2828
set(SEBOMD_MOD_DIR "${MODULE_BASE_DIR}/sebomd")
2929
set(SEBOMD_MPI_MOD_DIR "${MODULE_BASE_DIR}/sebomd/mpi")
3030
set(RISMLIB_MOD_DIR "${MODULE_BASE_DIR}/rism/lib")
31+
set(RISMLIB_CUDA_MOD_DIR "${MODULE_BASE_DIR}/rism/lib/cuda")
32+
set(RISMLIB_CUDA_MOD_DIR_DOUBLE "${MODULE_BASE_DIR}/rism/lib/cuda_double")
3133
set(RISMLIB_MPI_MOD_DIR "${MODULE_BASE_DIR}/rism/lib/mpi")
3234
set(RISMLIB_SANDER_INTERFACE_DIR "${MODULE_BASE_DIR}/rism/sander_interface")
3335
set(RISMLIB_SANDER_INTERFACE_MPI_DIR "${MODULE_BASE_DIR}/rism/sander_interface/mpi")
3436
set(RISMLIB_SFF_INTERFACE_DIR "${MODULE_BASE_DIR}/rism/sff_interface")
37+
set(RISMLIB_SFF_INTERFACE_CUDA_DIR "${MODULE_BASE_DIR}/rism/sff_interface/cuda")
3538
set(RISMLIB_SFF_INTERFACE_MPI_DIR "${MODULE_BASE_DIR}/rism/sff_interface/mpi")
3639
set(RISM1D_MOD_DIR "${MODULE_BASE_DIR}/rism/1d")
3740
set(RISMTHERMO_MOD_DIR "${MODULE_BASE_DIR}/rism/thermo")
@@ -53,9 +56,9 @@ set(GBNSR6_MOD_DIR "${MODULE_BASE_DIR}/gbnsr6")
5356
set(GBNSR6_MPI_MOD_DIR "${MODULE_BASE_DIR}/gbnsr6/mpi")
5457

5558
file(MAKE_DIRECTORY ${AMBER_COMMON_MOD_DIR} ${SQMLIB_MOD_DIR} ${SQMEXE_MOD_DIR} ${LIBPBSA_MOD_DIR} ${LIBPBSA_SANDER_MOD_DIR}
56-
${PBSAEXE_MOD_DIR} ${SANDER_COMMON_MOD_DIR} ${SEBOMD_MOD_DIR} ${RISMLIB_MOD_DIR} ${RISM1D_MOD_DIR} ${RISMTHERMO_MOD_DIR}
59+
${PBSAEXE_MOD_DIR} ${SANDER_COMMON_MOD_DIR} ${SEBOMD_MOD_DIR} ${RISMLIB_MOD_DIR} ${RISMLIB_CUDA_MOD_DIR} ${RISMLIB_CUDA_MOD_DIR_DOUBLE} ${RISM1D_MOD_DIR} ${RISMTHERMO_MOD_DIR}
5760
${RISMORAVE_MOD_DIR} ${VOLSLICE_MOD_DIR} ${NMODE_MOD_DIR} ${QUICK_MOD_DIR} ${DIVICON_MOD_DIR} ${CHAMBER_MOD_DIR} ${SFF_MOD_DIR}
5861
${GBNSR6_MOD_DIR} ${RISMLIB_MPI_MOD_DIR} ${LIBPBSA_MPI_MOD_DIR} ${LIBPBSA_SANDER_MPI_MOD_DIR} ${SANDER_COMMON_MPI_MOD_DIR}
5962
${RISMLIB_SANDER_INTERFACE_DIR} ${RISMLIB_SANDER_INTERFACE_MPI_DIR} ${RISMLIB_SFF_INTERFACE_DIR} ${SANDER_COMMON_OMP_MOD_DIR}
60-
${RISMLIB_SFF_INTERFACE_MPI_DIR} ${SEBOMD_MPI_MOD_DIR} ${QUICK_MPI_MOD_DIR} ${QUICK_CUDA_MOD_DIR} ${QUICK_CUDA_MPI_MOD_DIR}
63+
${RISMLIB_SFF_INTERFACE_MPI_DIR} ${RISMLIB_SFF_INTERFACE_CUDA_DIR} ${SEBOMD_MPI_MOD_DIR} ${QUICK_MPI_MOD_DIR} ${QUICK_CUDA_MOD_DIR} ${QUICK_CUDA_MPI_MOD_DIR}
6164
${QUICK_REAL_AMB_INTERFACE_MOD_DIR} ${QUICK_FAKE_AMB_INTERFACE_MOD_DIR} ${GBNSR6_MPI_MOD_DIR} ${PBSAEXE_CUDA_MOD_DIR})

cmake/PMEMDCompilerFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ if(CUDA)
243243
set(PMEMD_NVCC_FLAGS -O3)
244244
# list(APPEND PMEMD_NVCC_FLAGS -ffast-math)
245245

246-
list(APPEND PMEMD_NVCC_FLAGS -std=c++14)
246+
list(APPEND PMEMD_NVCC_FLAGS -std=c++17)
247247

248248
if(DISABLE_WARNINGS)
249249
list(APPEND PMEMD_NVCC_FLAGS -w)

cmake/PythonBuildConfig.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ if(BUILD_PYTHON)
2424
#------------------------------------------------------------------------------
2525

2626
option(SKIP_PYTHON_PACKAGE_CHECKS "If true, the buildscript will not verify that you have the needed Python packages to run Amber's Python programs." FALSE)
27+
option(PMMG_GUI_DEPS "Automatically install packmol-memgen web GUI dependencies (fastapi, uvicorn, etc.) during make install" OFF)
2728

2829
if(NOT SKIP_PYTHON_PACKAGECHECKS)
2930

3031
# check "normal" packages
3132
# --------------------------------------------------------------------
3233

33-
set(NEEDED_PYTHON_PACKAGES numpy scipy matplotlib setuptools)
34+
set(NEEDED_PYTHON_PACKAGES numpy scipy matplotlib setuptools pandas numba gemmi)
3435
set(HAVE_ALL_PYTHON_PACKAGES TRUE)
3536

3637
# in Amber releases cython is not needed since pytraj will have been pre-cythonized

cmake/UseMiniconda.cmake

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
# This script does not work when crosscompiling.
33
# Note: to make the initial changes as limited as possible the phrase
44
# "MINICONDA" is retained for now, but the actual download and
5-
# installation comes from Miniforge3. Only tests on Linux x86_64 so
6-
# far, not (for example) on OSX.
5+
# installation comes from Miniforge3.
76

87
# Send the version variables up one scope level from the caller of this macro
98
macro(proxy_python_version)
@@ -28,12 +27,14 @@ function(download_and_use_miniconda)
2827
if(TARGET_WINDOWS)
2928
set(MINICONDA_PYTHON ${MINICONDA_INSTALL_DIR}/python.exe)
3029
set(CONDA ${MINICONDA_INSTALL_DIR}/Scripts/conda.exe)
30+
set(MAMBA ${MINICONDA_INSTALL_DIR}/Scripts/mamba.exe)
3131
set(PIP ${MINICONDA_INSTALL_DIR}/Scripts/pip.exe)
3232
else()
3333
set(MINICONDA_PYTHON ${MINICONDA_INSTALL_DIR}/bin/python)
3434

3535
# execute using interpreter in case the miniconda install folder is in a long path and the script shebang doesn't work
36-
set(CONDA ${MINICONDA_PYTHON} ${MINICONDA_INSTALL_DIR}/bin/conda)
36+
set(CONDA ${MINICONDA_PYTHON} ${MINICONDA_INSTALL_DIR}/bin/conda)
37+
set(MAMBA ${MINICONDA_INSTALL_DIR}/bin/mamba)
3738
set(PIP ${MINICONDA_PYTHON} ${MINICONDA_INSTALL_DIR}/bin/pip)
3839
endif()
3940

@@ -158,26 +159,19 @@ function(download_and_use_miniconda)
158159
# if the miniconda version has been specified (-DMINICONDA_VERSION=...)
159160
# then do not update conda
160161
if(MINICONDA_AUTO)
161-
162-
# not needed for miniforge:
163-
# execute_process(COMMAND ${CONDA} install -y --solver=classic conda-forge::conda-libmamba-solver conda-forge::libmamba conda-forge::libmambapy conda-forge::libarchive)
164-
# execute_process(COMMAND ${CONDA} update --all -y)
165162
execute_process(COMMAND ${CONDA} update conda -y)
166163
endif()
164+
execute_process(COMMAND ${CONDA} install -y python=3.12)
167165
execute_process(COMMAND ${MINICONDA_PYTHON} -m pip install pip --upgrade)
168166

167+
execute_process(COMMAND ${MINICONDA_PYTHON} -m pip install --no-cache-dir --no-binary=mpi4py mpi4py)
168+
169169
# Prefer non-mkl packages.
170170
# This is because if Amber is using MKL, when Python programs run they will try to talk to two
171171
# different MKL libraries at the same time: the MKL Miniconda python was linked with, and the MKL
172172
# Amber was linked with.
173173
# So, to fix this, we make sure Miniconda is not using MKL.
174-
execute_process(COMMAND ${CONDA} install -y nomkl)
175-
176-
execute_process(COMMAND ${CONDA} install -y -c conda-forge f90nml mrcfile pdb2pqr)
177-
execute_process(COMMAND ${CONDA} install -y pandas)
178-
179-
execute_process(COMMAND ${CONDA} install -y -q conda-build numpy=1.26.4 scipy cython=0.29 ipython notebook pytest
180-
RESULT_VARIABLE PACKAGE_INSTALL_RETVAL)
174+
execute_process(COMMAND ${MAMBA} install -y -c conda-forge nomkl f90nml mrcfile pdb2pqr pandas numba gemmi rdkit conda-build numpy=1.26.4 scipy cython=0.29 ipython notebook pytest mock RESULT_VARIABLE PACKAGE_INSTALL_RETVAL)
181175
if(NOT ${PACKAGE_INSTALL_RETVAL} EQUAL 0)
182176
message(FATAL_ERROR "Installation of packages failed! Please fix what's wrong, or disable Miniconda.")
183177
endif()
@@ -188,7 +182,7 @@ function(download_and_use_miniconda)
188182
execute_process(COMMAND ${MINICONDA_PYTHON} -m pip --cache-dir=${MINICONDA_INSTALL_DIR}/pkgs install matplotlib RESULT_VARIABLE MATPLOTLIB_RETVAL)
189183
if(NOT ${MATPLOTLIB_RETVAL} EQUAL 0)
190184
# try again with conda
191-
execute_process(COMMAND ${CONDA} install -y -q matplotlib RESULT_VARIABLE MATPLOTLIB_RETVAL)
185+
execute_process(COMMAND ${MAMBA} install -y -q matplotlib RESULT_VARIABLE MATPLOTLIB_RETVAL)
192186
if(NOT ${MATPLOTLIB_RETVAL} EQUAL 0)
193187
message(FATAL_ERROR "Failed to install matplotlib! Please fix what's wrong, or disable Miniconda.")
194188
endif()
@@ -198,7 +192,7 @@ function(download_and_use_miniconda)
198192
# the loser is always your own sanity!
199193
if(TARGET_WINDOWS AND MINGW)
200194
# Install a MinGW import library for python (discussed at https://github.com/Theano/Theano/issues/2087)
201-
execute_process(COMMAND ${CONDA} install -y -q -c anaconda libpython)
195+
execute_process(COMMAND ${MAMBA} install -y -q -c anaconda libpython)
202196

203197
# die, preprocessor define that breaks the <cmath> header!
204198
# see https://github.com/python/cpython/pull/880

cmake/WhichTools.cmake

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ antechamber
3535
sqm
3636

3737
# miscellaneous:
38-
reduce
3938
sebomd
4039
emil
4140
kmmd
@@ -101,6 +100,8 @@ pysander
101100
pytraj
102101
pdb4amber
103102
packmol_memgen
103+
packmol_memgen/web
104+
PyPE_RESP
104105

105106
# moft
106107
moft
@@ -205,6 +206,7 @@ tool_depends(pysander sander)
205206
tool_depends(pytraj cpptraj)
206207
tool_depends(tcpb-cpp sqm)
207208
tool_depends(tcpb-cpp/pytcpb tcpb-cpp)
209+
tool_depends(packmol_memgen/web packmol_memgen)
208210
tool_depends(cew lib)
209211
tool_depends(quick sqm cew)
210212
tool_depends(reaxff_puremd sqm)
@@ -242,7 +244,21 @@ endif()
242244

243245
#Python programs (controlled by BUILD_PYTHON option in PythonConfig.cmake)
244246
if(NOT BUILD_PYTHON)
245-
disable_tools("Python programs are disabled" pysander pytraj pymsmt mmpbsa_py parmed packmol_memgen tcpb-cpp/pytcpb)
247+
disable_tools("Python programs are disabled" pysander pytraj pymsmt mmpbsa_py parmed packmol_memgen packmol_memgen/web tcpb-cpp/pytcpb)
248+
endif()
249+
250+
option(BUILD_PMMG_GUI "Install the packmol-memgen web GUI (packmol-memgen-gui)" ON)
251+
if(NOT BUILD_PMMG_GUI)
252+
disable_tool(packmol_memgen/web "BUILD_PMMG_GUI is disabled")
253+
elseif(BUILD_PYTHON AND NOT PMMG_GUI_DEPS)
254+
execute_process(
255+
COMMAND "${PYTHON_EXECUTABLE}" -c
256+
"import fastapi, uvicorn, pydantic, multipart, webview, PySide6, qtpy"
257+
RESULT_VARIABLE _pmmg_web_deps_result)
258+
if(NOT _pmmg_web_deps_result EQUAL 0)
259+
disable_tool(packmol_memgen/web
260+
"Web GUI dependencies not found (set -DPMMG_GUI_DEPS=ON to install them automatically)")
261+
endif()
246262
endif()
247263

248264
if(STATIC)
@@ -252,7 +268,7 @@ if(STATIC)
252268
endif()
253269

254270
if(boost_DISABLED)
255-
disable_tools("Requires boost" packmol_memgen moft)
271+
disable_tools("Requires boost" moft)
256272
endif()
257273

258274
# Perl programs
@@ -265,9 +281,9 @@ if(perlmol_DISABLED)
265281
endif()
266282

267283
#deprecated programs
268-
option(BUILD_DEPRECATED "Build outdated and deprecated tools, such as ptraj, moft" FALSE)
284+
option(BUILD_DEPRECATED "Build outdated and deprecated tools, such as ptraj" FALSE)
269285
if(NOT BUILD_DEPRECATED)
270-
disable_tools("Deprecated tools are disabled" ptraj moft )
286+
disable_tools("Deprecated tools are disabled" ptraj )
271287
endif()
272288

273289
# in-development programs

quick-cmake/QUICKCudaConfig.cmake

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(QUICK_GPU_PLATFORM "CUDA")
66
set(QUICK_GPU_TARGET_NAME "cuda")
77
set(GPU_LD_FLAGS "") # hipcc requires special flags for linking (see below)
88

9-
if(CUDA)
9+
if(CUDA AND NOT HIP)
1010
find_package(CUDA REQUIRED)
1111

1212
if(NOT CUDA_FOUND)
@@ -332,11 +332,9 @@ if(CUDA)
332332
if(NOT INSIDE_AMBER)
333333
# --------------------------------------------------------------------
334334
# import a couple of CUDA libraries used by amber tools
335-
336335
import_library(cublas "${CUDA_cublas_LIBRARY}")
337336
import_library(cusolver "${CUDA_cusolver_LIBRARY}")
338337
endif()
339-
340338
endif()
341339

342340
#option(HIP "Build ${PROJECT_NAME} with HIP GPU acceleration support." FALSE)
@@ -465,13 +463,14 @@ if(HIP)
465463
# # set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CUDA_NVCC_EXECUTABLE} -fgpu-rdc --hip-link <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -Wl,--unresolved-symbols=ignore-in-object-files <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
466464
# endif()
467465

468-
import_library(cublas "${CUDA_cublas_LIBRARY}")
469-
import_library(cusolver "${CUDA_cusolver_LIBRARY}")
466+
if(NOT INSIDE_AMBER)
467+
# --------------------------------------------------------------------
468+
# import a couple of CUDA libraries used by amber tools
469+
import_library(cublas "${CUDA_cublas_LIBRARY}")
470+
import_library(cusolver "${CUDA_cusolver_LIBRARY}")
471+
endif()
470472

471473
if(MAGMA)
472474
find_package(Magma REQUIRED)
473-
474475
endif()
475-
476476
endif()
477-

0 commit comments

Comments
 (0)