Browse Source

Fix link error on Linux/musl.

get_nprocs() is a GNU convenience function equivalent to POSIX2008
sysconf(_SC_NPROCESSORS_ONLN); the latter should be available in unistd.h
on any current *nix. (OS X supports this call since 10.5, and FreeBSD
currently supports it. But this commit does not change FreeBSD or OS X
versions.)
tags/v0.2.11^2
Isaac Dunham 11 years ago
parent
commit
f7eb81a846
3 changed files with 5 additions and 2 deletions
  1. +3
    -0
      CONTRIBUTORS.md
  2. +1
    -1
      driver/others/init.c
  3. +1
    -1
      driver/others/memory.c

+ 3
- 0
CONTRIBUTORS.md View File

@@ -114,5 +114,8 @@ In chronological order:
* carlkl <https://github.com/carlkl>
* [2013-12-13] Fixed LAPACKE building bug on Windows

* Isaac Dunham <https://github.com/idunham>
* [2014-08-03] Fixed link error on Linux/musl

* [Your name or handle] <[email or website]>
* [Date] [Brief summary of your changes]

+ 1
- 1
driver/others/init.c View File

@@ -865,7 +865,7 @@ void gotoblas_set_affinity2(int threads) {};

void gotoblas_affinity_reschedule(void) {};

int get_num_procs(void) { return get_nprocs(); }
int get_num_procs(void) { return sysconf(_SC_NPROCESSORS_ONLN); }

int get_num_nodes(void) { return 1; }



+ 1
- 1
driver/others/memory.c View File

@@ -162,7 +162,7 @@ int get_num_procs(void);
#else
int get_num_procs(void) {
static int nums = 0;
if (!nums) nums = get_nprocs();
if (!nums) nums = sysconf(_SC_NPROCESSORS_ONLN);
return nums;
}
#endif


Loading…
Cancel
Save