Permalink
Browse files

Revamped Elemental use and compilation under CMake. Apps still can on…

…ly use built-in El source (0.84), if want to download and compile newer source specify ELEMENTAL_TAG CMake variable.
  • Loading branch information...
evaleev committed Dec 14, 2015
1 parent 0070242 commit 83acde84c7bfd8742aa455d476a26314f31daeed
View
@@ -48,20 +48,32 @@ option(ENABLE_MPI "Enable Message Passing Interface (MPI) Library" ON)
option(ENABLE_TBB "Enables use of Intel Thread Building Blocks (TBB) as the task scheduler" ON)
option(ENABLE_MKL "Search for Intel Math Kernel Library (MKL) for BLAS and LAPACK support" ON)
option(ENABLE_ACML "Search for AMD Core Math Library (ACML) for BLAS and LAPACK support" ON)
option(ENABLE_ELEMENTAL "Enable Elemental library for distributed-memory linear algebra" OFF)
option(ENABLE_GPERFTOOLS "Enable use of Google Performance Tools (gperftools)" ON)
option(ENABLE_LIBXC "Enables use of the libxc library of density functionals" ON)
option(ENABLE_PAPI "Enables use of PAPI" OFF)
option(ENABLE_ELEMENTAL "Enable Elemental library for distributed-memory linear algebra" OFF)
if (DEFINED ELEMENTAL_TAG)
if("${ELEMENTAL_TAG}" STREQUAL "")
message(FATAL_ERROR "Invalid value given for ELEMENTAL_TAG; specify a valid hash or tag.")
endif()
message(STATUS "Will compile Elemental source (tag=${ELEMENTAL_TAG}) in the build directory")
set(ENABLE_EMBEDDED_ELEMENTAL OFF)
else (DEFINED ELEMENTAL_TAG)
message(STATUS "Will use the embedded Elemental source(tag=v0.84)")
set(ENABLE_EMBEDDED_ELEMENTAL ON)
endif (DEFINED ELEMENTAL_TAG)
add_feature_info(Elemental ENABLE_ELEMENTAL "compiles parallel linear-algebra library Elemental as part of MADNESS")
# Configure options ============================================================
option(ENABLE_GENTENSOR "Enable generic tensor support" OFF)
add_feature_info(GENTENSOR ENABLE_GENTENSOR "Enables use of MRA Function compression that allows computing in 6 dimensions")
add_feature_info(GENTENSOR ENABLE_GENTENSOR "enables use of MRA Function compression that allows computing in 6 dimensions")
if(ENABLE_GENTENSOR)
add_definitions(-DUSE_GENTENSOR)
endif()
set(TENSOR_USE_GENTENSOR ${ENABLE_GENTENSOR} CACHE BOOL "Enable generic tensors")
set(TENSOR_USE_GENTENSOR ${ENABLE_GENTENSOR} CACHE BOOL "enable generic tensors")
option(ENABLE_TASK_PROFILER
"Enable task profiler that collects per-task start and stop times." OFF)
@@ -118,11 +130,11 @@ add_feature_info(UNITTESTS ENABLE_UNITTESTS
"Enables unit tests targets")
set(FORTRAN_INTEGER_SIZE 4 CACHE STRING "The fortran integer size (4 or 8 bytes) used for BLAS and LAPACK function calls")
add_feature_info(FORTRAN_INTEGER_SIZE FORTRAN_INTEGER_SIZE "assumes Fortran integers to be ${FORTRAN_INTEGER_SIZE} bytes long")
if(NOT (FORTRAN_INTEGER_SIZE EQUAL 4 OR FORTRAN_INTEGER_SIZE EQUAL 8))
message(FATAL_ERROR "Incorrect fortran integer size '${FORTRAN_INTEGER_SIZE}'\n"
"FORTRAN_INTEGER_SIZE must be equal to 4 or 8")
endif()
add_feature_info("FORTRAN_INTEGER_SIZE=${FORTRAN_INTEGER_SIZE}" TRUE "assumes Fortran integers to be ${FORTRAN_INTEGER_SIZE} bytes long")
set(ASSERTION_TYPE "throw" CACHE STRING "Define MADNESS assertion behavior (abort|assert|disable|throw)")
if(ASSERTION_TYPE STREQUAL "abort")
@@ -139,6 +151,7 @@ else()
set(MADNESS_ASSERTIONS_THROW 1)
endif()
message(STATUS "Assertion type: ${ASSERTION_TYPE}")
add_feature_info("ASSERTION_TYPE=${ASSERTION_TYPE}" TRUE "controls how MADNESS assetions are handled")
set(MPI_THREAD "multiple" CACHE STRING "Thread level for MPI (multiple|serialized)")
if(MPI_THREAD STREQUAL "multiple")
@@ -148,6 +161,7 @@ elseif(MPI_THREAD STREQUAL "serialized")
else()
message(FATAL_ERROR "Invalid value for MPI_THREAD '${MPI_THREAD}'; valid valuse are 'multiple' or 'serialized'")
endif()
add_feature_info("MPI_THREAD=${MPI_THREAD}" TRUE "controls the level of thread-safety support in MPI")
# Enable support for shared libraries ==========================================
@@ -436,7 +450,7 @@ endif()
find_package(PythonInterp)
# Check for external dependencies ==============================================
add_custom_target(External)
include(external/pthread.cmake)
include(external/mpi.cmake)
include(external/papi.cmake)
@@ -445,7 +459,9 @@ include(external/libxc.cmake)
include(external/libunwind.cmake)
include(external/gperftools.cmake)
include(external/tbb.cmake)
#include(external/elemental.cmake)
if (DEFINED ELEMENTAL_TAG)
include(external/elemental.cmake)
endif (DEFINED ELEMENTAL_TAG)
# Add project subdirectories ===================================================
View
@@ -60,7 +60,6 @@ are optional, and it is typically not necessary to specify these variables.
The following CMake cache variables turn MADNESS features on and off.
* ENABLE_ELEMENTAL --- Enable Elemental [default=OFF]
* ENABLE_GENTENSOR --- Enable generic tensors; only useful if need
compressed 6-d tensors, e.g. in MP2 [default=OFF]
* ENABLE_TASK_PROFILER - Enable task profiler that collects per-task start and
@@ -163,3 +162,17 @@ Performance Application Programming Interface (PAPI):
* PAPI_ROOT_DIR --- The install prefix for PAPI.
* PAPI_INCLUDE_DIR --- The path to the PAPI include directory.
* PAPI_LIBRARY --- The path to the PAPI library directory.
Elemental parallel linear algebra library:
Elemental provides optional distributed-memory linear algebra for some MADNESS application codes.
MADNESS source includes (modified) Elemental v0.84, which has been validated to work with
the few MADNESS apps that can use Elemental. You can instruct MADNESS to download and compile
a more recent version of Elemental, if desired, but the apps will not use Elemental then.
Such bundling is currently necessary if your code uses the MADworld runtime AND Elemental because
madness::initialize will call El::initialize() .
* ENABLE_ELEMENTAL --- Enable Elemental [default=OFF].
* ELEMENTAL_TAG --- specifies the version of Elemental to be downloaded, compiled, and installed alongside
MADNESS (numerical codes of MADNESS will not use Elemental).
If not set, will use the included Elemental source.
View
@@ -47,6 +47,7 @@
#cmakedefine HAVE_PAPI 1
#cmakedefine MADNESS_HAS_LIBXC 1
#cmakedefine MADNESS_HAS_ELEMENTAL 1
#cmakedefine MADNESS_HAS_ELEMENTAL_EMBEDDED 1
#cmakedefine MADNESS_HAS_GOOGLE_PERF_MINIMAL 1
#cmakedefine MADNESS_HAS_GOOGLE_TEST 1
@@ -24,7 +24,9 @@ set(MADNESS_SOURCE_DIR "@MADNESS_SOURCE_DIR@")
set(MADNESS_BINARY_DIR "@MADNESS_BINARY_DIR@")
# Set Elemental variables
set(ENABLE_ELEMENTAL @ENABLE_ELEMENTAL@)
set(MADNESS_HAS_ELEMENTAL @MADNESS_HAS_ELEMENTAL@)
set(MADNESS_HAS_ELEMENTAL_EMBEDDED @MADNESS_HAS_ELEMENTAL_EMBEDDED@)
set(ELEMENTAL_FOUND @ELEMENTAL_FOUND@)
if(CMAKE_CURRENT_LIST_DIR EQUAL MADNESS_BINARY_DIR)
# In build tree
@@ -33,11 +35,13 @@ if(CMAKE_CURRENT_LIST_DIR EQUAL MADNESS_BINARY_DIR)
set(Elemental_BINARY_DIR "@Elemental_BINARY_DIR@")
set(Madness_INCLUDE_DIRS "${MADNESS_SOURCE_DIR}/src" "${MADNESS_BINARY_DIR}/src")
if(ENABLE_ELEMENTAL)
if(MADNESS_HAS_ELEMENTAL_EMBEDDED)
list(APPEND Madness_INCLUDE_DIRS
"${Elemental_SOURCE_DIR}/include" "${Elemental_BINARY_DIR}/include"
"${Elemental_SOURCE_DIR}/external/pmrrr/include"
"${Elemental_BINARY_DIR}/external/pmrrr/include")
else()
message (FATAL_ERROR "Madness_INCLUDE_DIRS has not been adapted to work with non-embedded Elemental")
endif()
else()
# In install tree
@@ -0,0 +1,37 @@
#
# This file is a part of TiledArray.
# Copyright (C) 2013 Virginia Tech
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Justus Calvin
# Department of Chemistry, Virginia Tech
#
# ConvertIncludesListToCompileArgs.cmake
# Sep 4, 2013
#
#
# converts a list of include paths (second argument, don't forget to enclose the
# list in quotes) into a list of command-line parameters to the compiler/.
#
macro(convert_incs_to_compargs _args _inc_paths )
# transform library list into compiler args
# Add include paths to _args
foreach(_inc_path ${_inc_paths})
set(${_args} "${${_args}} -I${_inc_path}")
endforeach()
endmacro()
@@ -0,0 +1,53 @@
#
# This file is a part of TiledArray.
# Copyright (C) 2013 Virginia Tech
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Justus Calvin
# Department of Chemistry, Virginia Tech
#
# ConvertLibrariesListToCompilerArgs.cmake
# Jul 19, 2013
#
#
# Converts a list of libraries (second argument, don't forget to enclose the
# list in quotes) into a list of command-line parameters to the compiler/linker.
#
macro(convert_libs_to_compargs _args _libs )
# transform library list into compiler args
foreach (_lib ${_libs})
get_filename_component(_ext ${_lib} EXT)
get_filename_component(_libname ${_lib} NAME_WE)
if(APPLE AND "${_ext}" STREQUAL ".framework")
# Handle Apple Frameworks
get_filename_component(_path ${_lib} PATH)
if(${_path} STREQUAL "/System/Library/Frameworks")
set(MAD_LIBS "${${_args}} -F${_path} -framework ${_libname}")
else()
set(MAD_LIBS "${${_args}} -framework ${_libname}")
endif()
else()
# Handle the general case
set(MAD_LIBS "${${_args}} ${_lib}")
endif()
endforeach()
endmacro()

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 83acde8

Please sign in to comment.