Fixed wrong message when building own FFTW.
authorRossen Apostolov <rossen@kth.se>
Mon, 20 Jan 2014 11:46:59 +0000 (12:46 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 21 Jan 2014 18:18:09 +0000 (19:18 +0100)
Change-Id: I54d26291cce4f8986868f9463ecbc6701f974823

src/contrib/fftw/CMakeLists.txt

index 391ebe887e703451cfd4cb8a4ffcfaf270d3dba4..b4b795223c8fb8ef4a8b97ca8d68f03fc94701cb 100644 (file)
@@ -62,26 +62,28 @@ endif()
 
 # Allow cross-compiles
 if (TARGET_HOST)
-    set(GMX_BUILD_OWN_FFTW_TARGET --host=${TARGET_HOST})
+    set(GMX_BUILD_OWN_FFTW_TARGET_HOST --host=${TARGET_HOST})
 endif()
 
 # Machinery for running the external project
 set(EXTERNAL_FFTW_VERSION 3.3.2)
+set(EXTERNAL_FFTW_MD5SUM 6977ee770ed68c85698c7168ffa6e178)
+set (EXTERNAL_FFTW_BUILD_TARGET fftwBuild)
 include(ExternalProject)
 # TODO in master branch - show this warning only on the first run
 # by using gmx_check_if_changed_result from I21b791ab8e4f3 when
 # that becomes available
-message(WARNING "The GROMACS build will download FFTW ${EXTERNAL_FFTW_VERSION} as requested, but it will not know the file it receives is correct. GROMACS will build and link to FFTW anyway, but there is a possible security risk if you execute a GROMACS tool that calls this library. You can use\nmake gmxfftw\n to do the download and build, and then run\nmd5sum src/contrib/fftw/gmxfftw-prefix/src/fftw-3.3.2.tar.gz\nto see if it matches 6977ee770ed68c85698c7168ffa6e178. If so, everything is OK and you should proceed with the rest of the GROMACS build. Alternatively, you can follow the GROMACS installation instructions to build FFTW yourself.")
+message(WARNING "The GROMACS build will download FFTW ${EXTERNAL_FFTW_VERSION} as requested, but it will not know the file it receives is correct. If you now use\nmake\n GROMACS will build and link to FFTW anyway, but there is a possible security risk if you execute a GROMACS tool that calls this library. Instead, you can use\nmake ${EXTERNAL_FFTW_BUILD_TARGET}\n to do just the download and build of FFTW, and then run\nmd5sum src/contrib/fftw/${EXTERNAL_FFTW_BUILD_TARGET}-prefix/src/fftw-${EXTERNAL_FFTW_VERSION}.tar.gz\nto see if it matches ${EXTERNAL_FFTW_MD5SUM}. If so, everything is OK and you should use \nmake\n to proceed with the rest of the GROMACS build. Alternatively, you could stop using GMX_BUILD_OWN_FFTW, and instead follow the GROMACS installation instructions to build FFTW yourself.")
 # TODO if/when CMake fixes http://www.cmake.org/Bug/view.php?id=14330
 # (ie. at least version > 2.8.11.2), consider reverting to using an
 # md5sum check to avoid needing the above warning
-    ExternalProject_add(fftwBuild
+    ExternalProject_add(${EXTERNAL_FFTW_BUILD_TARGET}
         URL "http://www.fftw.org/fftw-${EXTERNAL_FFTW_VERSION}.tar.gz"
         CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --libdir=<INSTALL_DIR>/lib --disable-fortran
         ${GMX_BUILD_OWN_FFTW_SHARED_FLAG} ${GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION}
         ${GMX_BUILD_OWN_FFTW_PREC}
-        ${GMX_BUILD_OWN_FFTW_TARGET})
-externalproject_get_property(fftwBuild INSTALL_DIR)
+        ${GMX_BUILD_OWN_FFTW_TARGET_HOST})
+externalproject_get_property(${EXTERNAL_FFTW_BUILD_TARGET} INSTALL_DIR)
 
 string(TOUPPER "${FFTW}" UPPERFFTW)
 string(TOLOWER "${FFTW}" LOWERFFTW)
@@ -94,6 +96,6 @@ set(${UPPERFFTW}_HAVE_SIMD TRUE PARENT_SCOPE)
 add_library(gmxfftw STATIC IMPORTED GLOBAL)
 set_target_properties(gmxfftw PROPERTIES IMPORTED_LOCATION ${${UPPERFFTW}_LIBRARIES})
 set(${UPPERFFTW}_LIBRARIES gmxfftw PARENT_SCOPE)
-add_dependencies(gmxfftw fftwBuild)
+add_dependencies(gmxfftw ${EXTERNAL_FFTW_BUILD_TARGET})
 
 message(STATUS "The GROMACS-managed build of FFTW 3 will configure with the following optimizations: ${GMX_BUILD_OWN_FFTW_OPTIMIZATION_CONFIGURATION}")