Hey!
I’m using my own 3rd party build for all libraries I use/ contribute to and I 
usually don’t deal with brew. Guess there are a few changes to oiio in brew to 
handle this, will check it out.
Good tip 🙏🏻

Anyway, would be nice to make sure oiio builds on a Mac M1 arm64 without to 
many manual tweaks. The changes are minor after all.

Mikael

Sent from my iPhone

> On 13 Mar 2022, at 12:49, Dariusz <dari...@dariuszmakowski.com> wrote:
> 
>  Hey
> 
> This is odd.
> I was running it on m1 already in arm mode. I think I used brew to install 
> it. Did you try that?
> 
> Regards
> Dariusz
> 
> 
> On 13/03/2022 09:13, Mikael Sundell wrote:
>> Hey,
>> 
>> I've got a build running for my Mac M1/ arm64, two things I had to patch. 
>> Just want to double check here before I propose a PR as I've been away from 
>> everyday C++ coding for a while :-)
>> 
>> First, uname -m on the Mac will not return aarch64, it simply return arm64. 
>> Therefore I change the platformdetection (detectplatform.mk) to:
>> 
>> ifneq (${hw},x86)
>>   ifneq (${hw},x86_64)
>>     ifneq (${hw},i386)
>>       ifneq (${hw},i686)
>>         ifneq (${hw},aarch64)
>>           ifneq (${hw},arm64)
>>             $(error "ERROR: Unknown hardware architecture")
>>           endif
>>         endif
>>       endif
>>     endif
>>   endif
>> endif
>> 
>> Second, for some reason the compiler attributes for inlining/ optimisation 
>> seems to collide:
>> 
>> In file included from 
>> /Volumes/Build/3rdparty/build/macosx/arm64.debug/src/oiio/oiio/src/libutil/spinlock_test.cpp:10:
>> /Volumes/Build/3rdparty/build/macosx/arm64.debug/src/oiio/oiio/src/include/OpenImageIO/benchmark.h:29:1:
>>  error: 'always_inline' attribute ignored [-Werror,-Wignored-attributes]
>> OIIO_FORCEINLINE T const& DoNotOptimize (T const &val);
>> ^
>> /Volumes/Build/3rdparty/build/macosx/arm64.debug/src/oiio/oiio/src/include/OpenImageIO/platform.h:391:52:
>>  note: expanded from macro 'OIIO_FORCEINLINE'
>> #    define OIIO_FORCEINLINE inline __attribute__((always_inline))
>>                                                    ^
>> /Volumes/Build/3rdparty/build/macosx/arm64.debug/src/oiio/oiio/src/include/OpenImageIO/benchmark.h:431:33:
>>  note: conflicting attribute is here
>> inline T const & __attribute__((__optnone__))
>>                                 ^
>> 1 error generated.
>> 
>> This can easily be resolved by just taking out the:
>> 
>> #elif __has_attribute(__optnone__)
>> 
>> section in benchmark.h: line 426.
>> 
>> This is one where I don't feel confident, is that the right thing to do. I 
>> don't know enough here to propose this as a change.
>> 
>> I'm a bit rusty with all this, my comments here should probably be in the PR 
>> itself. 
>> 
>> Anyway here it is, I've got a working arm64 build and happy to contribute.
>> 
>> Mikael
>> 
>> 
>> _______________________________________________
>> Oiio-dev mailing list
>> Oiio-dev@lists.openimageio.org
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
> 
> -- 
> DARIUSZ MAKOWSKi
> CGI-Photographer
> 07 590 530 854
> dari...@dariuszmakowski.com
> www.dariuszmakowski.com
> 
>       Virus-free. www.avast.com
> _______________________________________________
> Oiio-dev mailing list
> Oiio-dev@lists.openimageio.org
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to