Skip to content

Commit

Permalink
Merge pull request #216 from johnhaddon/m1MurrayPlus
Browse files Browse the repository at this point in the history
Apple Silicon fixes
  • Loading branch information
johnhaddon authored Jun 17, 2022
2 parents a2cdd30 + 8bb0bda commit 74e26ae
Show file tree
Hide file tree
Showing 23 changed files with 197 additions and 30 deletions.
22 changes: 21 additions & 1 deletion Appleseed/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
" -D USE_EXTERNAL_XERCES=ON"
" -D USE_EXTERNAL_OSL=ON"
" -D USE_EXTERNAL_OIIO=ON"
" -D USE_SSE=ON"
" {sseArguments}"
" -D WARNINGS_AS_ERRORS=OFF"
" -D CMAKE_PREFIX_PATH={buildDir}"
" -D CMAKE_INSTALL_PREFIX={buildDir}/appleseed"
Expand Down Expand Up @@ -106,4 +106,24 @@

],

"platform:linux" : {

"variables" : {

"sseArguments" : "-D USE_SSE=ON",

},

},

"platform:macos" : {

"variables" : {

"sseArguments" : "-D USE_SSE=OFF",

},

},

}
33 changes: 33 additions & 0 deletions Appleseed/patches/arm64.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--- a/src/appleseed/foundation/platform/system.cpp 2021-12-04 10:55:14.000000000 -0800
+++ b/src/appleseed/foundation/platform/system.cpp 2021-12-04 10:53:42.000000000 -0800
@@ -70,7 +70,12 @@
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/types.h>
+
+ #ifdef APPLESEED_X86
+
#include <cpuid.h>
+
+ #endif

// Linux.
#elif defined __linux__
@@ -269,6 +274,8 @@

namespace
{
+ #ifdef APPLESEED_X86
+
// EAX is set to the value of `index`. Results are returned in `cpuinfo`:
// cpuinfo[0] == EAX
// cpuinfo[1] == EBX
@@ -292,6 +299,8 @@
return (static_cast<uint64>(edx) << 32) | eax;
}

+ #endif
+
size_t get_system_value(const char* name)
{
size_t value = 0;
21 changes: 21 additions & 0 deletions Appleseed/patches/boost.patch
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,24 @@
return true;
}
catch (const std::exception& e) // namespace qualification required

--- a/src/appleseed/renderer/modeling/project/projectfilewriter.cpp 2019-08-31 08:49:01.000000000 -0700
+++ b/src/appleseed/renderer/modeling/project/projectfilewriter.cpp 2022-05-01 09:47:34.000000000 -0700
@@ -125,7 +125,7 @@
const char* filepath,
FILE* file,
const int options)
- : m_project_new_root_dir(filesystem::path(filepath).parent_path())
+ : m_project_new_root_dir(bf::path(filepath).parent_path())
, m_file(file)
, m_options(options)
, m_indenter(4)
@@ -152,7 +152,7 @@
}

private:
- const filesystem::path m_project_new_root_dir;
+ const bf::path m_project_new_root_dir;
FILE* m_file;
const int m_options;
Indenter m_indenter;
2 changes: 1 addition & 1 deletion Blosc/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://github.com/Blosc/c-blosc/archive/1.15.1.tar.gz"
"https://github.com/Blosc/c-blosc/archive/refs/tags/v1.21.1.tar.gz"

],

Expand Down
2 changes: 1 addition & 1 deletion CMark/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://github.com/github/cmark/archive/0.28.3.gfm.12.tar.gz",
"https://github.com/github/cmark-gfm/archive/refs/tags/0.29.0.gfm.2.tar.gz",

],

Expand Down
10 changes: 10 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
5.x.x (relative to 5.0.0a4)
-----

- Blosc : Updated to 1.21.1.
- OpenVDB : Updated to version 9.1.0, and added `nanovdb`.
- CMark : Updated to 0.29.0.
- HDF5 : Updated to 1.12.0.
- LibFFI : Updated to 3.4.2.
- LibPNG : Updated to 1.6.37.
- OpenSSL : Updated to 1.1.1i.
- Qt : Updated to 5.15.4.
- PySide : Updated to 5.15.4.
- Python : Updated to 3.8.13 (MacOS only).
- Cortex : Updated to 10.4.0.0a6.

5.0.0a4 (relative to 5.0.0a3)
-------
Expand Down
30 changes: 24 additions & 6 deletions Cortex/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://github.com/ImageEngine/cortex/archive/refs/tags/10.4.0.0a4.tar.gz"
"https://github.com/ImageEngine/cortex/archive/refs/tags/10.4.0.0a6.tar.gz"

],

Expand All @@ -25,12 +25,10 @@

"commands" : [

"scons install installDoc"
"scons install"
" -j {jobs}"
" CXX=`which g++`"
# \todo We should be using `c++Standard` here, but Cortex is
# still using `std::random_shuffle` which is deprecated in C++17.
" CXXSTD=c++14"
" CXXSTD=c++{c++Standard}"
" INSTALL_PREFIX={buildDir}"
" INSTALL_DOC_DIR={buildDir}/doc/cortex"
" INSTALL_RMANPROCEDURAL_NAME={buildDir}/renderMan/procedurals/iePython"
Expand Down Expand Up @@ -60,6 +58,7 @@
" USD_LIB_PREFIX=usd_"
" ENV_VARS_TO_IMPORT='LD_LIBRARY_PATH TERM'"
" OPTIONS=''"
" {extraArgs}"
" SAVE_OPTIONS=gaffer.options",

# Symlink for RenderMan, which uses a different convention to 3Delight.
Expand All @@ -77,8 +76,27 @@
"glsl/IECoreGL",
"glsl/*.frag",
"glsl/*.vert",
"doc/cortex/html",

],

"variables" : {

"extraArgs" : "",

},

"platform:macos" : {

"variables" : {

# On Mac, `python3-config --ldflags` is broken, so we specify the flags explicitly.
"extraArgs" :
" PYTHON_LIB_PATH={buildDir}/lib/Python.framework/Versions/{pythonVersion}/lib"
" PYTHON_LINK_FLAGS=-lpython{pythonVersion}"

},

},


}
12 changes: 12 additions & 0 deletions Cycles/patches/metalFoundation.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--- a/src/device/CMakeLists.txt 2022-04-06 12:11:18.000000000 -0700
+++ b/src/device/CMakeLists.txt 2022-05-07 12:38:45.000000000 -0700
@@ -187,6 +187,9 @@
list(APPEND LIB
${METAL_LIBRARY}
)
+ list(APPEND LIB
+ "-framework Foundation"
+ )
add_definitions(-DWITH_METAL)
list(APPEND SRC
${SRC_METAL}
2 changes: 1 addition & 1 deletion HDF5/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/hdf5-1.8.20/src/hdf5-1.8.20.tar.gz"
"https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz"

],

Expand Down
1 change: 1 addition & 0 deletions LLVM/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
" -DGCC_INSTALL_PREFIX={compilerRoot}"
" -DCMAKE_BUILD_TYPE=Release"
" -DLLVM_ENABLE_RTTI=ON"
" -DLLVM_ENABLE_LIBXML2=OFF"
" ..",
"cd build && make install -j {jobs}"

Expand Down
2 changes: 1 addition & 1 deletion LibFFI/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://github.com/libffi/libffi/releases/download/v3.3/libffi-3.3.tar.gz"
"https://github.com/libffi/libffi/releases/download/v3.4.2/libffi-3.4.2.tar.gz"

],

Expand Down
2 changes: 1 addition & 1 deletion LibPNG/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://download.sourceforge.net/libpng/libpng-1.6.3.tar.gz"
"https://download.sourceforge.net/libpng/libpng-1.6.37.tar.gz"

],

Expand Down
2 changes: 1 addition & 1 deletion OpenColorIO/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@

},

"platform:osx" : {
"platform:macos" : {

"variables" : {

Expand Down
4 changes: 2 additions & 2 deletions OpenSSL/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://www.openssl.org/source/openssl-1.1.1h.tar.gz",
"https://www.openssl.org/source/openssl-1.1.1i.tar.gz",

],

Expand All @@ -25,7 +25,7 @@

],

"platform:osx" : {
"platform:macos" : {

"environment" : {

Expand Down
3 changes: 2 additions & 1 deletion OpenShadingLanguage/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@

"license" : "LICENSE.md",

"dependencies" : [ "OpenImageIO", "LLVM", "PugiXML" ],
"dependencies" : [ "OpenImageIO", "LLVM", "PugiXML", "Python" ],

"environment" : {

# Needed because the build process runs oslc, which
# needs to link to the OIIO libraries.
"DYLD_FALLBACK_LIBRARY_PATH" : "{buildDir}/lib",
"LD_LIBRARY_PATH" : "{buildDir}/lib",
"PATH" : "{buildDir}/bin:$PATH",

},

Expand Down
9 changes: 5 additions & 4 deletions OpenShadingLanguage/patches/llvmCompileFlagsMac.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/src/liboslexec/CMakeLists.txt
+++ b/src/liboslexec/CMakeLists.txt
@@ -88,15 +88,11 @@
@@ -88,15 +88,12 @@
# LLVM/libc++ installed -- for some reason, LLVM 3.4 wasn't finding it,
# so in that specific case, append another -I to point it in the right
# direction.
Expand All @@ -14,10 +14,11 @@
- # endif ()
- #endif ()
+ if (APPLE)
+ if ((EXISTS "/Library/Developer/CommandLineTools/usr/include/c++/v1"))
+ set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-I/Library/Developer/CommandLineTools/usr/include/c++/v1")
+ if ((EXISTS "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"))
+ set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1")
+ set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include")
+ endif ()
+ endif ()

list (TRANSFORM IMATH_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
4 changes: 2 additions & 2 deletions PySide/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.3-src/pyside-setup-opensource-src-5.15.3.tar.xz"
"https://download.qt.io/official_releases/QtForPython/pyside2/PySide2-5.15.4-src/pyside-setup-opensource-src-5.15.4.tar.xz"

],

Expand Down Expand Up @@ -35,7 +35,7 @@

},

"platform:osx" : {
"platform:macos" : {

"environment" : {

Expand Down
23 changes: 22 additions & 1 deletion Python/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,37 @@

},

"platform:osx" : {
"platform:macos" : {

# Python 3.7 doesn't compile for M1, so we use 3.8 on Mac until
# we upgrade all platforms to a mutually compatible version. We
# don't support the Python 2 variant at all on Mac.
"downloads" : [

"https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tar.xz",

],

"variables" : {

"libraryType" : "--enable-framework={buildDir}/lib",

},

"environment" : {

"MACOSX_DEPLOYMENT_TARGET" : "11.0",

},

"publicVariables" : {

# See `downloads`.
"pythonVersion" : "3.8",
"pythonABIVersion" : "3.8m",
"pythonMajorVersion" : "3",
"pythonMinorVersion" : "8",

"pythonIncludeDir" : "{buildDir}/lib/Python.framework/Headers",
"pythonLibDir" : "{buildDir}/lib/Python.framework/Versions/{pythonVersion}/lib",

Expand Down
7 changes: 4 additions & 3 deletions Qt/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"downloads" : [

"https://download.qt.io/official_releases/qt/5.15/5.15.3/single/qt-everywhere-opensource-src-5.15.3.tar.xz"
"https://download.qt.io/official_releases/qt/5.15/5.15.4/single/qt-everywhere-opensource-src-5.15.4.tar.xz"

],

Expand Down Expand Up @@ -31,6 +31,7 @@
" -skip qtwebengine"
" -skip qt3d"
" -skip qtdeclarative"
" -skip qttools"
" -skip qtwebchannel"
" -no-libudev"
" -no-icu"
Expand Down Expand Up @@ -80,11 +81,11 @@

},

"platform:osx" : {
"platform:macos" : {

"variables" : {

"extraArgs" : "-no-freetype",
"extraArgs" : "-no-freetype QMAKE_APPLE_DEVICE_ARCHS=arm64",

},

Expand Down
Loading

0 comments on commit 74e26ae

Please sign in to comment.