Prefix project macros to prevent conflicts
Preprocessing macros defined by the project should be prefixed by CORENEURON_ to prevent possible conflicts.
Hi @tristan0x, is this open and can be worked upon?
Hello @tapaswenipathak Thank you for your interest in CoreNeuron!
According to the add_definitions references in CMakeLists.txt files:
./CMakeLists.txt: add_definitions("-DISPC_INTEROP=1")
./CMakeLists.txt: add_definitions("-DNRNMPI=1")
./CMakeLists.txt: add_definitions("-DNRNMPI=0")
./CMakeLists.txt: add_definitions("-DNRN_MULTISEND=0")
./CMakeLists.txt: add_definitions("-DLAYOUT=0")
./CMakeLists.txt: add_definitions("-DLAYOUT=1")
./CMakeLists.txt: add_definitions("-DENABLE_OMP_RUNTIME_SCHEDULE")
./CMakeLists.txt: add_definitions("-DDISABLE_HOC_EXP")
./CMakeLists.txt: add_definitions("-DENABLE_SPLAYTREE_QUEUING")
./CMakeLists.txt: add_definitions("-DNET_RECEIVE_BUFFERING=0")
./CMakeLists.txt: add_definitions("-DENABLE_REPORTING")
./CMakeLists.txt: add_definitions("-DCORENEURON_CALIPER")
./CMakeLists.txt: add_definitions("-DHAVE_MALLOC_H")
./CMakeLists.txt:add_definitions(-DCORENEURON_BUILD)
./CMakeLists.txt: add_definitions(-DSWAP_ENDIAN_DISABLE_ASM)
./CMakeLists.txt: add_definitions( -DPG_ACC_BUGS)
./CMakeLists.txt: add_definitions( -DCUDA_PROFILING)
./CMakeLists.txt: add_definitions(-DCUDA_MODULES_DISABLED)
./CMakeLists.txt: add_definitions("-DDISABLE_TIMEOUT")
./CMakeLists.txt: add_definitions("-DEXPORT_MECHS_FUNCTIONS")
./tests/CMakeLists.txt: add_definitions(-DBOOST_TEST_DYN_LINK=TRUE)
./external/mod2c/src/mod2c_core/CMakeLists.txt:add_definitions(-DNMODL=1 -DBBCORE=1 -DNOCMODL=1 -DCVODE=1 -DVECTORIZE=1)
I think we should prefix the following variables:
-
ISPC_INTEROP -
LAYOUT -
ENABLE_OMP_RUNTIME_SCHEDULE -
DISABLE_HOC_EXP -
ENABLE_SPLAYTREE_QUEUING -
ENABLE_REPORTING -
HAVE_MALLOC_H -
SWAP_ENDIAN_DISABLE_ASM -
PG_ACC_BUGS -
CUDA_PROFILING -
CUDA_MODULES_DISABLED -
DISABLE_TIMEOUT -
EXPORT_MECHS_FUNCTIONS
The following should be probably kept intact because probably used by Neuron:
-
NRNMPI -
NRN_MULTISEND -
NET_RECEIVE_BUFFERING(is this a standard variable @pramodk ?)
Besides, I also suggest the following renaming:
- replace ENABLE by USE, for instance
CORENEURON_USE_REPORTING - add ENABLE when missing, for instance
CORENEURON_ENABLE_CALIPERinstead ofCORENEURON_CALIPER -
CORENEURON_USE_SOA_LAYOUTinstead ofCORENEURON_LAYOUT
Can you please confirm @pramodk ?
I agree with @tristan0x. These macros and cmake has been organically growing. We will start redesign aspects soon!
It would still be good to do this. With today's master we have:
set(UNIFIED_MEMORY_DEF -DUNIFIED_MEMORY)
set(CUDA_PROFILING_DEF -DCUDA_PROFILING)
CMakeLists.txt: add_definitions("-DHAVE_MALLOC_H")
CMakeLists.txt: add_definitions("-DLAYOUT=0")
CMakeLists.txt: add_definitions("-DDISABLE_HOC_EXP")
CMakeLists.txt: add_definitions("-DENABLE_SPLAYTREE_QUEUING")
CMakeLists.txt: add_definitions("-DNET_RECEIVE_BUFFERING=0")
CMakeLists.txt: add_definitions("-DDISABLE_TIMEOUT")
CMakeLists.txt: add_definitions("-DENABLE_BIN_REPORTS")
CMakeLists.txt: add_definitions("-DENABLE_SONATA_REPORTS")
which look they should have prefixes added.
As well as adding prefixes, we should make sure the prefixes are consistent.
There are currently CORENRN_ ("mainly" CMake) and CORENEURON_ ("mainly" preprocessor macros).