This repository was 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
Fixing nrnivmodl-core: Avoid redefined symbols + script startup fixes #133
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
b13b0b1
Fixing nrnivmodl-core: dir creation, shbang, ;-I
ferdonline eba50f7
Drop unnecessary mkdir step
ferdonline 324dc0b
Avoiding duplicate symbols when using nrnivmodl-core
ferdonline 4b32757
Generating libcorenrnmech featuring solve_core()
ferdonline 0d856e1
Fix: -DADDITIONAL_MECHS to be passed to mech lib
ferdonline 84a152a
cosmetics
ferdonline 9454d6d
minot text update
pramodk beecc0b
Add missing kinderiv dependency
4c1c6cf
Fix incorporation of scopmath to mechlib in linux
ferdonline 0083a37
Install libcorenrnmech for coreneuron_exe to work properly
pramodk bf85588
Disable new-dtags with newer linkers
pramodk 9a71127
Fix issues with PGI compiler
pramodk 4f6fc69
disable dtags again
pramodk 83f704c
Install libcudacoreneuron; link missing
pramodk 387c7fe
Allowing static corenrnmech
ferdonline e8b57ff
Set rpath on libcorenrnmech for compat w RUNPATH
ferdonline 4dd6503
Fix for GPU. Simplified build and fixed link flag
ferdonline 63f250a
Fixing rpath Origin in Mac and added deploy script
ferdonline 7a427ee
Pretty UI :)
ferdonline cd17377
Configurable parallelism
ferdonline 3a09d20
Revert cuda_wrap_srcs as cuda routines doesnt get linked properly
pramodk 8293f1e
Remove Wall flags from default compilation
pramodk 1b0f3c0
Restructure and warning fix
pramodk 0ea03fb
Cleanup debug messages in GPU implementation
pramodk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -29,10 +29,14 @@ include_directories(utils/randoms) | |
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) | ||
include_directories(${MPI_INCLUDE_PATH}) | ||
|
||
FILE(GLOB_RECURSE coreneuron_all_headers "*.h*") | ||
FILE(GLOB_RECURSE coreneuron_all_templates "*.ipp") | ||
FILE(GLOB_RECURSE coreneuron_all_c_files "*.c*") | ||
file(GLOB_RECURSE coreneuron_all_headers "*.h*") | ||
file(GLOB_RECURSE coreneuron_all_templates "*.ipp") | ||
file(GLOB_RECURSE coreneuron_cuda_files "*.cu") | ||
file(GLOB_RECURSE coreneuron_all_c_files "nrniv/*.c*" "nrnmpi/*.c*" "nrnoc/*.c*" | ||
"nrnomp/*.c*" "utils/*.c*") | ||
set(DIMPLIC_C "mech/dimplic.cpp") | ||
file(GLOB_RECURSE scopmath_c_files "scopmath_core/*.c*") | ||
|
||
|
||
# Compile and include MOD files | ||
|
||
|
@@ -228,6 +232,7 @@ add_custom_command(OUTPUT "${KINDERIV_H}" | |
DEPENDS ${MOD2C_OPTMECH_OUTPUTS} ${MOD2C_STDMECH_OUTPUTS} "${KINDERIV_PY}" | ||
COMMAND python "${KINDERIV_PY}" | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") | ||
add_custom_target(kinderiv DEPENDS "${KINDERIV_H}") | ||
|
||
if (EXPORT_MECHS_FUNCTIONS) | ||
# Create C file with all "get function pointers" methods | ||
|
@@ -242,7 +247,8 @@ if (EXPORT_MECHS_FUNCTIONS) | |
endif() | ||
|
||
# Add generated sources from MOD files | ||
set(GENERATED_MECH_C_FILES ${MOD_FUNC_C} ${MOD_FUNC_PTRS_C} ${MOD2C_STDMECH_OUTPUTS} ${MOD2C_OPTMECH_OUTPUTS}) | ||
set(ADDITIONAL_MECH_C_FILES ${MOD_FUNC_C} ${MOD_FUNC_PTRS_C} ${DIMPLIC_C} ${MOD2C_OPTMECH_OUTPUTS}) | ||
set(GENERATED_MECH_C_FILES ${ADDITIONAL_MECH_C_FILES} ${MOD2C_STDMECH_OUTPUTS}) | ||
|
||
# artificial cells must be on cpu, defaul nrnran123.c is for cpu, nrn_setup.cpp uses nrnran123 for only memory calculation purpose which should use cpu version of nrnran123 | ||
set(NOACC_MECH_C_FILES | ||
|
@@ -261,8 +267,6 @@ if(ENABLE_OPENACC) | |
endif() | ||
endif() | ||
|
||
set(coreneuron_all_c_files ${coreneuron_all_c_files} ${GENERATED_MECH_C_FILES}) | ||
|
||
#to indent generated c/cpp files | ||
if(CLANG_FORMAT_FOUND) | ||
add_custom_target(formatbuild | ||
|
@@ -275,8 +279,6 @@ if(CLANG_FORMAT_FOUND) | |
endif() | ||
|
||
|
||
add_library(coreneuron ${COMPILE_LIBRARY_TYPE} ${coreneuron_all_headers} ${coreneuron_all_templates} ${coreneuron_all_c_files} ${KINDERIV_H}) | ||
|
||
set(link_cudacoreneuron) | ||
set(link_reportinglib) | ||
|
||
|
@@ -288,6 +290,7 @@ if(ENABLE_OPENACC AND ENABLE_CUDA_MODULES) | |
-gencode=arch=compute_50,code=sm_50 | ||
-gencode=arch=compute_52,code=sm_52 | ||
-gencode=arch=compute_52,code=compute_52 | ||
-Xcompiler -fPIC | ||
) | ||
set(link_cudacoreneuron cudacoreneuron) | ||
endif() | ||
|
@@ -297,8 +300,20 @@ if(ENABLE_REPORTINGLIB) | |
endif() | ||
|
||
|
||
|
||
############################################################ | ||
# Target libs | ||
############################################################ | ||
|
||
# | ||
# The coreneuron lib (only internal mechanisms) | ||
# | ||
add_library(coreneuron ${COMPILE_LIBRARY_TYPE} ${coreneuron_all_headers} ${coreneuron_all_templates} | ||
${coreneuron_all_c_files} ${cudacorenrn_objs} ${MOD2C_STDMECH_OUTPUTS}) | ||
add_dependencies(coreneuron kinderiv) | ||
|
||
target_link_libraries(coreneuron ${MPI_CXX_LIBRARIES} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ${cudacorenrn_objs} doesnt exist now, right? |
||
${link_reportinglib} ${link_cudacoreneuron} ${CUDA_LIBRARIES} ) | ||
${link_reportinglib} ${link_cudacoreneuron} ${CUDA_LIBRARIES}) | ||
|
||
set_target_properties(coreneuron PROPERTIES | ||
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH} | ||
|
@@ -315,31 +330,53 @@ set(CORENRN_LINK_LIBS ${CORENRN_LINK_LIBS} PARENT_SCOPE) | |
set(CORENRN_OPTMECH_MODS "${MOD2C_OPTMECH_MODS}" PARENT_SCOPE) | ||
|
||
|
||
install(TARGETS coreneuron | ||
# The scopmath lib - should not contain dimplic | ||
add_library(scopmath STATIC ${coreneuron_all_headers} ${scopmath_c_files}) | ||
set_target_properties(scopmath PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
|
||
# | ||
# The "complete" lib (coreneuron + opt mechs) | ||
# | ||
set(ENGINEMECH_C "mech/enginemech.cpp") | ||
add_library(corenrnmech ${COMPILE_LIBRARY_TYPE} ${coreneuron_all_headers} ${ENGINEMECH_C} ${ADDITIONAL_MECH_C_FILES}) | ||
add_dependencies(corenrnmech kinderiv) | ||
|
||
# The mechanism registration function will be always defined (at least for halfgap) | ||
target_compile_definitions(corenrnmech PUBLIC -DADDITIONAL_MECHS) | ||
|
||
# Public link interface (default), so that end binary links with all, even if they'r static | ||
target_link_libraries(corenrnmech scopmath coreneuron) | ||
|
||
|
||
######################################################### | ||
# INSTALL | ||
######################################################### | ||
|
||
install(TARGETS coreneuron corenrnmech ${link_cudacoreneuron} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
|
||
install(FILES "engine.h" | ||
install(FILES "engine.h" "enginemech.h" | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coreneuron) | ||
|
||
install(PROGRAMS ${MOD2C_BINARY} | ||
DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
install(FILES ${MOD2C_UNITS} | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/mod2c) | ||
|
||
|
||
if(ENABLE_HEADER_INSTALL) | ||
install(DIRECTORY . | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/coreneuron | ||
FILES_MATCHING PATTERN "*.h*" PATTERN "*.ipp") | ||
|
||
install(FILES ${KINDERIV_PY} | ||
install(FILES ${KINDERIV_PY} ${MOD_FUNC_C_PL} ${DIMPLIC_C} ${ENGINEMECH_C} | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/coreneuron) | ||
|
||
install(FILES ${MOD_FUNC_C_PL} | ||
install(TARGETS scopmath | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/coreneuron) | ||
|
||
install(DIRECTORY "scopmath_core" | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/coreneuron | ||
FILES_MATCHING PATTERN "dimplic.cpp") | ||
install(FILES ${MOD2C_OPTMECH_OUTPUTS} | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/mod2c) | ||
endif() | ||
|
||
install(PROGRAMS ${MOD2C_BINARY} | ||
DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
|
||
install(FILES ${MOD2C_UNITS} | ||
DESTINATION ${CMAKE_INSTALL_DATADIR}/mod2c) |
This file contains hidden or 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 hidden or 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,14 @@ | ||
#ifndef CORENEURON_ENGINEMECH_H | ||
#define CORENEURON_ENGINEMECH_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
int solve_core(int argc, char** argv); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif |
File renamed without changes.
This file contains hidden or 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,21 @@ | ||
/// Corenrnmech is a wrapper lib providing a single solve_core function | ||
/// which initializes the solver, loads the external mechanisms and launches the simulation | ||
|
||
#include <coreneuron/enginemech.h> | ||
#include <coreneuron/engine.h> | ||
|
||
#ifdef ADDITIONAL_MECHS | ||
namespace coreneuron{ extern void modl_reg(); } | ||
#endif | ||
|
||
int solve_core(int argc, char** argv) { | ||
|
||
mk_mech_init(argc, argv); | ||
|
||
#ifdef ADDITIONAL_MECHS | ||
/// Initializing additional Neurodamus mechanisms (in mod_func.c, built by mech/mod_func.c.pl) | ||
coreneuron::modl_reg(); | ||
#endif | ||
|
||
return run_solve_core(argc, argv); | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.