# Cmake on m2 mac

**URL:** <https://discourse.slicer.org/t/cmake-on-m2-mac/31202>\
**Category:** Support\
**Created:** [August 17, 2023, 7:48pm UTC](https://discourse.slicer.org/t/cmake-on-m2-mac/31202 "2023-08-17T19:48:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kening\_Zhang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kening_zhang/32/65641_2.png) [@Kening\_Zhang](https://discourse.slicer.org/u/Kening_Zhang)\
**Post date:** [August 17, 2023, 7:48pm UTC](https://discourse.slicer.org/t/cmake-on-m2-mac/31202/1 "2023-08-17T19:48:51Z")

</div>

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/4/44d35f2168126a988c0142460d64e5086eaa770a.png)  
When I try  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/f/8f7ac5872f656c4d825c2814eec9f0313bc389dc.png)  
Error happens, how should I solve it?  
Best wishes,  
Joshua

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [August 17, 2023, 7:58pm UTC](https://discourse.slicer.org/t/cmake-on-m2-mac/31202/2 "2023-08-17T19:58:21Z")

</div>

Take a look at the following Slicer GitHub issue about the current workarounds and when native Apple Silicon support will be added.

> <https://github.com/Slicer/Slicer/issues/5944#issuecomment-1328179343>
>
> \## Steps to reproduce
> 
> I followed all the instructions from the \[docs\](https:/…/slicer.readthedocs.io/en/latest/developer\_guide/build\_instructions/macos.html#prerequisites) to build slicer from source. 
> 
> Build halts with the following error while trying to build DCMTK:
> 
> \`\`\`
> make\[2\]: \*\*\* \[DCMTK-prefix/src/DCMTK-stamp/DCMTK-configure\] Error 1
> make\[1\]: \*\*\* \[CMakeFiles/DCMTK.dir/all\] Error 2
> \-- OpenSSL: Errors detected - See below.
> 
> ld: warning: double slash removed from -install\_name (/Users/kliron/opt/slicer/OpenSSL//libcrypto.1.1.dylib)
> ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
> ld: warning: ignoring file /Users/kliron/opt/slicer/zlib-install/lib/libz.a, building for macOS-i386 but attempting to link with file built for macOS-arm64
> ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/libSystem.tbd (3 slices)
> 
> Undefined symbols for architecture i386:
> 
> "\_\_DefaultRuneLocale", referenced from:
> \_CONF\_parse\_list in conf\_mod.o
> "\_\_\_bzero", referenced from:
> \_ASN1\_BIT\_STRING\_set\_bit in a\_bitstr.o
> \_asn1\_item\_embed\_new in tasn\_new.o
> \_addr\_strings in b\_addr.o
> \_mem\_ctrl in bss\_mem.o
> \_BLAKE2b\_Final in blake2b.o
> \_BLAKE2s\_Final in blake2s.o
> \_bn\_div\_fixed\_top in bn\_div.o
> ...
> 
> \[...an extensive output of a lot more missing symbols...\]
> 
> ld: symbol(s) not found for architecture i386
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> make\[4\]: \*\*\* \[libcrypto.dylib\] Error 1
> make\[3\]: \*\*\* \[build\_libs\] Error 2
> 
> CMake Error at /Users/kliron/Projects/slicer/CMake/ExternalProjectForNonCMakeProject.cmake:104 (message):
> OpenSSL: build step failed with exit code '2'.
> \`\`\`
> 
> \## Expected behavior
> 
> A successful build.
> 
> \## Environment
> \- Slicer version: latest source tree
> \- Operating system: MacOS Big Sur 11.6
> 
> Has anyone been able to compile slicer from source on a M1 Mac? How do I bypass the missing i386 openssl library?
