Skip to content

Commit

Permalink
Merge pull request #503 from electronic-structure/develop
Browse files Browse the repository at this point in the history
Update to version 6.5.4
  • Loading branch information
toxa81 authored Jun 8, 2020
2 parents 0c5bc24 + 3a5ec0b commit c6dce91
Show file tree
Hide file tree
Showing 134 changed files with 5,385 additions and 8,657 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ src/version.h
.cproject
.project
.settings
.vscode

html/
latex/
Expand Down
42 changes: 23 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12)

project(SIRIUS VERSION 6.5.3)
project(SIRIUS VERSION 6.5.4)

# set language and standard
enable_language(CXX Fortran)
Expand All @@ -12,6 +12,7 @@ set(CREATE_FORTRAN_BINDINGS ON CACHE BOOL "build Fortran bindings")
set(BUILD_DOCS OFF CACHE BOOL "build doxygen doc")
set(USE_ELPA OFF CACHE BOOL "use scalapack")
set(USE_MAGMA OFF CACHE BOOL "use MAGMA")
set(USE_NLCGLIB OFF CACHE BOOL "enable nlcglib")
set(USE_CUDA OFF CACHE BOOL "use CUDA")
set(USE_ROCM OFF CACHE BOOL "use ROCM AMD GPU code")
set(USE_NVTX OFF CACHE BOOL "use Nvidia profiling tools library")
Expand All @@ -27,17 +28,13 @@ set(PYTHON2 OFF CACHE STRING "Use Python 2.7")
set(USE_PROFILER ON CACHE BOOL "measure execution of functions with timer")
set(USE_MEMORY_POOL ON CACHE BOOL "use memory pool")

if(USE_MAGMA AND NOT USE_CUDA)
message(FATAL_ERROR "MAGMA depends on Cuda, must enable Cuda or disable MAGMA")
endif()

if(USE_CUDA AND USE_ROCM)
message(FATAL_ERROR "USE_CUDA and USE_ROCM must not be enabled at the same time!")
endif()

if(USE_MKL AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel"))
message(FATAL_ERROR "Unsupported compiler")
endif()
# if(USE_MKL AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Intel"))
# message(FATAL_ERROR "Unsupported compiler")
# endif()

set_property(CACHE GPU_MODEL PROPERTY STRINGS "none" "P100" "V100" "G10x0")

Expand Down Expand Up @@ -67,7 +64,7 @@ if (NOT CMAKE_BUILD_TYPE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "debug" "release" "relwithdebinfo")
endif()

if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -ggdb -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
Expand All @@ -85,7 +82,7 @@ endif()
# preserve rpaths when installing and make the install folder relocatable
# use `CMAKE_SKIP_INSTALL_RPATH` to skip this
# https://spack.readthedocs.io/en/latest/workflows.html#write-the-cmake-build
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir)
# skip RPATH if SIRIUS is installed to system directories
if(isSystemDir STREQUAL "-1")
Expand All @@ -106,7 +103,11 @@ option(BUILD_SHARED_LIBS "Build shared libraries." ON)
# generate compile_commands.json with compile commands for each target
set(CMAKE_EXPORT_COMPILE_COMMANDS "YES")

# dependencies
if(USE_NLCGLIB)
find_package(nlcglib REQUIRED)
find_package(Kokkos REQUIRED)
endif()

find_package(MPI REQUIRED)
find_package(GSL REQUIRED)
find_package(LibXC 3.0.0 REQUIRED)
Expand Down Expand Up @@ -167,15 +168,14 @@ if(USE_CUDA)
endif(USE_CUDA)

if(USE_ROCM)
message(STATUS "WARNING: ROCM enabled, prototype feature! Only limited functionality available.")
find_package(ROCM COMPONENTS rocfft hipblas)
if(NOT ${ROCM_HIP_PLATFORM} STREQUAL hcc)
message(FATAL_ERROR "Compilation on Nvidia platform not supported with ROCM enabled!")
if(NOT HIP_HCC_FLAGS)
message(STATUS "Using default AMD gpu targets: gfx803, gfx900, gfx906. Set HIP_HCC_FLAGS to override.")
set(HIP_HCC_FLAGS ${HIP_HCC_FLAGS} --amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906)
endif()
add_definitions(${ROCM_DEFINITIONS})
include_directories(${ROCM_INCLUDE_DIRS})
add_subdirectory(src/gpu/hipblas_port)
include_directories(src/gpu/hipblas_port)
find_package(HIP REQUIRED)
# rocblas and hip have cmake config files, but add incompatible flags for mixed compiler usage, so we use custom find modules
find_package(ROCBLAS REQUIRED)
find_package(HIPLIBS REQUIRED)
endif()

# check if git command exists
Expand Down Expand Up @@ -232,7 +232,11 @@ if(BUILD_TESTS)
endif(BUILD_TESTS)

add_subdirectory(apps/atoms)
add_subdirectory(apps/hydrogen)
add_subdirectory(apps/dft_loop)
if(USE_NLCGLIB)
add_subdirectory(apps/nlcg)
endif()
add_subdirectory(apps/upf)
add_subdirectory(apps/utils)
add_subdirectory(python_module)
Expand Down
3 changes: 3 additions & 0 deletions apps/hydrogen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
add_executable(hydrogen hydrogen.cpp)
target_link_libraries(hydrogen PRIVATE sirius)
install(TARGETS hydrogen RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
1 change: 1 addition & 0 deletions apps/hydrogen/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Solve the hydrogen-like problem.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions apps/nlcg/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
add_executable(sirius.nlcg sirius.nlcg.cpp)
find_package(Kokkos REQUIRED)
target_link_libraries(sirius.nlcg PRIVATE sirius)
target_link_libraries(sirius.nlcg PRIVATE nlcglib::nlcglib)
target_link_libraries(sirius.nlcg PRIVATE ${KOKKOS_LIBRARIES})
set_property(TARGET sirius.nlcg PROPERTY POSITION_INDEPENDENT_CODE OFF)
install(TARGETS sirius.nlcg RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")


# add_executable(sirius.test.nlcg sirius.test.nlcg.cpp)
# find_package(nlcglib REQUIRED)
# target_link_libraries(sirius.test.nlcg PRIVATE sirius)
# set_property(TARGET sirius.test.nlcg PROPERTY POSITION_INDEPENDENT_CODE OFF)
# install(TARGETS sirius.test.nlcg RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
Loading

0 comments on commit c6dce91

Please sign in to comment.