-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
oneTBB has support for building on ARM64 Signed-off-by: Michael Jackson <[email protected]>
- Loading branch information
1 parent
9c3078c
commit 51f063d
Showing
3 changed files
with
126 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#-------------------------------------------------------------------------------------------------- | ||
# Are we building oneTBB (ON by default) | ||
#-------------------------------------------------------------------------------------------------- | ||
option(BUILD_oneTBB "Build oneTBB" ON) | ||
if(NOT BUILD_oneTBB) | ||
return() | ||
endif() | ||
|
||
set(extProjectName "oneTBB") | ||
set(oneTBB_GIT_TAG "v2021.5.0") | ||
set(oneTBB_VERSION "2021.5.0" CACHE STRING "") | ||
message(STATUS "Building: ${extProjectName} ${oneTBB_VERSION}: -DBUILD_oneTBB=${BUILD_oneTBB}") | ||
|
||
if (CMAKE_GENERATOR MATCHES "Visual Studio") | ||
set(oneTBB_INSTALL "${EMsoft_SDK}/${extProjectName}-${oneTBB_VERSION}") | ||
else() | ||
set(oneTBB_INSTALL "${EMsoft_SDK}/${extProjectName}-${oneTBB_VERSION}-${CMAKE_BUILD_TYPE}") | ||
endif() | ||
|
||
if(NX_USE_CUSTOM_DOWNLOAD_SITE) | ||
set(EP_SOURCE_ARGS | ||
DOWNLOAD_NAME ${extProjectName}-${oneTBB_VERSION}.zip | ||
URL ${NX_CUSTOM_DOWNLOAD_URL_PREFIX}${extProjectName}-${oneTBB_VERSION}.zip | ||
) | ||
else() | ||
set(EP_SOURCE_ARGS | ||
GIT_REPOSITORY "https://github.com/oneapi-src/onetbb" | ||
GIT_PROGRESS 1 | ||
GIT_TAG ${oneTBB_GIT_TAG} | ||
) | ||
endif() | ||
|
||
IF (DARWIN_VERSION GREATER 19) | ||
get_filename_component(_self_dir ${CMAKE_CURRENT_LIST_FILE} PATH) | ||
|
||
configure_file( | ||
"${_self_dir}/patches/oneTBB/AppleClang.cmake" | ||
"${EMsoft_SDK}/superbuild/${extProjectName}-${oneTBB_VERSION}/Source/cmake/compilers/AppleClang.cmake" | ||
@ONLY | ||
) | ||
endif() | ||
|
||
ExternalProject_Add(${extProjectName} | ||
${EP_SOURCE_ARGS} | ||
|
||
TMP_DIR "${EMsoft_SDK}/superbuild/${extProjectName}-${oneTBB_VERSION}/tmp/${CMAKE_BUILD_TYPE}" | ||
STAMP_DIR "${EMsoft_SDK}/superbuild/${extProjectName}-${oneTBB_VERSION}/Stamp" | ||
DOWNLOAD_DIR ${EMsoft_SDK}/superbuild/${extProjectName}-${oneTBB_VERSION}/Download | ||
SOURCE_DIR "${EMsoft_SDK}/superbuild/${extProjectName}-${oneTBB_VERSION}/Source" | ||
BINARY_DIR "${EMsoft_SDK}/superbuild/${extProjectName}-${oneTBB_VERSION}/Build/${CMAKE_BUILD_TYPE}" | ||
INSTALL_DIR "${oneTBB_INSTALL}" | ||
|
||
CMAKE_ARGS | ||
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} | ||
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | ||
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> | ||
|
||
-DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET} | ||
-DCMAKE_OSX_SYSROOT=${OSX_SDK} | ||
-DCMAKE_CXX_STANDARD_REQUIRED=ON | ||
-DTBB_TEST:BOOL=OFF | ||
|
||
LOG_DOWNLOAD 1 | ||
LOG_UPDATE 1 | ||
LOG_CONFIGURE 1 | ||
LOG_BUILD 1 | ||
LOG_TEST 1 | ||
LOG_INSTALL 1 | ||
) | ||
|
||
#-- Append this information to the EMsoft_SDK CMake file that helps other developers | ||
#-- configure DREAM3D for building | ||
file(APPEND ${EMsoft_SDK_FILE} "\n") | ||
file(APPEND ${EMsoft_SDK_FILE} "#--------------------------------------------------------------------------------------------------\n") | ||
file(APPEND ${EMsoft_SDK_FILE} "# oneTBB\n") | ||
if (CMAKE_GENERATOR MATCHES "Visual Studio") | ||
file(APPEND ${EMsoft_SDK_FILE} "set(TBB_DIR \"\${EMsoft_SDK_ROOT}/${extProjectName}-${oneTBB_VERSION}/lib/cmake/TBB\" CACHE PATH \"\")\n") | ||
else() | ||
file(APPEND ${EMsoft_SDK_FILE} "set(TBB_DIR \"\${EMsoft_SDK_ROOT}/${extProjectName}-${oneTBB_VERSION}-\${BUILD_TYPE}/lib/cmake/TBB\" CACHE PATH \"\")\n") | ||
endif() | ||
file(APPEND ${EMsoft_SDK_FILE} "set(CMAKE_MODULE_PATH \${CMAKE_MODULE_PATH} \${TBB_DIR})\n") | ||
file(APPEND ${EMsoft_SDK_FILE} "set(TBB_VERSION \"${oneTBB_VERSION}\" CACHE STRING \"\")\n") |
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright (c) 2020-2021 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,) | ||
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH}) | ||
# set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror>) | ||
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor) | ||
set(TBB_WARNING_SUPPRESS -Wno-parentheses -Wno-non-virtual-dtor -Wno-dangling-else) | ||
# For correct ucontext.h structures layout | ||
set(TBB_COMMON_COMPILE_FLAGS -D_XOPEN_SOURCE) | ||
|
||
# Depfile options (e.g. -MD) are inserted automatically in some cases. | ||
# Don't add -MMD to avoid conflicts in such cases. | ||
if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER) | ||
set(TBB_MMD_FLAG -MMD) | ||
endif() | ||
|
||
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled. | ||
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag) | ||
tbb_remove_compile_flag(-Werror) | ||
endif() | ||
|
||
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) on relevant processors | ||
if (NOT "${CMAKE_OSX_ARCHITECTURES}" MATCHES "^arm64$" AND CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64|AMD64)") # OSX systems are 64-bit only | ||
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm) | ||
endif() | ||
|
||
# TBB malloc settings | ||
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions) | ||
|