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
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org