I have no idea. I hard-coded libiomp5 because that’s the one included in darwin
libs and the default used by the also included clang-omp-3.5.
Official clang 3.7 uses libgomp as default and 3.8 uses libomp.
iomp5 is hard-coded on several places, it’s just not hard-coded on the lines I
had to modify because -fopenmp seems to assume libiomp5 in clang-omp-3.5 so
it’s not needed:
CMakeLists.txt 1428set(CMAKE_REQUIRED_FLAGS "-L${LIBDIR}/openmp/lib
-liomp5") # these are only used for the checks
build_files/cmake/platform/platform_apple.cmake 390
${LIBDIR}/openmp/lib/libiomp5.dylib
build_files/cmake/platform/platform_apple.cmake 391
${CMAKE_BINARY_DIR}/Resources/lib/libiomp5.dylib)
source/creator/CMakeLists.txt 981 FILES
${LIBDIR}/openmp/lib/libiomp5.dylib
source/creator/CMakeLists.txt 987 RENAME LICENSE-libiomp5.txt
source/creator/CMakeLists.txt 1076FILES
${LIBDIR}/openmp/lib/libiomp5.dylib
On 29 Aug 2016, at 09:03, Sergey Sharybin wrote:
> Hi,
>
> Is it possible to somehow automatically detect which OpenMP library to use
> without need to hard-code it per-compiler-version? Maybe using try_compile
> CMake trickery?
>
> On Sun, Aug 28, 2016 at 8:37 PM, Francesc Juhe wrote:
>
>> I run a few tests regarding clang and omp after installing OSX 10.11 and
>> Xcode 7.3.1.
>>
>> It seems that clang-omp-3.5 from libs can’t compile using OSX 10.11 SDK.
>>
>> So, I downloaded clang 3.7.0 and 3.8.0 darwin binaries from official page
>> and both compile blender ok after a minor modification on cmake.
>>
>> diff --git a/build_files/cmake/platform/platform_apple.cmake
>> b/build_files/cmake/platform/platform_apple.cmake
>> index b28b748..ec40400 100644
>> --- a/build_files/cmake/platform/platform_apple.cmake
>> +++ b/build_files/cmake/platform/platform_apple.cmake
>> @@ -376,8 +376,13 @@ if(WITH_OPENMP)
>>message(STATUS "Using special OpenMP enabled compiler !")
>> # letting find_package(OpenMP) module work for gcc
>>if(CMAKE_C_COMPILER_ID MATCHES "Clang") # clang-omp in
>> darwin libs
>>set(OPENMP_FOUND ON)
>> - set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING "C
>> compiler flags for OpenMP parallization" FORCE)
>> - set(OpenMP_CXX_FLAGS "-fopenmp" CACHE STRING "C++
>> compiler flags for OpenMP parallization" FORCE)
>> + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.7)
>> + set(OpenMP_C_FLAGS "-fopenmp" CACHE STRING
>> "C compiler flags for OpenMP parallization" FORCE)
>> + set(OpenMP_CXX_FLAGS "-fopenmp" CACHE
>> STRING "C++ compiler flags for OpenMP parallization" FORCE)
>> + else()
>> + set(OpenMP_C_FLAGS "-fopenmp=libiomp5"
>> CACHE STRING "C compiler flags for OpenMP parallization" FORCE)
>> + set(OpenMP_CXX_FLAGS "-fopenmp=libiomp5"
>> CACHE STRING "C++ compiler flags for OpenMP parallization" FORCE)
>> + endif()
>>include_directories(${LIBDIR}/openmp/include)
>>link_directories(${LIBDIR}/openmp/lib)
>># This is a workaround for our helperbinaries (
>> datatoc, masgfmt, ... ),
>>
>> After the tests I have not found any issues with cuda 7.5 and xcode 7.3.1
>> or clang 3.7/3.8 but I guess it’s because I am using the latest version and
>> is seems to have fixed incompatible compiler issues but as I don’t know
>> what the cuda-hack does, I am not sure.
>>
>> Any comment on what the cuda-hack does/solves is very welcome.
>>
>> Thanks,
>> Francesc
>>
>> On 26 Aug 2016, at 19:08, Jens Verwiebe wrote:
>>
>>> I'd say cuda8 is pointless for you right now, cause pascal gpu is not
>>> yet supported by the NV/OSX (Quadro-) drivers.
>>>
>>> You would definitely loose openmp capability unless you compile and use
>>> a vanilla clang 3.7 which supports it.
>>>
>>>
>>> Jens
>>>
>>>
>>> Am 26.08.2016 um 18:11 schrieb Francesc Juhe:
Hi,
Some time ago noticed this commit https://developer.blender.org/
>> rB3a24e6320f31a790ea9d3c912a35db2186140b71 changing the nvcc compiler on
>> builbot but I did not give it much though as I was having no issues
>> compiling with cuda 7.5 and clang 3.5 from libs folder on OSX 10.9. But now
>> with CUDA 8 it seems I have to update to OSX 10.11 and Xcode 7.3.
So, how does this cuda-hack work?
Also, OSX buildbot builds seem to be compiled without OpenMP but
>> release builds are compiled with it. What are the appropriate steps for
>> building a release build?
Thank you,
Francesc
___
Bf-committers mailing list
Bf-committers@blender.org
https://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>> --
>>>
>>> Jens