diff options
author | Nichols A. Romero <naromero77@users.noreply.github.com> | 2018-02-23 11:52:46 -0600 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-02-23 09:52:46 -0800 |
commit | 7db35ff05c8078e85a9a1097093a4a2a2bdd31bd (patch) | |
tree | 3629c9946f553554b8927c7c0ec30fb6afa7afcc | |
parent | c2a47512379d00ddaeebb74e4bb0d2918d5c747d (diff) | |
download | spack-7db35ff05c8078e85a9a1097093a4a2a2bdd31bd.tar.gz spack-7db35ff05c8078e85a9a1097093a4a2a2bdd31bd.tar.bz2 spack-7db35ff05c8078e85a9a1097093a4a2a2bdd31bd.tar.xz spack-7db35ff05c8078e85a9a1097093a4a2a2bdd31bd.zip |
QMCPACK - General Improvements (#6958)
* No longer need to patch CMake. Using CMAKE_CXX_FLAGS to include BLAS/LAPACK/MKL header files properly.
* Backport two patches to QMCPACK versions prior to 3.3.0: https://github.com/QMCPACK/qmcpack/pull/621, https://github.com/QMCPACK/qmcpack/pull/623
* Insufficient to include lapack_dir in CMAKE_CXX_FLAGS, CMAKE_C_FLAGS is also needed.
* Make patched Espresso a default variant instead of a hard dependency. This is easier on computer architectures where Espresso is hard to build.
* Fix patching with QE variant. Now using correct form of patch command.
* Add QMCPACK v3.4.0
* Backport patch to QMCPACK versions prior to 3.3.0: https://github.com/QMCPACK/qmcpack/pull/643
-rw-r--r-- | var/spack/repos/builtin/packages/qmcpack/cmake.diff | 55 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/qmcpack/package.py | 47 |
2 files changed, 33 insertions, 69 deletions
diff --git a/var/spack/repos/builtin/packages/qmcpack/cmake.diff b/var/spack/repos/builtin/packages/qmcpack/cmake.diff deleted file mode 100644 index 4eb93f4198..0000000000 --- a/var/spack/repos/builtin/packages/qmcpack/cmake.diff +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/CMake/FindMKL.cmake b/CMake/FindMKL.cmake -index a457eaba0..66dc43ce6 100644 ---- a/CMake/FindMKL.cmake -+++ b/CMake/FindMKL.cmake -@@ -7,21 +7,21 @@ FILE( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl.cxx" - "#include <iostream>\n #include <mkl.h>\n int main() { return 0; }\n" ) - try_compile(HAVE_MKL ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl.cxx -- CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" ) -+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") - - # Check for mkl_vml_functions.h - FILE( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_vml.cxx" - "#include <iostream>\n #include <mkl_vml_functions.h>\n int main() { return 0; }\n" ) - try_compile(HAVE_MKL_VML ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_vml.cxx -- CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" ) -+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") - - # Check for fftw3 - FILE( WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_fftw3.cxx" - "#include <iostream>\n #include <fftw/fftw3.h>\n int main() { return 0; }\n" ) - try_compile(HAVE_MKL_FFTW3 ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_fftw3.cxx -- CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" ) -+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS} -mkl" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") - - IF ( HAVE_MKL ) - SET( MKL_FOUND 1 ) -diff --git a/CMake/FindVectorMath.cmake b/CMake/FindVectorMath.cmake -index c0c919746..f5c511253 100644 ---- a/CMake/FindVectorMath.cmake -+++ b/CMake/FindVectorMath.cmake -@@ -19,7 +19,7 @@ IF ( NOT HAVE_VECTOR_MATH ) - "#include <iostream>\n #include <mkl_vml_functions.h>\n int main() { return 0; }\n" ) - try_compile(HAVE_MKL_VML ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src_mkl_vml.cxx -- CMAKE_FLAGS "${CMAKE_CXX_FLAGS}" ) -+ CMAKE_FLAGS "${CMAKE_CXX_FLAGS}" "-DINCLUDE_DIRECTORIES=${LAPACK_INCLUDE_DIRS}") - IF (HAVE_MKL_VML) - # enable VML only when MKL libraries have been picked up - IF (MKL_FOUND) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 570d8a01f..56d939786 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -464,6 +464,8 @@ ELSE(CMAKE_TOOLCHAIN_FILE) - MESSAGE(STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}") - MESSAGE(STATUS "LAPACK linker flags: ${LAPACK_LINKER_FLAGS}") - SET(LAPACK_LIBRARY ${LAPACK_LIBRARIES} ${LAPACK_LINKER_FLAGS}) -+ MESSAGE(STATUS "LAPACK_INCLUDE_DIRS: ${LAPACK_INCLUDE_DIRS}") -+ INCLUDE_DIRECTORIES(${LAPACK_INCLUDE_DIRS}) - ELSE() - MESSAGE(FATAL_ERROR "Could not find required libraries LAPACK &/or BLAS") - ENDIF() diff --git a/var/spack/repos/builtin/packages/qmcpack/package.py b/var/spack/repos/builtin/packages/qmcpack/package.py index a2080a13c4..fbb7e2636f 100644 --- a/var/spack/repos/builtin/packages/qmcpack/package.py +++ b/var/spack/repos/builtin/packages/qmcpack/package.py @@ -38,6 +38,7 @@ class Qmcpack(CMakePackage): # Spack manual. However, it is easier to maintain because github hashes # can occasionally change. # NOTE: 12/19/2017 QMCPACK 3.0.0 does not build properly with Spack. + version('3.4.0', git=url, tag='v3.4.0') version('3.3.0', git=url, tag='v3.3.0') version('3.2.0', git=url, tag='v3.2.0') version('3.1.1', git=url, tag='v3.1.1') @@ -64,6 +65,8 @@ class Qmcpack(CMakePackage): description='Install with support for basic data analysis tools') variant('gui', default=False, description='Install with Matplotlib (long installation time)') + variant('qe', default=True, + description='Install with patched Quantum Espresso 5.3.0') # cuda variant implies mixed precision variant by default, but there is # no way to express this in variant syntax, need something like @@ -105,16 +108,28 @@ class Qmcpack(CMakePackage): patch_url = 'https://raw.githubusercontent.com/QMCPACK/qmcpack/develop/external_codes/quantum_espresso/add_pw2qmcpack_to_espresso-5.3.0.diff' patch_checksum = '0d8d7ba805313ddd4c02ee32c96d2f12e7091e9e82e22671d3ad5a24247860c4' depends_on('espresso@5.3.0~elpa', - patches=patch(patch_url, sha256=patch_checksum), - when='+mpi') + patches=patch(patch_url, sha256=patch_checksum, when='+qe'), + when='+qe+mpi') depends_on('espresso@5.3.0~elpa~scalapack~mpi', - patches=patch(patch_url, sha256=patch_checksum), - when='~mpi') + patches=patch(patch_url, sha256=patch_checksum, when='+qe'), + when='+qe~mpi') - # This is Spack specific patch, we may need to enhance QMCPACK's CMake - # in the near future. - patch('cmake.diff') + # Backport several patches from recent versions of QMCPACK + # The test_numerics unit test is broken prior to QMCPACK 3.3.0 + patch_url = 'https://patch-diff.githubusercontent.com/raw/QMCPACK/qmcpack/pull/621.patch' + patch_checksum = 'e2ff7a6f0f006856085d4aab6d31f32f16353e41f760a33a7ef75f3ecce6a5d6' + patch(patch_url, sha256=patch_checksum, when='@3.1.0:3.3.0') + + # FindMKL.cmake has an issues prior to QMCPACK 3.3.0 + patch_url = 'https://patch-diff.githubusercontent.com/raw/QMCPACK/qmcpack/pull/623.patch' + patch_checksum = '3eb9dec05fd1a544318ff84cd8b5926cfc6b46b375c7f3b012ccf0b50cf617b7' + patch(patch_url, sha256=patch_checksum, when='@3.1.0:3.3.0') + + # git-rev files for not git builds issues prior to QMCPACK 3.3.0 + patch_url = 'https://patch-diff.githubusercontent.com/raw/QMCPACK/qmcpack/pull/643.patch' + patch_checksum = 'c066c79901a612cf8848135e0d544efb114534cca70b90bfccc8ed989d3d9dde' + patch(patch_url, sha256=patch_checksum, when='@3.1.0:3.3.0') def patch(self): # FindLibxml2QMC.cmake doesn't check the environment by default @@ -207,14 +222,18 @@ class Qmcpack(CMakePackage): # header files. Intel MKL requires special case due to differences in # Darwin vs. Linux $MKLROOT naming schemes if 'intel-mkl' in self.spec: - args.append( - '-DLAPACK_INCLUDE_DIRS=%s' % - format(join_path(env['MKLROOT'], 'include'))) + lapack_dir = format(join_path(env['MKLROOT'], 'include')) else: - args.append( - '-DLAPACK_INCLUDE_DIRS=%s;%s' % ( - self.spec['lapack'].prefix.include, - self.spec['blas'].prefix.include)) + lapack_dir = ':'.join(( + spec['lapack'].prefix.include, + spec['blas'].prefix.include + )) + + args.extend([ + '-DCMAKE_CXX_FLAGS=-I%s' % lapack_dir, + '-DCMAKE_C_FLAGS=-I%s' % lapack_dir + ]) + return args def install(self, spec, prefix): |