-
Notifications
You must be signed in to change notification settings - Fork 64
MacOS #488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AnastaZIuk
wants to merge
24
commits into
master
Choose a base branch
from
MacOSX
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
MacOS #488
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
453bb2d
add macos-clang PLATFORM given apple clang compiler vendor to CMake
c4a41b4
Correct dxc's CMakeLists file in order to cover non multi generators,…
AnastaZIuk df32b15
remove x86 processor specific compile flags added without respect to …
AnastaZIuk dece03a
generate endian.h and byteswap.h patch headers on fly for AppleClang …
AnastaZIuk 0039960
force x86_64 arch builds for all APPLE devices
AnastaZIuk ff275de
Merge branch 'newBuiltinResources' of github.com:Devsh-Graphics-Progr…
AnastaZIuk afe16f6
turn explicit instantiation definition in builtin resources auto-gene…
devshgraphicsprogrammingjenkins b4b7d9e
add standalone boost math library in order to patch Nabla for MacOS b…
AnastaZIuk 76e4662
Force Xcode legacy build system in order to work with Nabla, add vali…
AnastaZIuk 50e657d
fix oneDPL & oneTBB Nabla build system and make it work on MacOS with…
AnastaZIuk 7a6de70
bring back installation of tbb targets and coditionally handle tbbmal…
AnastaZIuk 3d4c2c3
fix dependent type errors, add some copy constructor with assignment …
AnastaZIuk 1f024e5
Add CSystemMacOS source and header file, update Nabla codebase with M…
AnastaZIuk b9c830e
eliminate last errors and compile Nabla on MacOS with AppleClang and …
AnastaZIuk e43df25
updated .gitmodules to use DevshGraphicsProgramming forks and SSH
Hazardu 1f8548a
pull master & resolve conflicts
AnastaZIuk 0101507
second pull from remote & resolve conflicts
AnastaZIuk 5752d7e
Delete 3rdparty/boost/standalone directory
AnastaZIuk e7bef08
Refactor submodule.update.cmake & do not use proxy scripts anymore, s…
AnastaZIuk f22f391
Merge branch 'MacOSX' of github.com:Devsh-Graphics-Programming/Nabla …
AnastaZIuk e2067c2
make NBL_FORCE_ON_UPDATE_GIT_SUBMODULE truely wipe-all thing
AnastaZIuk e08ee2c
make this configure again
AnastaZIuk e7bfe9e
make it generate on my MacOS Air M2 (cross-compile to x86_64)
AnastaZIuk edb3c8d
silent all warnings regarding flags & definitions, add apple-clang.cm…
AnastaZIuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,67 @@ | ||
if(NBL_BUILD_DPL AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # only non-multi-generators and clang ifsupported | ||
get_filename_component(CCBD_ABSOLUTE "${CMAKE_CURRENT_BINARY_DIR}" ABSOLUTE) | ||
|
||
if (NBL_BUILD_DPL) | ||
set(_NBL_BUILD_DPL_ ${NBL_BUILD_DPL}) | ||
endif() | ||
|
||
set(TBB_INSTALL_VARS ON CACHE BOOL "" FORCE) | ||
set(TBB_TEST OFF CACHE BOOL "" FORCE) | ||
set(TBB_STRICT ON CACHE BOOL "" FORCE) | ||
set(PREVIOUS_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) | ||
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) | ||
set(TBB_SANITIZE "" CACHE STRING "" FORCE) | ||
add_subdirectory(oneTBB oneTBB EXCLUDE_FROM_ALL) | ||
|
||
if(PREVIOUS_BUILD_SHARED_LIBS) | ||
set(BUILD_SHARED_LIBS ${PREVIOUS_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE) | ||
else() | ||
unset(BUILD_SHARED_LIBS CACHE) | ||
endif() | ||
|
||
set(ONETBB_BUILD ${CCBD_ABSOLUTE}/oneTBB) | ||
set(ONETBB_INSTALL_DIR ${ONETBB_BUILD}/install CACHE STRING "oneTBB install directory" FORCE) | ||
|
||
add_custom_target(onetbb_build | ||
COMMAND ${CMAKE_COMMAND} --install ${ONETBB_BUILD} --component devel -v --config $<CONFIG> --prefix ${ONETBB_INSTALL_DIR} | ||
COMMAND ${CMAKE_COMMAND} --install ${ONETBB_BUILD} --component runtime -v --config $<CONFIG> --prefix ${ONETBB_INSTALL_DIR} | ||
DEPENDS tbb tbbmalloc tbbmalloc_proxy | ||
COMMENT "Building oneTBB..." | ||
) | ||
|
||
set(ONEDPL_BUILD ${CCBD_ABSOLUTE}/oneDPL/build) | ||
set(ONEDPL_INSTALL_DIR ${ONEDPL_BUILD}/install CACHE STRING "oneDPL install directory" FORCE) | ||
|
||
set(CMAKE_ARGS_ONEDPL | ||
-DCMAKE_BUILD_TYPE:STRING=$<CONFIG> | ||
-DONETBB_INSTALL_DIR:PATH=${ONETBB_INSTALL_DIR} | ||
get_filename_component(CCBD_ABSOLUTE "${CMAKE_CURRENT_BINARY_DIR}" ABSOLUTE) | ||
|
||
set(_NBL_BUILD_DPL_ ON CACHE BOOL "") | ||
|
||
set(TBB_INSTALL_VARS ON CACHE BOOL "" FORCE) | ||
set(TBB_TEST OFF CACHE BOOL "" FORCE) | ||
set(TBB_STRICT ON CACHE BOOL "" FORCE) | ||
set(PREVIOUS_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS}) | ||
set(BUILD_SHARED_LIBS ON CACHE BOOL "" FORCE) | ||
set(TBB_SANITIZE "" CACHE STRING "" FORCE) | ||
|
||
add_subdirectory(oneTBB oneTBB EXCLUDE_FROM_ALL) | ||
target_compile_options(tbb PUBLIC | ||
-Wno-conversion | ||
) | ||
|
||
if(PREVIOUS_BUILD_SHARED_LIBS) | ||
set(BUILD_SHARED_LIBS ${PREVIOUS_BUILD_SHARED_LIBS} CACHE BOOL "" FORCE) | ||
else() | ||
unset(BUILD_SHARED_LIBS CACHE) | ||
endif() | ||
|
||
set(ONETBB_BUILD ${CCBD_ABSOLUTE}/oneTBB) | ||
set(ONETBB_INSTALL_DIR ${ONETBB_BUILD}/install CACHE STRING "oneTBB install directory" FORCE) | ||
|
||
add_custom_target(onetbb_build | ||
COMMAND ${CMAKE_COMMAND} --install ${ONETBB_BUILD} --component devel -v --config $<CONFIG> --prefix ${ONETBB_INSTALL_DIR} | ||
COMMAND ${CMAKE_COMMAND} --install ${ONETBB_BUILD} --component runtime -v --config $<CONFIG> --prefix ${ONETBB_INSTALL_DIR} | ||
COMMENT "Building oneTBB..." | ||
) | ||
add_dependencies(onetbb_build tbb tbbmalloc) | ||
|
||
if(NOT (APPLE AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")) | ||
add_dependencies(onetbb_build tbbmalloc_proxy) | ||
endif() | ||
|
||
set(ONEDPL_BUILD ${CCBD_ABSOLUTE}/oneDPL/build) | ||
set(ONEDPL_INSTALL_DIR ${ONEDPL_BUILD}/install CACHE STRING "oneDPL install directory" FORCE) | ||
|
||
set(CMAKE_ARGS_ONEDPL | ||
-DCMAKE_BUILD_TYPE:STRING=$<CONFIG> | ||
-DONETBB_INSTALL_DIR:PATH=${ONETBB_INSTALL_DIR} | ||
) | ||
|
||
if(ANDROID) | ||
list(APPEND CMAKE_ARGS_ONEDPL | ||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} | ||
-DANDROID_ABI:STRING=${ANDROID_ABI} | ||
-DANDROID_PLATFORM:STRING=${ANDROID_PLATFORM} | ||
) | ||
|
||
if(ANDROID) | ||
list(APPEND CMAKE_ARGS_ONEDPL | ||
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} | ||
-DANDROID_ABI:STRING=${ANDROID_ABI} | ||
-DANDROID_PLATFORM:STRING=${ANDROID_PLATFORM} | ||
) | ||
endif() | ||
|
||
ExternalProject_Add(oneDPL | ||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/oneDPL | ||
BINARY_DIR ${ONEDPL_BUILD} | ||
CMAKE_ARGS ${CMAKE_ARGS_ONEDPL} | ||
BUILD_COMMAND cmake --build ${ONEDPL_BUILD} | ||
INSTALL_COMMAND cmake --install ${ONEDPL_BUILD} --prefix ${ONEDPL_INSTALL_DIR} | ||
USES_TERMINAL_BUILD 1 | ||
COMMENT "Building oneDPL..." | ||
elseif(APPLE) | ||
list(APPEND CMAKE_ARGS_ONEDPL | ||
"-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}" | ||
) | ||
|
||
add_dependencies(oneDPL onetbb_build) | ||
endif() | ||
endif() | ||
|
||
ExternalProject_Add(oneDPL | ||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/oneDPL | ||
BINARY_DIR ${ONEDPL_BUILD} | ||
CMAKE_ARGS ${CMAKE_ARGS_ONEDPL} | ||
BUILD_COMMAND cmake --build ${ONEDPL_BUILD} --config $<CONFIG> | ||
INSTALL_COMMAND cmake --install ${ONEDPL_BUILD} --config $<CONFIG> -v --prefix ${ONEDPL_INSTALL_DIR} | ||
USES_TERMINAL_BUILD 1 | ||
COMMENT "Building oneDPL..." | ||
) | ||
|
||
add_dependencies(oneDPL onetbb_build) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/toolchains/android/build.cmake) | ||
cmake_minimum_required(VERSION 3.26) | ||
|
||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
if(NOT DEFINED ONETBB_INSTALL_DIR) | ||
message(FATAL_ERROR "oneDPL submodule requires valid ONETBB_INSTALL_DIR!") | ||
endif() | ||
|
||
set(TBB_DIR ${ONETBB_INSTALL_DIR}/lib/cmake/TBB CACHE INTERNAL "" FORCE) | ||
set(ONEDPL_BACKEND tbb CACHE STRING "" FORCE) | ||
add_subdirectory(oneDPL oneDPL) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
if(ANDROID) | ||
add_compile_options( | ||
$<$<CONFIG:DEBUG>:-glldb> | ||
) | ||
endif() | ||
endif() | ||
# assume built-in pthreads on MacOS | ||
if(APPLE) | ||
set(CMAKE_THREAD_LIBS_INIT "-lpthread") | ||
set(CMAKE_HAVE_THREADS_LIBRARY 1) | ||
set(CMAKE_USE_WIN32_THREADS_INIT 0) | ||
set(CMAKE_USE_PTHREADS_INIT 1) | ||
set(THREADS_PREFER_PTHREAD_FLAG ON CACHE BOOL "") | ||
endif() | ||
|
||
if(ANDROID) | ||
include(${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/toolchains/android/build.cmake) | ||
endif() | ||
|
||
if(NOT DEFINED ONETBB_INSTALL_DIR) | ||
message(FATAL_ERROR "oneDPL submodule requires valid ONETBB_INSTALL_DIR!") | ||
endif() | ||
|
||
set(TBB_DIR ${ONETBB_INSTALL_DIR}/lib/cmake/TBB CACHE INTERNAL "" FORCE) | ||
set(ONEDPL_BACKEND tbb CACHE STRING "" FORCE) | ||
set(CMAKE_FIND_USE_CMAKE_SYSTEM_PATH ON CACHE BOOL "") | ||
set(ONE_DPL_INSTALL_OVERRIDE "${CMAKE_CURRENT_BINARY_DIR}/output" CACHE STRING "" FORCE) | ||
find_package(Threads REQUIRED) | ||
|
||
add_subdirectory(oneDPL oneDPL) | ||
Comment on lines
+19
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so you need to compile OneDPL for AppleClang to support parallel execution policies? |
||
|
||
if(ANDROID) | ||
add_compile_options( | ||
$<$<CONFIG:DEBUG>:-glldb> | ||
) | ||
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,21 @@ | |
# For conditions of distribution and use, see copyright notice in nabla.h.in or nabla.h | ||
|
||
cmake_minimum_required(VERSION 3.29) | ||
cmake_policy(SET CMP0042 NEW) | ||
cmake_policy(SET CMP0112 NEW) | ||
cmake_policy(SET CMP0141 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0141.html#policy:CMP0141 | ||
cmake_policy(SET CMP0118 NEW) # https://cmake.org/cmake/help/latest/policy/CMP0118.html#policy:CMP0118 | ||
|
||
if(APPLE) | ||
set(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "" FORCE) | ||
|
||
if("${CMAKE_GENERATOR}" STREQUAL "Xcode") | ||
if(NOT "${CMAKE_GENERATOR_TOOLSET}" STREQUAL "buildsystem=1") | ||
message("Nabla build isn't supported with new Xcode buildsystem, you must specify CMake generator toolset as '-T buildsystem=1' in order to use legacy Xcode build system") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. whats the new Xcode buildsystem? |
||
endif() | ||
endif() | ||
endif() | ||
|
||
set(NBL_BUILD_ANDROID OFF) | ||
|
||
include(ExternalProject) | ||
|
@@ -30,14 +41,13 @@ endif() | |
if(NBL_STATIC_BUILD) | ||
message(STATUS "Static Nabla build enabled!") | ||
else() | ||
# TODO: needs correcting those checks | ||
if(WIN32 AND MSVC) | ||
if(NBL_DYNAMIC_MSVC_RUNTIME) | ||
message(STATUS "Shared Nabla build enabled!") | ||
else() | ||
message(FATAL_ERROR "Turn NBL_DYNAMIC_MSVC_RUNTIME on! For dynamic Nabla builds dynamic MSVC runtime is mandatory!") | ||
endif() | ||
else() | ||
message(FATAL_ERROR "Nabla can't be built with shared libraries! Please make sure you are targetting Windows OS and MSVC compiler!") | ||
endif() | ||
endif() | ||
|
||
|
@@ -148,6 +158,8 @@ if(WIN32) | |
set(_NBL_PLATFORM_WINDOWS_ 1) | ||
elseif(ANDROID) | ||
set(_NBL_PLATFORM_ANDROID_ 1) | ||
elseif(APPLE) | ||
set(_NBL_PLATFORM_MACOS_ 1) | ||
elseif(UNIX) | ||
set(_NBL_PLATFORM_LINUX_ 1) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1") | ||
|
@@ -159,6 +171,9 @@ else() | |
set(_NBL_SHARED_BUILD_ ON CACHE INTERNAL "") | ||
endif() | ||
|
||
#uncomment in the future | ||
#option(NBL_TARGET_ARCH_ARM "Build for ARM?" OFF) | ||
|
||
option(NBL_BUILD_DPL "Enable DPL (Dynamic Parallelism Library)" OFF) | ||
option(NBL_PCH "Enable pre-compiled header" ON) | ||
option(NBL_FAST_MATH "Enable fast low-precision math" ON) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both ARM and x86 are little-endian
we're not going to support PowerPC cause its freaking ancient
what dependency even needs this?