Bug #1327

CMake bugs with set(var value PARENT_SCOPE)

Added by Mark Abraham almost 7 years ago. Updated over 6 years ago.

build system
Target version:
Affected version - extra info:
also master
Affected version:

Description notes that set(var value PARENT_SCOPE) does not work in or 2.8.11. I've been using lots of 2.8.11 in recent months and not had problems, but we should be alert for this, because any other code we have that tries to be modular with CMake scope may also be broken. Ugh.

In particular, cmake .. -DGMX_BUILD_OWN_FFTW=on breaks because such a set(... PARENT_SCOPE) fails in src/contrib/fftw/CMakeLists.txt, giving messages like

-- The GROMACS-managed build of FFTW 3 will configure with the following optimizations: --enable-sse2
CMake Error at CMakeLists.txt:915 (MESSAGE):
  Cannot find FFTW 3 (with correct precision - libfftw3f for single-precision
  GROMACS or libfftw3 for double-precision GROMACS).  Either choose the right
  precision, choose another FFT(W) library (-DGMX_FFT_LIBRARY), enable the
  advanced option to let GROMACS build FFTW 3 for you
  (-DGMX_BUILD_OWN_FFTW=ON) , or use the really slow GROMACS built-in fftpack
  library (-DGMX_FFT_LIBRARY=fftpack).

because FFTWF_FOUND is not set TRUE. So I think we will need to version this error message by the CMake version, or face a future deluge of posts on gmx-users.

Associated revisions

Revision d703d38c (diff)
Added by Magnus Lundborg almost 7 years ago

Set upper case of FFTW variable at the right place.

Fixes #1327

Change-Id: Ie9ef1fffceefef7d46f1e7a5a8ca3ceb22a81854


#1 Updated by Mark Abraham almost 7 years ago

Seems I was too hasty here - set(var value PARENT_SCOPE) sets only in the parent scope, and not the local scope (where I was testing for it).

#2 Updated by Magnus Lundborg almost 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#3 Updated by Mark Abraham over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF