[xcrysden] Compile on M2

박민규 minkyupark.phys at gmail.com
Thu Jul 4 06:12:07 CEST 2024


Dear all,

After many tries, I finally succeed to compile xcrysden 1.6.2 on Apple silicon M2 using homebrew. 

Here is my recipe. 

1. Install homebrew. Command Line Tools (CLT) is required. 

2. Install fftw using homebrew. This also installs gcc and gfortran (which is part of gcc). 

3. cp system/Make.sys-semishared-macosx-x11-xquartz Make.sys

4. Add -L/opt/homebrew/lib and -I/opt/homebrew/include to FFTW3_LIB and FFTW3_INCDIR in Make.sys respectively. 

5. make CC=/usr/bin/gcc all

Instead of gcc installed by homebrew, use gcc provided in CLT: Apple clang version 15.0.0 (clang-1500.3.9.4) in my case. 

6. The compilation will be stopped by the error from Togl. 

7. Modify external/src/Togl2.0/togl.c follow the instruction https://cgit.freebsd.org/ports/commit/?id=0e77cfcef8a5677cff1ba81430b767a1089fd083

8. Since libTogl2.0.dylib is not automatically generated in external/lib, we either do 
1) add -L$(TOPDIR)/external/lib/Togl2.0 to TOGL_LIB in Make.sys or 
2) ln -s external/lib/Togl2.0/libTogl2.0.dylib external/lib/

9. make CC=/usr/bin/gcc xcrysden

10. If the compilation succeed but no executable file is generated, it can be copied from Mac OS binary packages (pre-compiled packages downloadable from xcrysden homepage). 

11. make install 

12. If error occurs, add symbolic link of libTogl2.0.dylib to proper locations. 

I hope it helps to someone struggling like me.

Best regards, 

Minkyu Park
Korea Research Institute of Standards and Science


> On Apr 4, 2024, at 3:40 PM, xcrysden-request at democritos.it wrote:
> 
> Send XCrySDen mailing list submissions to
> 	xcrysden at democritos.it
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://www.democritos.it/mailman/listinfo/xcrysden
> or, via email, send a message with subject or body 'help' to
> 	xcrysden-request at democritos.it
> 
> You can reach the person managing the list at
> 	xcrysden-owner at democritos.it
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of XCrySDen digest..."
> 
> 
> Today's Topics:
> 
>   1. Compile on M2 (???)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 4 Apr 2024 14:09:24 +0900
> From: ??? <minkyupark.phys at gmail.com>
> Subject: [xcrysden] Compile on M2
> To: xcrysden at democritos.it
> Message-ID: <340FFBBB-0CC3-4B84-AC9D-D20AA1DC9CC2 at gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear all,
> 
> I have been trying to compile xcrysden on M2 chip without success. 
> 
> I found one relevant email
> http://www.democritos.it/pipermail/xcrysden/2022-September/002116.html
> But this does not work for me.
> 
> While ago, I was able to compile xcrysden on MacBook Pro with intel chip
> by installing required libraries through homebrew. 
> But even if I follow the same procedure, it does not work in M2. 
> 
> So does anyone succeed to compile xcrysden on M2 or any other apple silicon chips?
> 
> Attaches are my Make.sys and output error message.
> 
> Best,
> Minkyu Park
> Korea Research Institute of Standards and Science
> 
> ??
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://www.democritos.it/pipermail/xcrysden/attachments/20240404/77eab2ad/attachment.html 
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: err.log
> Type: application/octet-stream
> Size: 33553 bytes
> Desc: not available
> Url : http://www.democritos.it/pipermail/xcrysden/attachments/20240404/77eab2ad/attachment.obj 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://www.democritos.it/pipermail/xcrysden/attachments/20240404/77eab2ad/attachment.htm 
> -------------- next part --------------
> An embedded and charset-unspecified text was scrubbed...
> Name: Make.sys.txt
> Url: http://www.democritos.it/pipermail/xcrysden/attachments/20240404/77eab2ad/attachment.txt 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://www.democritos.it/pipermail/xcrysden/attachments/20240404/77eab2ad/attachment-0001.htm 
> 
> ------------------------------
> 
> _______________________________________________
> XCrySDen mailing list
> XCrySDen at democritos.it
> http://www.democritos.it/mailman/listinfo/xcrysden
> 
> 
> End of XCrySDen Digest, Vol 153, Issue 1
> ****************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.democritos.it/pipermail/xcrysden/attachments/20240704/7fba5e06/attachment.htm 


More information about the XCrySDen mailing list