Compile failure on Mac OSX M1 arm64

Has anyone successfully compiled the server on an M1 Laptop for an M1 laptop?

When I run the cmake command on an M1 laptop:




I get an error that seems like Xcode is running a test for a webassembly target on an x86

Here is one of the errors that I get:

/Applications/ -x c++ -target arm64-apple-macos10.9 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-return-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wno-unused-variable -Wunused-value -Wno-empty-body -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-constant-conversion -Wno-int-conversion -Wno-bool-conversion -Wno-enum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -Wno-c++11-extensions -DCMAKE_INTDIR="Release" -isysroot /Applications/ -fstrict-aliasing -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-range-loop-analysis -Wno-semicolon-before-method-body -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/Release/include -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/ -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/ -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/ -F/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/Release -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6//config/include -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/ofstd/include -I/Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/ofstd/libsrc -MMD -MT dependencies -MF /Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/ --serialize-diagnostics /Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/ -c /Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/config/tests/ -o /Users/jmurray/code/orthanc/Build/dcmtk-3.6.6/CMakeTmp/Arith/CMakeFiles/CMakeTmp/

In file included from

In file included from

error: use of undeclared identifier ‘__builtin_ia32_emms’; did you mean


I just downloaded the compiled one from Osimis and it works no problem.

Thank you, Bryan! I tried to load the binary image, but I did not understand how the command file worked. After about 10 overrides of non-Apple Store files, I got the binary version of the server to work. Thank you!!!

I am curious to know if there is some special command to compile the code on an M1 or if it was cross-compiled from an x86 mac.

thank you!



This compilation error means that either DCMTK doesn’t support M1 (unlikely), or that the following files must be adapted in the source code of Orthanc (more probable):

Similar compilation errors have been reported for other software, for instance:

Unfortunately, I don’t have access to such an Apple computer, so I can’t provide any fix by myself.

To answer the second part of your question, the Osimis binary package is built on a x86 MacMini from 2014. Full info:

$ system_profiler SPSoftwareDataType

System Software Overview:

System Version: OS X 10.9.5 (13F1911)
Kernel Version: Darwin 13.4.0


I have an M1 Mac so can help to troubleshoot. I did try to install dmctk using home brew a week or so back and it didn’t compile either.

Are there any pointers you can give so I can look into it?


Binary Logo

James Manners • Director
Suite 3, Level 2, 10 Queens Road, Melbourne, Victoria 3004, Australia

T: 03 9017 5230 M: 0422 973 235 E: W:

Hello James,

Thanks for your feedback! The first thing to try would indeed be to compile DCMTK 3.6.6 from source (using CMake) on M1 Mac, without even considering Orthanc.

If the compilation doesn’t succeed, this should be reported to the DCMTK team:


Hi Sebastien,

I had a quick look on the DCMTK Issue Tracker and this issue is open regarding compilation on a Mac M1 (ARM) chip

So it looks like there are issues with DCMTK compiling on an M1.



Thank you to all. I am using the cross-compiled binary. I appreciate the investigation.

We can let this one go for now.



Here are 2 fixes which seems to solve the Apple M1 build issues:

At least, I’ve been able to produce a universal binary on an Intel Mac but I have not been able to run it on a M1 processor (because I don’t have any :slight_smile: ). Any feedback is welcome.



Just for information,
In case you need a M1 environement to code / test

You can have a M1 instance for few hours in some cloud providers such as scaleway :

This way no need to pay for overpriced mac products ^^