Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Workaround %[email protected]:~gpu Random123+ABM issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
olupton committed Jan 17, 2022
1 parent 3949a04 commit 9b7cdac
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CMake/MakefileBuildOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (C) 2016-2021 Blue Brain Project
# Copyright (C) 2016-2022 Blue Brain Project
#
# See top-level LICENSE file for details.
# =============================================================================
Expand Down Expand Up @@ -72,8 +72,9 @@ endforeach()
# PGI compiler adds --c++14;-A option for C++14, remove ";"
string(REPLACE ";" " " CXX14_STD_FLAGS "${CMAKE_CXX14_STANDARD_COMPILE_OPTION}")
string(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
string(JOIN " " CORENRN_COMPILE_FLAGS_STRING ${CORENRN_COMPILE_FLAGS})
set(CORENRN_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_BUILD_TYPE}} ${CXX14_STD_FLAGS} ${NVHPC_ACC_COMP_FLAGS} ${NVHPC_CXX_INLINE_FLAGS}"
"${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_BUILD_TYPE}} ${CXX14_STD_FLAGS} ${NVHPC_ACC_COMP_FLAGS} ${NVHPC_CXX_INLINE_FLAGS} ${CORENRN_COMPILE_FLAGS_STRING}"
)

# =============================================================================
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# =============================================================================
# Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
# Copyright (c) 2016 - 2022 Blue Brain Project/EPFL
#
# See top-level LICENSE file for details.
# =============================================================================
Expand Down Expand Up @@ -239,6 +239,14 @@ endif()
if(CORENRN_HAVE_NVHPC_COMPILER)
# PGI with llvm code generation doesn't have necessary assembly intrinsic headers
add_definitions(-DEIGEN_DONT_VECTORIZE=1)
if(NOT CORENRN_ENABLE_GPU AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 21.11)
# Random123 does not play nicely with NVHPC 21.11+'s detection of ABM features if it detects the
# compiler to be PGI or NVHPC, see: https://github.com/BlueBrain/CoreNeuron/issues/724. In fact
# in GPU builds Random123 (mis)detects nvc++ as nvcc because we pass the -cuda option and we
# therefore avoid the problem. If GPU support is disabled, we pass -mno-abm to avoid the
# problem.
list(APPEND CORENRN_COMPILE_FLAGS -mno-abm)
endif()
endif()

# ~~~
Expand Down
6 changes: 5 additions & 1 deletion coreneuron/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# =============================================================================
# Copyright (c) 2016 - 2021 Blue Brain Project/EPFL
# Copyright (c) 2016 - 2022 Blue Brain Project/EPFL
#
# See top-level LICENSE file for details.
# =============================================================================

# Add compiler flags that should apply to all CoreNEURON targets, but which should not leak into
# other included projects.
add_compile_options(${CORENRN_COMPILE_FLAGS})

# put libraries (e.g. dll) in bin directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

Expand Down

0 comments on commit 9b7cdac

Please sign in to comment.