TinkerTools / tinker

Tinker: Software Tools for Molecular Design
https://dasher.wustl.edu/tinker/
Other
129 stars 61 forks source link

improve automated CMake build system #64

Closed mquevill closed 4 years ago

mquevill commented 4 years ago

This PR adds a BUILD_FFTW flag to build Tinker's included fftw/ library. It should link the requisite libraries, based on compiler. (Intel includes FFTW headers in its compiler.)

Another added flag is CMAKE_BUILD_TYPE, which changes compiling flags from optimized to proper debugging flags.

I have not been able to test this on a MacOS or Windows machines, but I've transferred most flags from the Makefiles.

ponderlab commented 4 years ago

We appreciate the effort you put into doing this, but I'm probably not going to accept this pull request at the moment. I'm reluctant to further integrate FFTW into the Tinker distribution and build process. Technically, we are not even supposed to be distributing FFTW- users should get it directly from the FFTW developers. In fact at various times in the past I've removed FFTW from the Tinker distribution. But that tends to lead to so many emails, questions and complaints that I've once again included it. Tinker contains a standard legacy FFT package (FFTPACK) that actually performs almost as well as FFTW for the Tinker use cases, probably due to the fact that FFTs don't really parallelize all that well under OpenMP. I could perhaps arrange things so that Tinker will build without FFTW, but will use the FFTW libraries if they are available. We should just leave this pull request open for the moment and I'll think it over further.

mquevill commented 4 years ago

I removed the options to build from the fftw/ directory. Also improved general handling of the FFTW3 libraries. The user can specify OpenMP or Threads with -DFFTW_THREAD_TYPE. If nothing is specified, it will first check for Threads and then OpenMP. (Using libfftw3_mpi.a is not supported with this CMake system.)