Commits

Satish Balay committed ac7218b

threadcomm: fix build on bgl/c++
threadcommred.c:
1500-010: (W) WARNING in PetscThreadReductionEnd_Private(PetscThreadCommRedCtx, void *): Infinite loop. Program may not stop.
/usr/bin/ar: threadcomm.o: No such file or directory

Comments (0)

Files changed (2)

config/PETSc/Configure.py

                  'gettimeofday', 'getwd', 'memalign', 'memmove', 'mkstemp', 'popen', 'PXFGETARG', 'rand', 'getpagesize',
                  'readlink', 'realpath',  'sigaction', 'signal', 'sigset', 'usleep', 'sleep', '_sleep', 'socket',
                  'times', 'gethostbyname', 'uname','snprintf','_snprintf','_fullpath','lseek','_lseek','time','fork','stricmp',
-                 'strcasecmp', 'bzero', 'dlopen', 'dlsym', 'dlclose', 'dlerror',
+                 'strcasecmp', 'bzero', 'dlopen', 'dlsym', 'dlclose', 'dlerror','get_nprocs','sysctlbyname',
                  '_intel_fast_memcpy','_intel_fast_memset']
     libraries1 = [(['socket', 'nsl'], 'socket'), (['fpe'], 'handle_sigfpes')]
     self.headers.headers.extend(headersC)

src/sys/threadcomm/interface/threadcomm.c

   if (N_CORES == -1) {
     N_CORES = 1; /* Default value if number of cores cannot be found out */
 
-#if defined(PETSC_HAVE_SCHED_CPU_SET_T) /* Linux */
+#if defined(PETSC_HAVE_SYS_SYSINFO_H) && (PETSC_HAVE_GET_NPROCS) /* Linux */
     N_CORES = get_nprocs();
-#elif defined(PETSC_HAVE_SYS_SYSCTL_H) /* MacOS, BSD */
+#elif defined(PETSC_HAVE_SYS_SYSCTL_H) && (PETSC_HAVE_SYSCTLBYNAME) /* MacOS, BSD */
     {
       PetscErrorCode ierr;
       size_t         len = sizeof(N_CORES);