Skip to content

Commit

Permalink
Use PocketFFT (openmm#3667)
Browse files Browse the repository at this point in the history
* Use PocketFFT instead of FFTW

* Minor cleanup

* Use PocketFFT instead of fftpack for reference platform

* Remove FFTW as a dependency

* Converted a test case to use PocketFFT

* Fixed an incorrect comment
  • Loading branch information
peastman authored Jun 30, 2022
1 parent 583471a commit 1dac981
Show file tree
Hide file tree
Showing 33 changed files with 3,888 additions and 1,741 deletions.
1 change: 0 additions & 1 deletion .azure-pipelines/azure-pipelines-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- script: |
conda install cmake ^
cython ^
fftw ^
ninja ^
numpy ^
swig ^
Expand Down
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ ENDIF(${CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT})

# The source is organized into subdirectories, but we handle them all from
# this CMakeLists file rather than letting CMake visit them as SUBDIRS.
SET(OPENMM_SOURCE_SUBDIRS . openmmapi olla libraries/jama libraries/quern libraries/lepton libraries/sfmt libraries/lbfgs libraries/hilbert libraries/csha1 platforms/reference serialization libraries/irrxml)
SET(OPENMM_SOURCE_SUBDIRS . openmmapi olla libraries/jama libraries/quern libraries/lepton libraries/sfmt libraries/lbfgs libraries/hilbert libraries/csha1 libraries/pocketfft platforms/reference serialization libraries/irrxml)
IF(X86 OR ARM)
SET(OPENMM_SOURCE_SUBDIRS ${OPENMM_SOURCE_SUBDIRS} libraries/vecmath)
ENDIF()
Expand Down Expand Up @@ -392,12 +392,7 @@ ENDIF(OPENMM_BUILD_DRUDE_PLUGIN)

# CPU PME plugin

FIND_PACKAGE(FFTW QUIET)
IF(FFTW_FOUND)
SET(OPENMM_BUILD_PME_PLUGIN ON CACHE BOOL "Build CPU PME plugin")
ELSE(FFTW_FOUND)
SET(OPENMM_BUILD_PME_PLUGIN OFF CACHE BOOL "Build CPU PME plugin")
ENDIF(FFTW_FOUND)
SET(OPENMM_BUILD_PME_PLUGIN ON CACHE BOOL "Build CPU PME plugin")
SET(OPENMM_BUILD_PME_PATH)
IF(OPENMM_BUILD_PME_PLUGIN)
SET(OPENMM_BUILD_PME_PATH ${CMAKE_CURRENT_SOURCE_DIR}/plugins/cpupme)
Expand Down
10 changes: 0 additions & 10 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ install:
- "set PATH=%APPVEYOR_BUILD_FOLDER%\\cclash-0.3.14;%PATH%"
- "set CCLASH_DIR=C:\\ProgramData\\cclash"

# Download FFTW3 for PME plugin
- ps: Invoke-WebRequest ftp://ftp.fftw.org/pub/fftw/fftw-3.3.4-dll64.zip -OutFile fftw-3.3.4-dll64.zip
- 7z x fftw-3.3.4-dll64.zip -oC:\fftw > null
- cd C:\fftw
- lib /def:libfftw3f-3.def
- cd %APPVEYOR_BUILD_FOLDER%
- "set PATH=C:\\fftw;%PATH%"

# Download and install some OpenMM build dependencies (doxygen, swig)
- choco install -y doxygen.install swig > null

Expand All @@ -53,8 +45,6 @@ build_script:
"-DOPENMM_BUILD_PME_PLUGIN=ON
-DOPENCL_INCLUDE_DIR=C:/opencl/inc
-DOPENCL_LIBRARY=C:/opencl/lib/OpenCL.lib
-DFFTW_LIBRARY=C:/fftw/libfftw3f-3.lib
-DFFTW_INCLUDES=C:/fftw
-DOPENMM_BUILD_EXAMPLES=OFF
-DOPENMM_BUILD_OPENCL_TESTS=OFF
-DCMAKE_BUILD_TYPE=Release
Expand Down
24 changes: 0 additions & 24 deletions cmake_modules/FindFFTW.cmake

This file was deleted.

1 change: 0 additions & 1 deletion devtools/ci/gh-actions/conda-envs/build-M1-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- python
- cython
- swig
- fftw
- numpy
- doxygen 1.9.1
# test
Expand Down
1 change: 0 additions & 1 deletion devtools/ci/gh-actions/conda-envs/build-macos-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ dependencies:
- python
- cython
- swig
- fftw
- numpy
- doxygen 1.8.14
# test
Expand Down
1 change: 0 additions & 1 deletion devtools/ci/gh-actions/conda-envs/build-ubuntu-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- python
- cython
- swig
- fftw
- numpy
- ocl-icd-system
- doxygen 1.8.14
Expand Down
1 change: 0 additions & 1 deletion devtools/ci/gh-actions/conda-envs/build-windows-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- python
- cython
- swig
- fftw
- numpy
- doxygen 1.8.14
- khronos-opencl-icd-loader
Expand Down
7 changes: 0 additions & 7 deletions devtools/packaging/scripts/linux/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=$CLANG_PREFIX/bin/clang -DCMAKE_CXX_COMPILER=$
# Ensure we build a release
CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=Release"

# setting the rpath so that libOpenMMPME.so finds the right libfftw3
#CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
# Use NVIDIA CUDA 8.0
CMAKE_FLAGS+=" -DCUDA_CUDART_LIBRARY=/usr/local/cuda-8.0/lib64/libcudart.so"
CMAKE_FLAGS+=" -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-8.0/bin/nvcc"
Expand All @@ -84,11 +82,6 @@ CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include/"
CMAKE_FLAGS+=" -DOPENCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so"
# Generate API docs
CMAKE_FLAGS+=" -DOPENMM_GENERATE_API_DOCS=ON"
# Set location for FFTW3
PREFIX="$WORKSPACE/miniconda"
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.so"
CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.so"
# Necessary to find GL headers
CMAKE_FLAGS+=" -DCMAKE_CXX_FLAGS_RELEASE=-I/usr/include/nvidia/"

Expand Down
2 changes: 1 addition & 1 deletion devtools/packaging/scripts/linux/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ yum install -y libgcrypt

# Ensure configuration is up to date.
conda config --add channels omnia
conda install --yes --quiet swig fftw3f pip doxygen sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen lxml cmake
conda install --yes --quiet swig pip doxygen sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen lxml cmake
9 changes: 0 additions & 9 deletions devtools/packaging/scripts/osx/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,11 @@ fi

CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=$INSTALL"

# setting the rpath so that libOpenMMPME.so finds the right libfftw3
#CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
CMAKE_FLAGS+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9"
CMAKE_FLAGS+=" -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"
CMAKE_FLAGS+=" -DOPENMM_GENERATE_API_DOCS=ON"

# Build in subdirectory.
# Set location for FFTW3
PREFIX="$WORKSPACE/miniconda"
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.dylib"
CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.dylib"

# Build in subdirectory.
if [ -e build ]; then
rm -rf build
Expand Down
2 changes: 1 addition & 1 deletion devtools/packaging/scripts/osx/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ export PATH=$WORKSPACE/miniconda/bin:$PATH

# Ensure configuration is up to date.
conda config --add channels http://conda.binstar.org/omnia
conda install --yes --quiet swig fftw3f pip doxygen sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen lxml cmake
conda install --yes --quiet swig pip doxygen sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen lxml cmake
pip install sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen
7 changes: 0 additions & 7 deletions devtools/packaging/scripts/source/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ CMAKE_FLAGS+=" -DCMAKE_C_COMPILER=$CLANG_PREFIX/bin/clang -DCMAKE_CXX_COMPILER=$
# Ensure we build a release
CMAKE_FLAGS+=" -DCMAKE_BUILD_TYPE=Release"

# setting the rpath so that libOpenMMPME.so finds the right libfftw3
#CMAKE_FLAGS+=" -DCMAKE_INSTALL_RPATH=.."
# Use NVIDIA CUDA 8.0
CMAKE_FLAGS+=" -DCUDA_CUDART_LIBRARY=/usr/local/cuda-8.0/lib64/libcudart.so"
CMAKE_FLAGS+=" -DCUDA_NVCC_EXECUTABLE=/usr/local/cuda-8.0/bin/nvcc"
Expand All @@ -84,11 +82,6 @@ CMAKE_FLAGS+=" -DOPENCL_INCLUDE_DIR=/opt/AMDAPPSDK-3.0/include/"
CMAKE_FLAGS+=" -DOPENCL_LIBRARY=/opt/AMDAPPSDK-3.0/lib/x86_64/libOpenCL.so"
# Generate API docs
CMAKE_FLAGS+=" -DOPENMM_GENERATE_API_DOCS=ON"
# Set location for FFTW3
PREFIX="$WORKSPACE/miniconda"
CMAKE_FLAGS+=" -DFFTW_INCLUDES=$PREFIX/include"
CMAKE_FLAGS+=" -DFFTW_LIBRARY=$PREFIX/lib/libfftw3f.so"
CMAKE_FLAGS+=" -DFFTW_THREADS_LIBRARY=$PREFIX/lib/libfftw3f_threads.so"
# Necessary to find GL headers
CMAKE_FLAGS+=" -DCMAKE_CXX_FLAGS_RELEASE=-I/usr/include/nvidia/"

Expand Down
2 changes: 1 addition & 1 deletion devtools/packaging/scripts/source/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ yum install -y libgcrypt

# Ensure configuration is up to date.
conda config --add channels omnia
conda install --yes --quiet swig fftw3f pip doxygen sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen lxml cmake
conda install --yes --quiet swig pip doxygen sphinx sphinxcontrib-bibtex sphinxcontrib-lunrsearch sphinxcontrib-autodoc_doxygen lxml cmake
4 changes: 1 addition & 3 deletions devtools/packaging/scripts/windows/build.bat
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
mkdir build
cd build

set FFTW=C:\Miniconda3\pkgs\fftw3f-3.3.4-vc14_2\Library
set APPSDK=C:\Program Files (x86)\AMD APP SDK\2.9-1
"C:\Program Files\CMake\bin\cmake.exe" .. -G "NMake Makefiles JOM" -DCMAKE_BUILD_TYPE=Release -DOPENMM_GENERATE_API_DOCS=ON ^
-DOPENCL_INCLUDE_DIR="%APPSDK%\include" -DOPENCL_LIBRARY="%APPSDK%\lib\x86_64\OpenCL.lib" ^
-DFFTW_INCLUDES="%FFTW%/include" -DFFTW_LIBRARY="%FFTW%/lib/libfftw3f-3.lib"
-DOPENCL_INCLUDE_DIR="%APPSDK%\include" -DOPENCL_LIBRARY="%APPSDK%\lib\x86_64\OpenCL.lib"

jom
jom PythonInstall
Expand Down
2 changes: 1 addition & 1 deletion devtools/packaging/scripts/windows/prepare.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ wget https://repo.continuum.io/miniconda/Miniconda3-latest-Windows-x86_64.exe -U
# Install software with conda.

& "C:\Miniconda3\Scripts\conda.exe" config --add channels omnia --add channels conda-forge
& "C:\Miniconda3\Scripts\conda.exe" install -y fftw3f==3.3.4=vc14_2 jinja2 lxml sphinx sphinxcontrib-autodoc_doxygen sphinxcontrib-lunrsearch conda-build anaconda-client
& "C:\Miniconda3\Scripts\conda.exe" install -y jinja2 lxml sphinx sphinxcontrib-autodoc_doxygen sphinxcontrib-lunrsearch conda-build anaconda-client
& "C:\Miniconda3\Scripts\pip.exe" install sphinxcontrib.bibtex

# Install software with choco.
Expand Down
6 changes: 3 additions & 3 deletions docs-source/usersguide/library/02_compiling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ them is with conda. The following command will install everything needed to
build OpenMM.
::

conda install -c conda-forge cmake make cython swig fftw doxygen numpy
conda install -c conda-forge cmake make cython swig doxygen numpy

Step 1: Configure with CMake
============================
Expand Down Expand Up @@ -213,7 +213,7 @@ Before building OpenMM from source, you will need certain tools.
C++ compiler
------------

On Windows systems, use the C++ compiler in Visual Studio 2015 or later. You
On Windows systems, use the C++ compiler in Visual Studio 2017 or later. You
can download a free version of Visual Studio from https://visualstudio.microsoft.com.

Python
Expand Down Expand Up @@ -267,7 +267,7 @@ It will open a command window that is preconfigured for conda. Enter the
following command to install everything needed to build OpenMM.
::

conda install -c conda-forge cython swig fftw doxygen numpy
conda install -c conda-forge cython swig doxygen numpy

Step 1: Configure with CMake
============================
Expand Down
8 changes: 2 additions & 6 deletions docs-source/usersguide/library/04_platform_specifics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ The OpenCL Platform recognizes the following Platform-specific properties:
is the most accurate option, but is usually much slower than the others.
* UseCpuPme: This selects whether to use the CPU-based PME
implementation. The allowed values are “true” or “false”. Depending on your
hardware, this might (or might not) improve performance. To use this option,
you must have FFTW (single precision, multithreaded) installed, and your CPU
must support SSE 4.1.
hardware, this might (or might not) improve performance.
* OpenCLPlatformIndex: When multiple OpenCL implementations are installed on
your computer, this is used to select which one to use. The value is the
zero-based index of the platform (in the OpenCL sense, not the OpenMM sense) to use,
Expand Down Expand Up @@ -74,9 +72,7 @@ The CUDA Platform recognizes the following Platform-specific properties:
is the most accurate option, but is usually much slower than the others.
* UseCpuPme: This selects whether to use the CPU-based PME implementation.
The allowed values are “true” or “false”. Depending on your hardware, this
might (or might not) improve performance. To use this option, you must have
FFTW (single precision, multithreaded) installed, and your CPU must support SSE
4.1.
might (or might not) improve performance.
* CudaCompiler: This specifies the path to the CUDA kernel compiler. Versions
of CUDA before 7.0 require a separate compiler executable. If you do
not specify this, OpenMM will try to locate the compiler itself. Specify this
Expand Down
Loading

0 comments on commit 1dac981

Please sign in to comment.