Open davydden opened 8 years ago
Homebrew is using this work around in Homebrew/homebrew-science#4406:
diff -ruN a/adm/cmake/TKernel/CMakeLists.txt b/adm/cmake/TKernel/CMakeLists.txt
--- a/adm/cmake/TKernel/CMakeLists.txt 2016-06-02 14:18:16.000000000 +0200
+++ b/adm/cmake/TKernel/CMakeLists.txt 2016-10-05 19:25:14.000000000 +0200
@@ -29,7 +29,7 @@
set(TOOLKIT_LIBS ${TOOLKIT_LIBS} ${CSF_SOCKETLibs_LIB} ${CSF_advapi32_LIB} ${CSF_gdi32_LIB} ${CSF_user32_LIB} ${CSF_kernel32_LIB} ${CSF_psapi_LIB})
else(WIN32)
# An implementation for Mac OS X has been added in src/OSD/gettime_osx.h
- if(NOT APPLE)
+ if(APPLE)
include( CheckFunctionExists )
check_function_exists( clock_gettime CLOCK_GETTIME_IN_LIBC )
if(NOT CLOCK_GETTIME_IN_LIBC)
@@ -40,7 +40,7 @@
endif(NOT CLOCK_GETTIME_IN_LIBRT)
set(TOOLKIT_LIBS ${TOOLKIT_LIBS} rt)
endif(NOT CLOCK_GETTIME_IN_LIBC)
- endif(NOT APPLE)
+ endif(APPLE)
endif(WIN32)
# Adde-DHAVE_TBB in TKernel in order to benefit from Standard_MMgrTBBalloc
Binary files a/src/.DS_Store and b/src/.DS_Store differ
diff -ruN a/src/OSD/OSD_Chronometer.cxx b/src/OSD/OSD_Chronometer.cxx
--- a/src/OSD/OSD_Chronometer.cxx 2016-06-02 14:18:16.000000000 +0200
+++ b/src/OSD/OSD_Chronometer.cxx 2016-10-05 19:26:01.000000000 +0200
@@ -51,7 +51,7 @@
#include <mach/mach.h>
#endif
-#if defined(__APPLE__) && defined(__MACH__)
+#if defined(__OPPLE__) && defined(__MACH__)
#include "gettime_osx.h"
#endif
@schoeps thanks. I will give it a try...
@tpaviot this issue is still there in 0.18
but now requires a different patch to workaround. Can you please check if a proper fix is possible? Currently, everyone on macOS
Sierra
are out of luck... :-(
@davydden whats the problem with this patch in 0.18? i am currently building it but my machine is not the fastest
I have managed to get it build (without that other patch) with
diff --git a/src/OSD/OSD_Chronometer.cxx b/src/OSD/OSD_Chronometer.cxx
index f7374fb..63ac140 100644
--- a/src/OSD/OSD_Chronometer.cxx.old
+++ b/src/OSD/OSD_Chronometer.cxx
@@ -51,7 +51,7 @@
#include <mach/mach.h>
#endif
-#if defined(__APPLE__) && defined(__MACH__)
+#if defined(__APPLE__) && !defined(__MAC_10_12)
#include "gettime_osx.h"
#endif
tpaviot will likely come up with something better but this can work for now, (and is perfectly valid currently as OSX 10.12 is the only one with clock_gettime
@xzcvczx you are right, the patch from @schoeps still applies fine, i just had a slightly modified version where extra white space was removed and this, AFAICT, made my patch broken.
@xzcvczx will try your patch now (which is much cleaner) on 0.17.2
and 0.18
...
update: worked fine for me on both versions. :+1:
@davydden @xzcvczx thank you guys for the quick fix. I'll push a pr with a fix and request your help for testing since I don't have access to any osx sierra machine
oce
fails to compile on the most recent macOS due to name conflict: