Mac OS
-
- Supporting Users
- Posts: 141
- Joined: Tue Jan 09, 2018 6:48 pm
Re: Mac OS
Nono, forget embree 2.8 ( custom ) and get embree-2.17.1
Then place libs in your ${OSX_DEPENDENCY_ROOT}/lib/embree2 and headers in ${OSX_DEPENDENCY_ROOT}/include/embree2
For distribution i recommend to change the id's and rpath to loader_path.
Change to SET(EMBREE_LIBRARY ${OSX_DEPENDENCY_ROOT}/lib/embree2/libembree.2.dylib), you will see embree comes with
symlinks libembree.dylib -> libembree.2.dylib -> libembree.2.8.0.dylib, so thats more universal but major version agnostic.
Preferred way:
Another way could be not to hardcode but use find_embree module, Dade just fixed it to lookup embree_root first.
Aka: SET(EMBREE_SEARCH_PATH "${OSX_DEPENDENCY_ROOT}") and comment out hardcoded pathes.
This should also fix you header not found problem.
Jens
Then place libs in your ${OSX_DEPENDENCY_ROOT}/lib/embree2 and headers in ${OSX_DEPENDENCY_ROOT}/include/embree2
For distribution i recommend to change the id's and rpath to loader_path.
Change to SET(EMBREE_LIBRARY ${OSX_DEPENDENCY_ROOT}/lib/embree2/libembree.2.dylib), you will see embree comes with
symlinks libembree.dylib -> libembree.2.dylib -> libembree.2.8.0.dylib, so thats more universal but major version agnostic.
Preferred way:
Another way could be not to hardcode but use find_embree module, Dade just fixed it to lookup embree_root first.
Aka: SET(EMBREE_SEARCH_PATH "${OSX_DEPENDENCY_ROOT}") and comment out hardcoded pathes.
This should also fix you header not found problem.
Jens
-
- Posts: 28
- Joined: Sun Jan 28, 2018 2:10 pm
- Location: Canada
Re: Mac OS
So, going the preferred route, the macOS dependency archive would have to include the embree2 library and header files for 2.17.2.
So, I commented out the EMBREE entries and added in the EMBREE_SEARCH_PATH.
The CGLGetCurrentContext() error remains. I guess I just have to somehow find where/which header file the prototype is defined in and place that include at the top of device.cpp.
------
Xcode command line tools adds in a bunch of header files, and it's needed to install MacPorts, and MacPorts is needed to (easily) install TBB.
I added this:
#include "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/CGLCurrent.h"
to to the top of devices.cpp and the error disappeared. These headers were the first to show up on my HDD search. Bit of a kludge, but it seems to have worked.
The headers are also found inside Xcode at "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers", so I guess that could be used too.
Got through the compilation stage, but linking seems to be taking longer than expected. I can't tell from the progress bar if it stalled or not.
So, I commented out the EMBREE entries and added in the EMBREE_SEARCH_PATH.
The CGLGetCurrentContext() error remains. I guess I just have to somehow find where/which header file the prototype is defined in and place that include at the top of device.cpp.
------
Xcode command line tools adds in a bunch of header files, and it's needed to install MacPorts, and MacPorts is needed to (easily) install TBB.
I added this:
#include "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers/CGLCurrent.h"
to to the top of devices.cpp and the error disappeared. These headers were the first to show up on my HDD search. Bit of a kludge, but it seems to have worked.
The headers are also found inside Xcode at "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework/Headers", so I guess that could be used too.
Got through the compilation stage, but linking seems to be taking longer than expected. I can't tell from the progress bar if it stalled or not.
Last edited by patrickwalker on Mon Jan 29, 2018 2:56 pm, edited 2 times in total.
-
- Supporting Users
- Posts: 141
- Joined: Tue Jan 09, 2018 6:48 pm
Re: Mac OS
Looks like you did not properly commented out or it still resides in the cmake cache.patrickwalker wrote: ↑Mon Jan 29, 2018 2:35 pm So, going the preferred route, the macOS dependency archive would have to include the embree2 library and header files for 2.17.2.
So, I commented out the EMBREE entries and added in the EMBREE_SEARCH_PATH.
The CGLGetCurrentContext() error remains. I guess I just have to somehow find where/which header file the prototype is defined in and place that include at the top of device.cpp.
Can you post the block ?
Jens
-
- Supporting Users
- Posts: 141
- Joined: Tue Jan 09, 2018 6:48 pm
Re: Mac OS
Yes, linking can take a while cause i enabled LTO.
Jens
Jens
-
- Posts: 28
- Joined: Sun Jan 28, 2018 2:10 pm
- Location: Canada
Re: Mac OS
Code: Select all
###########################################################################
#
# Configuration ( Jens Verwiebe )
#
###########################################################################
MESSAGE(STATUS "Using OSX Configuration settings")
# Allow for the location of OSX_DEPENDENCY_ROOT to be set from the command line
IF( NOT OSX_DEPENDENCY_ROOT )
set(OSX_DEPENDENCY_ROOT ${CMAKE_SOURCE_DIR}) # can be macos or usr/local for example
# set(OSX_DEPENDENCY_ROOT ${CMAKE_SOURCE_DIR}/../macos) # can be macos or usr/local for example
ENDIF()
MESSAGE(STATUS "OSX_DEPENDENCY_ROOT : " ${OSX_DEPENDENCY_ROOT})
set(OSX_SEARCH_PATH ${OSX_DEPENDENCY_ROOT})
set(LUXCORE_DISABLE_EMBREE_BVH_BUILDER ON)
MESSAGE(STATUS "Disabling Embree BVH builder - no custom Embree used")
# Libs present in system ( /usr )
SET(SYS_LIBRARIES z )
# Libs that have find_package modules
set(OPENIMAGEIO_ROOT_DIR "${OSX_SEARCH_PATH}")
set(BOOST_SEARCH_PATH "${OSX_SEARCH_PATH}")
set(BOOST_LIBRARYDIR "${BOOST_SEARCH_PATH}/lib")
set(OPENCL_SEARCH_PATH "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/opencl.framework")
set(OPENCL_INCLUDE_PATH "${OPENCL_SEARCH_PATH}")
#set(OPENCL_LIBRARYDIR "${OPENCL_SEARCH_PATH}")
#
# Changed for macOS High Sierra
#
set(EMBREE_SEARCH_PATH "{OSX_DEPENDENCY_ROOT}")
set(GLEW_SEARCH_PATH "${OSX_SEARCH_PATH}")
find_path(GLEW_INCLUDE_DIR glew.h PATHS ${OSX_SEARCH_PATH}/include/GL )
find_library(GLEW_LIBRARY libGLEW.a PATHS ${OSX_SEARCH_PATH}/lib )
set(GLEW_FOUND 1)
set(GLUT_SEARCH_PATH "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/glut.framework")
set(GLUT_INCLUDE_PATH "${GLUT_SEARCH_PATH}/Headers")
#set(GLUT_LIBRARYDIR "${GLUT_SEARCH_PATH}")
SET(OPENEXR_ROOT "${OSX_SEARCH_PATH}")
# Libs with hardcoded pathes ( macos repo )
SET(TIFF_LIBRARIES ${OSX_DEPENDENCY_ROOT}/lib/libtiff.a)
SET(TIFF_INCLUDE_DIR ${OSX_DEPENDENCY_ROOT}/include/tiff)
SET(TIFF_FOUND ON)
SET(JPEG_LIBRARIES ${OSX_DEPENDENCY_ROOT}/lib/libjpeg.a)
SET(JPEG_INCLUDE_DIR ${OSX_DEPENDENCY_ROOT}/include/jpeg)
SET(JPEG_FOUND ON)
SET(PNG_LIBRARIES ${OSX_DEPENDENCY_ROOT}/lib/libpng.a ${SYS_LIBRARIES})
SET(PNG_INCLUDE_DIR ${OSX_DEPENDENCY_ROOT}/include/png)
SET(PNG_FOUND ON)
#SET(EMBREE_LIBRARY ${OSX_DEPENDENCY_ROOT}/lib/embree2/libembree.2.17.2.dylib)
#SET(EMBREE_INCLUDE_PATH ${OSX_DEPENDENCY_ROOT}/include/embree2)
SET(EMBREE_FOUND ON)
# use Blender python libs for static compiling !
SET(PYTHON_LIBRARIES ${OSX_DEPENDENCY_ROOT}/lib/BF_pythonlibs/py34_intel64/libbf_python_ext.a ${OSX_DEPENDENCY_ROOT}/lib/BF_pythonlibs/py34_intel64/libbf_python.a)
SET(PYTHON_INCLUDE_DIRS ${OSX_DEPENDENCY_ROOT}/include/Python3.4m)
SET(PYTHONLIBS_FOUND ON)
luxCOREconsole and luxcoreui compile and start. Don't have a test file for it ready to go but it compiled and linked so they should work.
Also going to take a guess here, but can we change the OPENCL_SEARCH_PATH to a folder inside Xcode? Not sure why we couldn't if Xcode is being used. I guess that's sort of related to that whole OpenGL thing... can't be for GLUT because that's for luxcoreui I think.
-
- Supporting Users
- Posts: 141
- Joined: Tue Jan 09, 2018 6:48 pm
Re: Mac OS
Proposed diff:
-You must have a library repo somewhere, either discrete aka "macos" ( preferred ) or /usr/local or opt/ whatever.
-Respect the categories i made:
.. way more overlook then.
-Embree special bvh_build option is obsolete since its in embree master now
This is take care by cmake itself, see: ${CMAKE_OSX_SYSROOT} which always reflects the highestmost sdk found inside xcode.
Underrstood ?
set(OPENCL_SEARCH_PATH "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/opencl.framework")
means really /Applications/XCode.app/blablabla/blablabla/System/Library/Frameworks/opencl.framework"), see ?
BTW: did you put the opencl c++ bindings into cl framework headers ?
Jens
Code: Select all
--- /home/jensverwiebe/Schreibtisch/old 2018-01-29 16:08:44.836788392 +0100
+++ /home/jensverwiebe/Schreibtisch/new 2018-01-29 16:07:38.290620334 +0100
@@ -8,16 +8,12 @@ MESSAGE(STATUS "Using OSX Configuration
# Allow for the location of OSX_DEPENDENCY_ROOT to be set from the command line
IF( NOT OSX_DEPENDENCY_ROOT )
- set(OSX_DEPENDENCY_ROOT ${CMAKE_SOURCE_DIR}) # can be macos or usr/local for example
-# set(OSX_DEPENDENCY_ROOT ${CMAKE_SOURCE_DIR}/../macos) # can be macos or usr/local for example
+ set(OSX_DEPENDENCY_ROOT ${CMAKE_SOURCE_DIR}/../macos) # can be macos or usr/local for example
ENDIF()
MESSAGE(STATUS "OSX_DEPENDENCY_ROOT : " ${OSX_DEPENDENCY_ROOT})
set(OSX_SEARCH_PATH ${OSX_DEPENDENCY_ROOT})
-set(LUXCORE_DISABLE_EMBREE_BVH_BUILDER ON)
-MESSAGE(STATUS "Disabling Embree BVH builder - no custom Embree used")
-
# Libs present in system ( /usr )
SET(SYS_LIBRARIES z )
@@ -31,12 +27,7 @@ set(OPENCL_SEARCH_PATH "${CMAKE_O
set(OPENCL_INCLUDE_PATH "${OPENCL_SEARCH_PATH}")
#set(OPENCL_LIBRARYDIR "${OPENCL_SEARCH_PATH}")
-
-#
-# Changed for macOS High Sierra
-#
-
-set(EMBREE_SEARCH_PATH "{OSX_DEPENDENCY_ROOT}")
+set(EMBREE_SEARCH_PATH "{OSX_DEPENDENCY_ROOT}")
set(GLEW_SEARCH_PATH "${OSX_SEARCH_PATH}")
find_path(GLEW_INCLUDE_DIR glew.h PATHS ${OSX_SEARCH_PATH}/include/GL )
@@ -59,9 +50,6 @@ SET(JPEG_FOUND ON)
SET(PNG_LIBRARIES ${OSX_DEPENDENCY_ROOT}/lib/libpng.a ${SYS_LIBRARIES})
SET(PNG_INCLUDE_DIR ${OSX_DEPENDENCY_ROOT}/include/png)
SET(PNG_FOUND ON)
-#SET(EMBREE_LIBRARY ${OSX_DEPENDENCY_ROOT}/lib/embree2/libembree.2.17.2.dylib)
-#SET(EMBREE_INCLUDE_PATH ${OSX_DEPENDENCY_ROOT}/include/embree2)
-SET(EMBREE_FOUND ON)
# use Blender python libs for static compiling !
SET(PYTHON_LIBRARIES ${OSX_DEPENDENCY_ROOT}/lib/BF_pythonlibs/py34_intel64/libbf_python_ext.a ${OSX_DEPENDENCY_ROOT}/lib/BF_pythonlibs/py34_intel64/libbf_python.a)
-Respect the categories i made:
Code: Select all
# Libs present in system ( /usr )
...
Libs that have find_package modules
...
# Libs with hardcoded pathes ( macos repo )
-Embree special bvh_build option is obsolete since its in embree master now
SDKpathes are never a problem, cause you can assume a given structure ( unless Apple reinvented the wheel again )Also going to take a guess here, but can we change the OPENCL_SEARCH_PATH to a folder inside Xcode? Not sure why we couldn't if Xcode is being used. I guess that's sort of related to that whole OpenGL thing... can't be for GLUT because that's for luxcoreui I think.
This is take care by cmake itself, see: ${CMAKE_OSX_SYSROOT} which always reflects the highestmost sdk found inside xcode.
Underrstood ?
set(OPENCL_SEARCH_PATH "${CMAKE_OSX_SYSROOT}/System/Library/Frameworks/opencl.framework")
means really /Applications/XCode.app/blablabla/blablabla/System/Library/Frameworks/opencl.framework"), see ?
BTW: did you put the opencl c++ bindings into cl framework headers ?
Jens
Re: Mac OS
Just run, form LuxCore directory, something like:patrickwalker wrote: ↑Mon Jan 29, 2018 2:59 pm luxCOREconsole and luxcoreui compile and start. Don't have a test file for it ready to go but it compiled and linked so they should work.
Code: Select all
./bin/luxcoreui scenes/luxball/luxball-hdr.cfg
-
- Supporting Users
- Posts: 141
- Joined: Tue Jan 09, 2018 6:48 pm
Re: Mac OS
Furthermore..
CGL mean Core GL and possibly those files are moved into the CoreVideo framework now.
Either try linking this or follow Dade's proposal to just comment out for now, cause opengl interop is not used anymore ( really ? )
The proper way would be to #if defined (__APPLE__) && ( versioncheck)
cause on 10.12 sdk it still works as expected
Jens
CGL mean Core GL and possibly those files are moved into the CoreVideo framework now.
Either try linking this or follow Dade's proposal to just comment out for now, cause opengl interop is not used anymore ( really ? )
The proper way would be to #if defined (__APPLE__) && ( versioncheck)
cause on 10.12 sdk it still works as expected
Jens
-
- Supporting Users
- Posts: 141
- Joined: Tue Jan 09, 2018 6:48 pm
Re: Mac OS
Its Apple:Dade wrote: ↑Mon Jan 29, 2018 3:26 pmJust run, form LuxCore directory, something like:patrickwalker wrote: ↑Mon Jan 29, 2018 2:59 pm luxCOREconsole and luxcoreui compile and start. Don't have a test file for it ready to go but it compiled and linked so they should work.
There are hundreds of test scenes under the scenes directory.Code: Select all
./bin/luxcoreui scenes/luxball/luxball-hdr.cfg
Code: Select all
./bin/Release/luxcoreui scenes/luxball/luxball-hdr.cfg
Jens
Re: Mac OS
It hasn't been used for years: too many broken drivers released by vendors.jensverwiebe wrote: ↑Mon Jan 29, 2018 3:28 pm Either try linking this or follow Dade's proposal to just comment out for now, cause opengl interop is not used anymore ( really ? )