From aa51a1d8364fe119f5cd79a47f2dd3b053ff37e2 Mon Sep 17 00:00:00 2001 From: Omar Awile Date: Wed, 27 Sep 2023 15:04:30 +0200 Subject: [PATCH 1/5] Expand the basic install instructions a bit. (#2544) Add more details --- docs/index.rst | 5 +++-- docs/install/install_instructions.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 3ce69c7774..00d8791a9e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -91,7 +91,8 @@ Installation .. tab-item:: macOS - The recommended installation is to: + The recommended installation is to open a Terminal (Press `⌘` + `Space` and type "terminal") + and type: .. code:: @@ -104,7 +105,7 @@ Installation .. tab-item:: Linux - The recommended installation is to: + The recommended installation is to open a terminal and type: .. code:: diff --git a/docs/install/install_instructions.md b/docs/install/install_instructions.md index 5e590d8d63..12e04af581 100644 --- a/docs/install/install_instructions.md +++ b/docs/install/install_instructions.md @@ -8,7 +8,7 @@ Windows platforms. #### Mac OS -Since version 7.8.1 we are providing Python wheels and NEURON can be installed using `pip` as: +Since version 7.8.1 we are providing Python wheels and NEURON can be installed using `pip` by opening a Terminal (Press `⌘` + `Space` and type "terminal") and typing: ``` pip3 install neuron @@ -107,7 +107,7 @@ architecture. #### Linux -Like Mac OS, since 7.8.1 release python wheels are provided and you can use `pip` to install NEURON as: +Like Mac OS, since 7.8.1 release python wheels are provided and you can use `pip` to install NEURON by opening a terminal and typing: ``` pip3 install neuron From 125527cd550582cfca16d08b46e56efe0131f301 Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Wed, 27 Sep 2023 15:07:53 +0200 Subject: [PATCH 2/5] Fix external linkage with MSVC (#2538) --- src/nmodl/modl.cpp | 2 +- src/nmodl/noccout.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nmodl/modl.cpp b/src/nmodl/modl.cpp index 84ae6d8dc8..494c1b4111 100644 --- a/src/nmodl/modl.cpp +++ b/src/nmodl/modl.cpp @@ -61,7 +61,7 @@ extern int mkdir_p(const char*); extern int vectorize; extern int numlist; -extern char* nmodl_version_; +extern const char* nmodl_version_; extern int usederivstatearray; /*SUPPRESS 763*/ diff --git a/src/nmodl/noccout.cpp b/src/nmodl/noccout.cpp index 2a63485708..e9c9f155de 100644 --- a/src/nmodl/noccout.cpp +++ b/src/nmodl/noccout.cpp @@ -5,7 +5,7 @@ #include "parse1.hpp" #include "symbol.h" -extern char* nmodl_version_; +extern const char* nmodl_version_; #define P(arg) fputs(arg, fcout) List *procfunc, *initfunc, *modelfunc, *termfunc, *initlist, *firstlist; From 90eca81703b00a83293685581a936b8397584ecc Mon Sep 17 00:00:00 2001 From: Matthias Wolf Date: Wed, 27 Sep 2023 15:09:10 +0200 Subject: [PATCH 3/5] Fix headers MSVC complains about (#2537) --- src/nmodl/nocpout.cpp | 3 +++ src/oc/wrap_sprintf.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/nmodl/nocpout.cpp b/src/nmodl/nocpout.cpp index 3a4962e6c6..07722d0749 100644 --- a/src/nmodl/nocpout.cpp +++ b/src/nmodl/nocpout.cpp @@ -63,10 +63,13 @@ directly by hoc. #include "parse1.hpp" #include +#include // std::back_inserter #include #include #include +#ifdef HAVE_UNISTD_H #include +#endif #define GETWD(buf) getcwd(buf, NRN_BUFSIZE) int vectorize = 1; diff --git a/src/oc/wrap_sprintf.h b/src/oc/wrap_sprintf.h index 2c1ca445f7..bba7ddd80f 100644 --- a/src/oc/wrap_sprintf.h +++ b/src/oc/wrap_sprintf.h @@ -1,4 +1,6 @@ #include +#include // std::forward + namespace neuron { /** * @brief Redirect sprintf to snprintf if the buffer size can be deduced. From ecb09995505718fedbf82ed7922729626aa6e9f7 Mon Sep 17 00:00:00 2001 From: Luc Grosheintz Date: Wed, 27 Sep 2023 15:12:18 +0200 Subject: [PATCH 4/5] Use `char const *` in `oc_popen`. (#2532) --- src/oc/fileio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/oc/fileio.cpp b/src/oc/fileio.cpp index cc43e55707..88b7e96f2f 100644 --- a/src/oc/fileio.cpp +++ b/src/oc/fileio.cpp @@ -473,7 +473,7 @@ void hoc_sprint1(char** ppbuf, int argn) { /* convert args to right type for con } #if defined(WIN32) -static FILE* oc_popen(char* cmd, char* type) { +static FILE* oc_popen(char const* const cmd, char const* const type) { FILE* fp; char buf[1024]; assert(strlen(cmd) + 20 < 1024); From 8985d2b5cc4088598b16a5a4fe3c50701de27856 Mon Sep 17 00:00:00 2001 From: Pramod Kumbhar Date: Wed, 27 Sep 2023 09:28:24 -0400 Subject: [PATCH 5/5] Allow to run clang-format on nocmodl generated C++ files (#2542) With the current master if we run clang-format on generated file and try to rebuild then we get errors like ``` src/nrnoc/netstim.cpp:393:28: error: no member named '_prop' in 'Point_process'; did you mean 'prop'? auto* const _p = _pnt->_prop; ``` This is because we have some magic header macros that rename certain internal variables. To avoid the issue, just tell clang-format to avoid sorting headers included. --- src/nmodl/noccout.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nmodl/noccout.cpp b/src/nmodl/noccout.cpp index e9c9f155de..f95ed6e315 100644 --- a/src/nmodl/noccout.cpp +++ b/src/nmodl/noccout.cpp @@ -85,10 +85,12 @@ void c_out() { P("#undef PI\n"); P("#define nil 0\n"); P("#define _pval pval\n"); // due to some old models using _pval + P("// clang-format on\n"); P("#include \"md1redef.h\"\n"); P("#include \"section_fwd.hpp\"\n"); P("#include \"nrniv_mf.h\"\n"); P("#include \"md2redef.h\"\n"); + P("// clang-format off\n"); P("#include \"neuron/cache/mechanism_range.hpp\"\n"); P("#include \n"); @@ -481,10 +483,12 @@ void c_out_vectorize() { P("#undef PI\n"); P("#define nil 0\n"); P("#define _pval pval\n"); // due to some old models using _pval + P("// clang-format off\n"); P("#include \"md1redef.h\"\n"); P("#include \"section_fwd.hpp\"\n"); P("#include \"nrniv_mf.h\"\n"); P("#include \"md2redef.h\"\n"); + P("// clang-format on\n"); P("#include \"neuron/cache/mechanism_range.hpp\"\n"); printlist(defs_list); printlist(firstlist);