Skip to content

Commit 687c250

Browse files
author
Goran Jelic-Cizmek
committed
Merge remote-tracking branch 'origin/jelic/windows-merge-attempt-1' into jelic/windows-merge-attempt-1
2 parents b4e018f + b74691d commit 687c250

7 files changed

Lines changed: 37 additions & 19 deletions

File tree

.github/workflows/windows.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,17 @@ jobs:
105105
-DNRN_ENABLE_PYTHON=OFF `
106106
-DNRN_ENABLE_PYTHON_DYNAMIC=OFF `
107107
-DNRN_ENABLE_RX3D=OFF `
108+
-DNRN_ENABLE_TESTS=ON `
108109
-DNRN_PYTHON_DYNAMIC="${env:allPythons}" `
109110
-DNRN_RX3D_OPT_LEVEL=2 `
110111
-DCYTHON_EXECUTABLE="${env:firstCython}" `
111112
-DPYTHON_EXECUTABLE="${env:firstPython}"
112-
cmake --build build --config Release
113+
cmake --build build --config Release -v
113114
shell: pwsh
114115
working-directory: ${{runner.workspace}}\nrn
115-
env:
116-
BUILD_SOURCESDIRECTORY: ${{runner.workspace}}\nrn
116+
117+
- name: Test Installer
118+
run: |
119+
ctest --output-on-failure -j
120+
shell: pwsh
121+
working-directory: ${{runner.workspace}}\nrn\build

src/coreneuron/utils/randoms/nrnran123.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ g_k_qualifiers philox4x32_key_t g_k{{0, 0}};
9393
// Cannot refer to g_k directly from a nrn_pragma_acc(routine seq) method like
9494
// coreneuron_random123_philox4x32_helper, and cannot have this inlined there at
9595
// higher optimisation levels
96-
__attribute__((noinline)) philox4x32_key_t& global_state() {
96+
[[gnu::noinline, clang::noinline, msvc::noinline]] philox4x32_key_t& global_state() {
9797
return random123_global::g_k;
9898
}
9999
} // namespace random123_global

src/ivoc/ivocvect.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
#include <numeric>
88
#include <algorithm>
99

10+
#if defined(_MSC_VER)
11+
#include <BaseTsd.h>
12+
typedef SSIZE_T ssize_t;
13+
#endif
14+
1015
using ParentVect = std::vector<double>;
1116
struct Object;
1217

src/ivoc/pwman.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3333,6 +3333,10 @@ Window* PWMImpl::snap_owned(Printer* pr, Window* wp) {
33333333

33343334
#endif // HAVE_IV
33353335

3336+
#if defined(WIN32)
3337+
#include <io.h>
3338+
#endif
3339+
33363340
char* ivoc_get_temp_file() {
33373341
char* tmpfile;
33383342
const char* tdir = getenv("TEMP");
@@ -3348,9 +3352,13 @@ char* ivoc_get_temp_file() {
33483352
hoc_execerror("Could not create temporary file:", tmpfile);
33493353
}
33503354
close(fd);
3355+
#else
3356+
#if defined(WIN32)
3357+
_mktemp(tmpfile);
33513358
#else
33523359
mktemp(tmpfile);
33533360
#endif
3361+
#endif
33543362
#if defined(WIN32)
33553363
tmpfile = hoc_back2forward(tmpfile);
33563364
#endif

src/node_order_optim/node_order_optim.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ extern int interleave_permute_type;
99
/// 0 cell together (Section construction order)
1010
/// 1 Interleave, identical cells warp adjacent
1111
/// 2 Depth order, optimize adjacent nodes to have adjacent parents.
12-
void nrn_optimize_node_order(int type);
12+
int nrn_optimize_node_order(int type);
1313

1414
/// @brief Compute and carry out the permutation for interleave_permute_type
1515
void nrn_permute_node_order();

src/oc/hoc.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ void fpecatch(int /* sig */) /* catch floating point exceptions */
749749
hoc_execerror("Floating point exception.", (char*) 0);
750750
}
751751

752-
__attribute__((noreturn)) void sigsegvcatch(int /* sig */) /* segmentation violation probably due to
752+
[[noreturn]] void sigsegvcatch(int /* sig */) /* segmentation violation probably due to
753753
arg type error */
754754
{
755755
Fprintf(stderr, "Segmentation violation\n");
@@ -762,7 +762,7 @@ __attribute__((noreturn)) void sigsegvcatch(int /* sig */) /* segmentation viola
762762
}
763763

764764
#if HAVE_SIGBUS
765-
__attribute__((noreturn)) void sigbuscatch(int /* sig */) {
765+
[[noreturn]] void sigbuscatch(int /* sig */) {
766766
Fprintf(stderr, "Bus error\n");
767767
print_bt();
768768
/*ARGSUSED*/
@@ -1702,12 +1702,12 @@ int hoc_get_line(void) { /* supports re-entry. fill hoc_cbuf with next line */
17021702
ReadConsoleA(GetStdHandle(STD_INPUT_HANDLE), line.data(), line.size(), &n, NULL);
17031703
if (n >= hoc_cbufstr->size - 3) {
17041704
hocstr_resize(hoc_cbufstr, n + 100);
1705-
ctp = cbuf = hoc_cbufstr->buf;
1705+
hoc_ctp = hoc_cbuf = hoc_cbufstr->buf;
17061706
}
1707-
strcpy(cbuf, line.data());
1708-
cbuf[n] = '\n';
1709-
cbuf[n + 1] = '\0';
1710-
hoc_audit_command(cbuf);
1707+
strcpy(hoc_cbuf, line.data());
1708+
hoc_cbuf[n] = '\n';
1709+
hoc_cbuf[n + 1] = '\0';
1710+
hoc_audit_command(hoc_cbuf);
17111711
#else
17121712
#if INTERVIEWS
17131713
if (nrn_fw_eq(hoc_fin, stdin) && hoc_interviews && !hoc_in_yyparse) {

src/scopmath/sparse_thread.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ create_coef_list makes a list for fast setup, does minimum ordering and
7373
ensures all elements needed are present */
7474
/* this could easily be made recursive but it isn't right now */
7575

76-
inline __attribute__((always_inline)) void subrow(SparseObj* so, Elm* pivot, Elm* rowsub) {
76+
[[gnu::always_inline, clang::always_inline]] inline void subrow(SparseObj* so, Elm* pivot, Elm* rowsub) {
7777
double r;
7878
Elm* el;
7979

@@ -89,7 +89,7 @@ inline __attribute__((always_inline)) void subrow(SparseObj* so, Elm* pivot, Elm
8989
}
9090
}
9191

92-
inline __attribute__((always_inline)) void bksub(SparseObj* so) {
92+
[[gnu::always_inline, clang::always_inline]] inline void bksub(SparseObj* so) {
9393
unsigned i;
9494
Elm* el;
9595

@@ -103,7 +103,7 @@ inline __attribute__((always_inline)) void bksub(SparseObj* so) {
103103
}
104104
}
105105

106-
inline __attribute__((always_inline)) int matsol(SparseObj* so) {
106+
[[gnu::always_inline, clang::always_inline]] inline int matsol(SparseObj* so) {
107107
Elm *pivot, *el;
108108
unsigned i;
109109

@@ -238,7 +238,7 @@ saves much time allocating and freeing during the solve phase
238238
*/
239239

240240
/* return pointer to row col element maintaining order in rows */
241-
inline __attribute__((always_inline)) Elm* getelm(SparseObj* so,
241+
[[gnu::always_inline, clang::always_inline]] inline Elm* getelm(SparseObj* so,
242242
unsigned row,
243243
unsigned col,
244244
Elm* newElm) {
@@ -519,7 +519,7 @@ inline void reduce_order(SparseObj* so, unsigned row) {
519519
insert(so, order);
520520
}
521521

522-
inline __attribute__((always_inline)) void get_next_pivot(SparseObj* so, unsigned i) {
522+
[[gnu::always_inline, clang::always_inline]] inline void get_next_pivot(SparseObj* so, unsigned i) {
523523
/* get varord[i], etc. from the head of the orderlist. */
524524
Item* order;
525525
Elm *pivot, *el;
@@ -589,7 +589,7 @@ void create_coef_list(SparseObj* so, int n, Callable fun, Args&&... args) {
589589
so->phase = 0;
590590
}
591591

592-
inline __attribute__((always_inline)) void init_coef_list(SparseObj* so) {
592+
[[gnu::always_inline, clang::always_inline]] inline void init_coef_list(SparseObj* so) {
593593
unsigned i;
594594
Elm* el;
595595

@@ -733,7 +733,7 @@ int _cvode_sparse_thread(void** v, int n, IndexArray x, Array p, Callable fun, A
733733
return SUCCESS;
734734
}
735735

736-
inline __attribute__((always_inline)) double* _nrn_thread_getelm(SparseObj* so, int row, int col) {
736+
[[gnu::always_inline, clang::always_inline]] inline double* _nrn_thread_getelm(SparseObj* so, int row, int col) {
737737
detail::sparse_thread::Elm* el;
738738
if (!so->phase) {
739739
return so->coef_list[so->ngetcall++];

0 commit comments

Comments
 (0)