HEX
Server: Apache/2.4.41 (FreeBSD) OpenSSL/1.0.2s mod_fcgid/2.3.9
System: FreeBSD salazo 12.0-RELEASE-p1303-ZFS hostBSD 12.0-RELEASE-p1303-ZFS DMR amd64
User: admin (1000)
PHP: 7.4.3
Disabled: NONE
Upload Files
File: /usr/ports/science/lm/files/patch-src_c_lm_main_runSimulation.cpp
--- src/c/lm/main/runSimulation.cpp.orig	2018-09-09 19:31:22 UTC
+++ src/c/lm/main/runSimulation.cpp
@@ -45,6 +45,9 @@
  */
 #if defined(MACOSX)
 #include <sys/sysctl.h>
+#elif defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/sysctl.h>
 #elif defined(LINUX)
 #include <sys/sysinfo.h>
 #endif
@@ -149,6 +152,9 @@ void runSolver(char *simulationFilename,
     size_t  physicalCpuCoresSize=sizeof(physicalCpuCores);
     sysctlbyname("hw.activecpu",&physicalCpuCores,&physicalCpuCoresSize,NULL,0);
     numberCpuCores = physicalCpuCores;
+#elif defined(__FreeBSD__)
+    size_t	len = sizeof(numberCpuCores);
+    sysctlbyname("hw.ncpu",&numberCpuCores,&len,NULL,0);
 #elif defined(LINUX)
     #ifdef ARM
         numberCpuCores = get_nprocs_conf();