diff --git a/devel/intel-graphics-compiler/Makefile b/devel/intel-graphics-compiler/Makefile index 8fd612154282..b32c380c8abb 100644 --- a/devel/intel-graphics-compiler/Makefile +++ b/devel/intel-graphics-compiler/Makefile @@ -1,47 +1,52 @@ PORTNAME= intel-graphics-compiler DISTVERSIONPREFIX= igc- -DISTVERSION= 1.0.8744 +DISTVERSION= 1.0.9289 CATEGORIES= devel PKGNAMESUFFIX= -${FLAVOR} +PATCH_SITES= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/ +PATCHFILES+= 99edbf49d7c9.patch:-p1 # clang + MAINTAINER= jbeich@FreeBSD.org COMMENT= Intel Graphics Compiler for OpenCL LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.md ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= only Intel GPUs on x86 are supported BUILD_DEPENDS= vc-intrinsics-${FLAVOR}>=s20210730:devel/vc-intrinsics@${FLAVOR} LIB_DEPENDS= libLLVM-${FLAVOR:S/llvm//}.so:devel/${FLAVOR} \ libopencl-clang.so.${FLAVOR:S/llvm//}:devel/opencl-clang@${FLAVOR} FLAVORS= ${12 11:L:S/^/llvm/} CONFLICTS_INSTALL= ${PORTNAME}-* USES= bison cmake compiler:c++17-lang python:build USE_GITHUB= yes USE_LDCONFIG= yes GH_ACCOUNT= intel +GH_TUPLE= KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-123-g814e728:headers/../SPIRV-Headers \ + KhronosGroup:SPIRV-Tools:v2021.4:tools/../SPIRV-Tools CMAKE_OFF= INSTALL_SPIRVDLL CMAKE_ARGS= -DCMAKE_PREFIX_PATH:PATH="${LOCALBASE}/${FLAVOR}" \ -DIGC_OPTION__LLVM_PREFERRED_VERSION:STRING="${FLAVOR:S/llvm//}" CFLAGS+= -Wno-macro-redefined # __fastcall PLIST_SUB= ARCH_SUFX=${ARCH:S/i386/32/:S/amd//:S/x86_//} post-patch: # lang/python* don't install unsuffixed symlinks @${REINPLACE_CMD} -i .python \ -e '/EXECUTABLE/s/"python"/"${PYTHON_CMD:T}"/' \ -e '/IGC_PYTHON/s/"python"/"${PYTHON_CMD:T}"/' \ ${WRKSRC}/IGC/CMakeLists.txt \ ${WRKSRC}/IGC/BiFModule/linux/CMakeLists.txt # No need to abort on every benign warning enabled by default # Disable debug symbols unless WITH_DEBUG passed via CXXFLAGS @${REINPLACE_CMD} -e 's/"-Werror"//; /-Werror/d' \ -e 's/"-g"//' \ ${WRKSRC}/IGC/CMakeLists.txt .include diff --git a/devel/intel-graphics-compiler/distinfo b/devel/intel-graphics-compiler/distinfo index fe8f08fcdfea..40433876fc3e 100644 --- a/devel/intel-graphics-compiler/distinfo +++ b/devel/intel-graphics-compiler/distinfo @@ -1,3 +1,9 @@ -TIMESTAMP = 1631782238 -SHA256 (intel-intel-graphics-compiler-igc-1.0.8744_GH0.tar.gz) = 1e8ef2dcebb670e7d66de053c2b0c92b8cf8733dae04503bf26dfd7cc798b5ef -SIZE (intel-intel-graphics-compiler-igc-1.0.8744_GH0.tar.gz) = 7586378 +TIMESTAMP = 1635500623 +SHA256 (intel-intel-graphics-compiler-igc-1.0.9289_GH0.tar.gz) = 78fac5e59a0f50253a679d5ed1d66c19c970014ead3510b8b4cfab973015a110 +SIZE (intel-intel-graphics-compiler-igc-1.0.9289_GH0.tar.gz) = 7872553 +SHA256 (KhronosGroup-SPIRV-Headers-1.5.4.raytracing.fixed-123-g814e728_GH0.tar.gz) = e4880dccda018f63cdc684afd5e51972d8ad2e3f21e9bab346a865370ea2929e +SIZE (KhronosGroup-SPIRV-Headers-1.5.4.raytracing.fixed-123-g814e728_GH0.tar.gz) = 416402 +SHA256 (KhronosGroup-SPIRV-Tools-v2021.4_GH0.tar.gz) = d68de260708dda785d109ff1ceeecde2d2ab71142fa5bf59061bb9f47dd3bb2c +SIZE (KhronosGroup-SPIRV-Tools-v2021.4_GH0.tar.gz) = 2887505 +SHA256 (99edbf49d7c9.patch) = c7a96b5629384422ff2d848624ac60d5cc6dffd0289bce430df1ba813a45474c +SIZE (99edbf49d7c9.patch) = 1151 diff --git a/devel/intel-graphics-compiler/files/patch-unix b/devel/intel-graphics-compiler/files/patch-unix index ef8ba7e0a533..41458b19c707 100644 --- a/devel/intel-graphics-compiler/files/patch-unix +++ b/devel/intel-graphics-compiler/files/patch-unix @@ -1,296 +1,296 @@ Relax Linux checks for the code works on any non-Windows platform. CMake Error at IGC/CMakeLists.txt:1974 (message): IGC_OPTION__ARCHITECTURE_TARGET: Target architecture is not specified and cannot be deduced from context. Please specify one, e.g. Windows32, Linux64, Android32, ... --- IGC/cmake/igc_arch_utils.cmake.orig 2021-03-28 09:45:11 UTC +++ IGC/cmake/igc_arch_utils.cmake @@ -48,7 +48,7 @@ function(igc_arch_detect targetArchVarName hostArchVar set(_targetArchitecture "Windows32") endif() # Use system processor set by toolchain or CMake. - elseif(ANDROID OR (CMAKE_SYSTEM_NAME MATCHES "Linux")) + elseif(ANDROID OR (UNIX AND NOT APPLE)) if(ANDROID) set(_targetArchOS "Android") else() @@ -78,7 +78,7 @@ function(igc_arch_detect targetArchVarName hostArchVar set(_hostArchitecture "Windows32") endif() # Use 'uname -m' to detect kernel architecture. - elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") + elseif(UNIX AND NOT APPLE) set(_hostArchOS "Linux") set(_osArchitecture "x86_64") execute_process( --- IGC/CMakeLists.txt.orig 2021-03-28 09:45:11 UTC +++ IGC/CMakeLists.txt @@ -429,7 +429,7 @@ endif() # NOTE: LLVM_ON_UNIX is also true for Android (CMAKE_SYSTEM_NAME specified by Android toolchain file is also "Linux", # but we should make sure so there is no errors in our assumptions). -if((CMAKE_SYSTEM_NAME MATCHES "Linux") OR ANDROID) +if((UNIX AND NOT APPLE) OR ANDROID) set(LLVM_ON_UNIX ON) else() set(LLVM_ON_UNIX OFF) --- 3d/common/iStdLib/File.h.orig 2019-11-27 01:05:20 UTC +++ 3d/common/iStdLib/File.h @@ -105,12 +105,9 @@ inline DWORD GetModuleFileName( char* pFileName, DWORD #elif defined(ISTDLIB_UMD) #if defined(_WIN32) return ::GetModuleFileNameA( NULL, pFileName, bufSize ); - #elif defined(__linux__) + #else //TODO: add Linux implementation. return 0; - #else - // TO DO: replace with non-Windows version - #error "TODO implement non-Windows equivalent of GetModuleFileName" #endif #else // this compilation path is not intended --- 3d/common/iStdLib/Object.h.orig 2019-11-27 01:05:20 UTC +++ 3d/common/iStdLib/Object.h @@ -150,7 +150,7 @@ inline long CObject::Acquire( void ) ASSERT( m_RefCount >= 0 ); ASSERT( m_RefCount < LONG_MAX ); -#if defined(ISTDLIB_MT) && defined(__linux__) +#if defined(ISTDLIB_MT) && defined(__GNUC__) __sync_fetch_and_add(&m_RefCount, 1); #elif defined(ISTDLIB_MT) ::InterlockedIncrement(&m_RefCount); @@ -182,7 +182,7 @@ inline long CObject::Release( void ) { ASSERT( m_RefCount > 0 ); -#if defined(ISTDLIB_MT) && defined(__linux__) +#if defined(ISTDLIB_MT) && defined(__GNUC__) __sync_sub_and_fetch(&m_RefCount, 1); #elif defined(ISTDLIB_MT) ::InterlockedDecrement(&m_RefCount); --- 3d/common/iStdLib/utility.h.orig 2019-11-27 01:05:20 UTC +++ 3d/common/iStdLib/utility.h @@ -431,7 +431,7 @@ __forceinline DWORD bsr64( const unsigned long long in _BitScanReverse64( &index, static_cast<_int64>( mask ) ); return static_cast( index ); -#elif defined __linux__ +#elif defined __GNUC__ return static_cast( 63 - __builtin_clzll( mask ) ); #else @@ -464,7 +464,7 @@ __forceinline DWORD bsr( const DWORD mask ) _BitScanReverse( &index, mask ); return static_cast(index); -#elif defined __linux__ +#elif defined __GNUC__ return static_cast( 31 - __builtin_clz( mask ) ); #else @@ -497,7 +497,7 @@ __forceinline DWORD bsf64( const unsigned long long in _BitScanForward64( &index, static_cast<_int64>( mask ) ); return static_cast( index ); -#elif defined __linux__ +#elif defined __GNUC__ return static_cast( __builtin_ffsll( mask ) - 1 ); #else @@ -529,7 +529,7 @@ __forceinline DWORD bsf( const DWORD mask ) _BitScanForward( &index, mask ); return index; -#elif defined __linux__ +#elif defined __GNUC__ return static_cast( __builtin_ffsl( mask ) - 1 ); #else --- IGC/AdaptorCommon/customApi.cpp.orig 2019-11-27 01:05:20 UTC +++ IGC/AdaptorCommon/customApi.cpp @@ -457,7 +457,7 @@ namespace IGC return ""; IGCBaseFolder = "/sdcard/intel/igc/"; -#elif defined __linux__ +#elif !defined __APPLE__ if (!IGC_IS_FLAG_ENABLED(DumpToCustomDir)) { IGCBaseFolder = "/tmp/IntelIGC/"; @@ -560,7 +560,7 @@ namespace IGC g_shaderOutputFolder = ""; -#elif defined __linux__ +#elif !defined __APPLE__ if (!IGC_IS_FLAG_ENABLED(DumpToCurrentDir) && g_shaderOutputFolder == "" && !IGC_IS_FLAG_ENABLED(DumpToCustomDir)) { bool needMkdir = false; --- IGC/AdaptorOCL/CLElfLib/CLElfTypes.h.orig 2020-05-19 05:44:04 UTC +++ IGC/AdaptorOCL/CLElfLib/CLElfTypes.h @@ -30,7 +30,7 @@ Abstract: Defines the types used for ELF headers/sect \******************************************************************************/ #pragma once -#if defined(__linux__) && defined(OGL) +#if !defined(__APPLE__) && !defined(_WIN32) && defined(OGL) #include "os_inc.h" #endif --- IGC/GenISAIntrinsics/GenIntrinsics.h.orig 2020-02-10 06:06:31 UTC +++ IGC/GenISAIntrinsics/GenIntrinsics.h @@ -67,7 +67,7 @@ namespace GenISAIntrinsic { /// Thus the type array should two elements: /// Type Ts[2]{int2, int2}: to resolve to the first instance. /// Type Ts[2]{int4, int4}: to resolve to the second. -#if defined(ANDROID) || defined(__linux__) +#if defined(__GNUC__) __attribute__ ((visibility ("default"))) Function *getDeclaration(Module *M, ID id, ArrayRef OverloadedTys = None); #else Function *getDeclaration(Module *M, ID id, ArrayRef OverloadedTys = None); --- IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp.orig 2019-11-27 01:05:20 UTC +++ IGC/OCLFE/igd_fcl_mcl/source/clang_tb.cpp @@ -65,9 +65,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #if defined(_WIN32 )|| defined( _WIN64 ) #include #include -#endif - -#if defined __linux__ +#elif !defined(__APPLE__) #include "iStdLib/File.h" #endif @@ -311,7 +309,7 @@ namespace FCL IGCBaseFolder = pathBuf; } -#elif defined __linux__ +#elif !defined(__APPLE__) if (!FCL_IGC_IS_FLAG_ENABLED(DumpToCustomDir)) { IGCBaseFolder = "/tmp/IntelIGC/"; @@ -387,7 +385,7 @@ namespace FCL iSTD::CreateAppOutputDir(pathBuf, 256, GetBaseIGCOutputFolder(), false, true, !FCL_IGC_IS_FLAG_ENABLED(ShaderDumpPidDisable)); g_shaderOutputFolder = pathBuf; } -#elif defined __linux__ +#elif !defined(__APPLE__) if (!FCL_IGC_IS_FLAG_ENABLED(DumpToCurrentDir) && g_shaderOutputFolder == "" && !FCL_IGC_IS_FLAG_ENABLED(DumpToCustomDir)) { bool needMkdir = true; --- IGC/VectorCompiler/lib/Driver/SPIRVWrapper.cpp.orig 2021-04-20 09:14:00 UTC +++ IGC/VectorCompiler/lib/Driver/SPIRVWrapper.cpp @@ -47,7 +47,7 @@ IN THE SOFTWARE. #include "llvm/Support/DynamicLibrary.h" #include "llvm/Support/Path.h" #include "llvm/Support/Process.h" -#if defined(__linux__) +#if !defined(_WIN32) #include #endif // __linux__ #if defined(_WIN32) @@ -171,7 +171,7 @@ Expected getSpirvReadVerifyFunc constexpr char *SpirvReadVerifyName = "spirv_read_verify_module"; const std::string SpirvLibPath = findSpirvDLL(); -#if defined(__linux__) +#if defined(RTLD_DEEPBIND) // Hack to workaround cmoc crashes during loading of SPIRV library static auto DeepBindHack = dlopen(SpirvLibPath.c_str(), RTLD_NOW | RTLD_DEEPBIND); --- IGC/common/LLVMWarningsPop.hpp.orig 2021-05-12 10:04:39 UTC +++ IGC/common/LLVMWarningsPop.hpp @@ -41,6 +41,6 @@ SPDX-License-Identifier: MIT # pragma warning( pop ) #endif -#if defined(__linux__) +#if defined(__GNUC__) # pragma GCC diagnostic pop #endif --- IGC/common/LLVMWarningsPush.hpp.orig 2020-09-16 10:27:28 UTC +++ IGC/common/LLVMWarningsPush.hpp @@ -55,7 +55,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # pragma warning( push ) #endif -#if defined(__linux__) +#if defined(__GNUC__) # pragma GCC diagnostic push # if __GNUC__ > 8 # pragma GCC diagnostic ignored "-Winit-list-lifetime" --- IGC/common/Stats.cpp.orig 2021-03-22 09:55:24 UTC +++ IGC/common/Stats.cpp @@ -1061,7 +1061,7 @@ void TimeStats::printTimeCSV( std::string const& corpu else subFile += IGC::Debug::GetShaderCorpusName(); const std::string outputFilePath = -#if defined(__linux__) +#if !defined(_WIN32) subFile + ".csv"; #else std::string("c:\\Intel\\") + subFile + ".csv"; --- IGC/common/igc_regkeys.hpp.orig 2021-07-18 10:00:28 UTC +++ IGC/common/igc_regkeys.hpp @@ -22,7 +22,7 @@ typedef char debugString[256]; #define IGC_DEBUG_VARIABLES #endif -#if defined(__linux__) +#if !defined(__APPLE__) && !defined(_WIN32) #define IGC_DEBUG_VARIABLES #endif @@ -52,7 +52,7 @@ struct SRegKeyVariableMetaData } }; -#if defined (__linux__) && !defined(_DEBUG) && !defined(_INTERNAL) +#if !defined(_WIN32) && !defined(_DEBUG) && !defined(_INTERNAL) #define LINUX_RELEASE_MODE #endif ---- visa/BuildCISAIRImpl.cpp.orig 2020-09-16 10:27:28 UTC +--- visa/BuildCISAIRImpl.cpp.orig 2021-10-29 09:43:43 UTC +++ visa/BuildCISAIRImpl.cpp -@@ -576,7 +576,6 @@ extern void CISA_delete_buffer(YY_BUFFER_STATE buf); - - int CISA_IR_Builder::ParseVISAText(const std::string& visaHeader, const std::string& visaText, const std::string& visaTextFile) +@@ -925,7 +925,6 @@ static std::mutex mtx; + int CISA_IR_Builder::ParseVISAText(const std::string& visaText, const std::string& visaTextFile) { + const std::lock_guard lock(mtx); -#if defined(__linux__) || defined(_WIN64) || defined(_WIN32) // Direct output of parser to null #if defined(_WIN64) || defined(_WIN32) CISAout = fopen("nul", "w"); -@@ -627,16 +626,11 @@ int CISA_IR_Builder::ParseVISAText(const std::string& +@@ -973,16 +972,11 @@ int CISA_IR_Builder::ParseVISAText(const std::string& } return status; -#else - assert(0 && "vISA asm parsing not supported on this platform"); - return VISA_FAILURE; -#endif } // Parses inline asm file from ShaderOverride int CISA_IR_Builder::ParseVISAText(const std::string& visaFile) { -#if defined(__linux__) || defined(_WIN64) || defined(_WIN32) // Direct output of parser to null #if defined(_WIN64) || defined(_WIN32) CISAout = fopen("nul", "w"); -@@ -662,10 +656,6 @@ int CISA_IR_Builder::ParseVISAText(const std::string& +@@ -1008,10 +1002,6 @@ int CISA_IR_Builder::ParseVISAText(const std::string& fclose(CISAout); } return VISA_SUCCESS; -#else - assert(0 && "Asm parsing not supported on this platform"); - return VISA_FAILURE; -#endif } // default size of the kernel mem manager in bytes