This repository has been archived by the owner on Mar 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake build options refactoring for Makefile and removing PG_ACC_BUGS (…
…#455) * CMake build options refactoring for Makefile * move all makefile related options into single file MakefileBuildOptions.cmake * remove all option processing from extra/CMakeLists.txt * fix with neuron linking : type CN_PGI_ACC_FLAGS -> PGI_ACC_FLAGS * Use PGI archive module because of issue with latest NVHPC modules * fix ISPC build issue and nrnivmodl-core failure on OSX * Avoid P2 UC2 ndoes as GPFS is not mounted (HELP-13390) * Use spack branch only if specified * Remove use of PG_ACC_BUGS * PG_ACC_BUGS was added when we saw bugs with PGI compiler version 16.3 * Except the case of union, no more real buggy scenario exists * So remove all usages of PG_ACC_BUGS * Remove some hardcoded ion array size by const variable * update mod2c to master * mods files and cpp translated files are in same x86_64/corenrn/mod2c directory
- Loading branch information
Showing
17 changed files
with
184 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# ============================================================================= | ||
# Common CXX and ISPC flags | ||
# ============================================================================= | ||
|
||
# ISPC should compile with --pic by default | ||
set(CMAKE_ISPC_FLAGS "${CMAKE_ISPC_FLAGS} --pic") | ||
|
||
# ============================================================================= | ||
# NMODL CLI options : common and backend specific | ||
# ============================================================================= | ||
# if user pass arguments then use those as common arguments | ||
if ("${CORENRN_NMODL_FLAGS}" STREQUAL "") | ||
set(NMODL_COMMON_ARGS "passes --inline") | ||
else() | ||
set(NMODL_COMMON_ARGS ${CORENRN_NMODL_FLAGS}) | ||
endif() | ||
|
||
set(NMODL_CPU_BACKEND_ARGS "host --c") | ||
set(NMODL_ISPC_BACKEND_ARGS "host --ispc") | ||
set(NMODL_ACC_BACKEND_ARGS "host --c acc --oacc") | ||
|
||
# ============================================================================= | ||
# Extract Compile definitions : common to all backend | ||
# ============================================================================= | ||
get_directory_property(COMPILE_DEFS COMPILE_DEFINITIONS) | ||
if(COMPILE_DEFS) | ||
set(CORENRN_COMMON_COMPILE_DEFS "") | ||
foreach(flag ${COMPILE_DEFS}) | ||
set(CORENRN_COMMON_COMPILE_DEFS "${CORENRN_COMMON_COMPILE_DEFS} -D${flag}") | ||
endforeach() | ||
endif() | ||
|
||
# ============================================================================= | ||
# link flags : common to all backend | ||
# ============================================================================= | ||
# ~~~ | ||
# find_cuda uses FindThreads that adds below imported target we | ||
# shouldn't add imported target to link line | ||
# ~~~ | ||
list(REMOVE_ITEM CORENRN_LINK_LIBS "Threads::Threads") | ||
|
||
# replicate CMake magic to transform system libs to -l<libname> | ||
foreach(link_lib ${CORENRN_LINK_LIBS}) | ||
if(${link_lib} MATCHES "\-l.*") | ||
string(APPEND CORENRN_COMMON_LDFLAGS " ${link_lib}") | ||
continue() | ||
endif() | ||
get_filename_component(path ${link_lib} DIRECTORY) | ||
if(NOT path) | ||
string(APPEND CORENRN_COMMON_LDFLAGS " -l${link_lib}") | ||
elseif("${path}" MATCHES "^(/lib|/lib64|/usr/lib|/usr/lib64)$") | ||
get_filename_component(libname ${link_lib} NAME_WE) | ||
string(REGEX REPLACE "^lib" "" libname ${libname}) | ||
string(APPEND CORENRN_COMMON_LDFLAGS " -l${libname}") | ||
else() | ||
string(APPEND CORENRN_COMMON_LDFLAGS " ${link_lib}") | ||
endif() | ||
endforeach() | ||
|
||
# ============================================================================= | ||
# compile flags : common to all backend | ||
# ============================================================================= | ||
# 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) | ||
set(CORENRN_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${_BUILD_TYPE}} ${CXX14_STD_FLAGS}") | ||
|
||
# ============================================================================= | ||
# nmodl/mod2c related options : TODO | ||
# ============================================================================= | ||
# name of nmodl/mod2c binary | ||
get_filename_component(nmodl_name ${CORENRN_MOD2CPP_BINARY} NAME) | ||
set(nmodl_binary_name ${nmodl_name}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule mod2c
updated
10 files
Oops, something went wrong.