<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">Hi Andrew,</span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;"><br>
</span></p>
<p><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">>You can view the changes (not that many) I needed to perform to get it working ?>at</span><a href="https://urldefense.us/v3/__https://github.com/conda-forge/cspice-feedstock/tree/master/recipe__;!!PvBDto6Hs4WbVuu7!aC4wtpxOROo1_M7LLge3yFOEQjjdLwhxcnlFu4lCP8B5nG_YFAi-rwjsZUD7wkWkHfGtgooKFj2XKw$" id="LPlnk" previewremoved="true" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">https://github.com/conda-forge/cspice-feedstock/tree/master/recipe</a><span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 16px;">.
 Interestingly, I did not >need to patch inquire.c which maybe down to the various GCC flags that their CI workers configure >for me, although I didn't investigate this difference. The only change I really needed to do was >remove the use of the '-m64' GCC
 flag from the various mkprodct.csh scripts. </span><br>
</p>
<p><br>
</p>
<p>Thanks for that update. I think now more surely, that the need for inclusion of unistd.h in inquire.c is only a mandate for the clang/llvm compiler environment native to Xcode/Developer-Tools in MacOS-M1 (aarch64).</p>
<p><br>
</p>
<p>GCC build environment, apparently, continues to figure out where access() function comes from, even if one didn't explicitly include unistd.h in inquire.c, as is the case in my MacOS-Intel.</p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt"><br>
Thanks and Regards,<br>
Manikantan Ramadas<font size="2"><font size="2"></font></font><br>
-- <br>
</span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt"><span style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">"By being pleasant always and smiling, it takes you nearer to God,</span><br style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">
<span style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">nearer than any prayer." - Sri Ramakrishna Paramahamsa</span><br style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">
<span style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">------------------------------------------------------------------</span></span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt">
<div></div>
<br>
</span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt">
<div><br>
</div>
</span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt">
<div style="font-family:Tahoma; font-size:13px"><br>
</div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt"></span></font></div>
<br>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> prvs=728f32fbe=aannex1@jhu.edu <prvs=728f32fbe=aannex1@jhu.edu><br>
<b>Sent:</b> Sunday, April 11, 2021 10:34 PM<br>
<b>To:</b> Manikantan Ramadas; Wright, Edward D (US 392N)<br>
<b>Cc:</b> spice_discussion@naif.jpl.nasa.gov; mramadas@gmail.com<br>
<b>Subject:</b> Re: [Spice_discussion] CSPICE on M1 Apple-Silicon Macs</font>
<div> </div>
</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Hey All,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Relevant to this discussion, CSPICE for aarch64 and osx-arm64 is now available through the conda-forge (https://conda-forge.org,
<a href="https://urldefense.us/v3/__https://anaconda.org/conda-forge/cspice__;!!PvBDto6Hs4WbVuu7!aC4wtpxOROo1_M7LLge3yFOEQjjdLwhxcnlFu4lCP8B5nG_YFAi-rwjsZUD7wkWkHfGtgoqob-TaYA$" id="LPlnk" previewremoved="true">
https://anaconda.org/conda-forge/cspice</a> ). However, I don't own a Raspberry Pi or M1 mac to personally verify them. CI tests for spiceypy pass at least on aarch64, but tests are not currently run on osx-arm64 builds.</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview_1 _EReadonly_1"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
Once you have anaconda/miniconda installed on those systems you should be able to run 'conda install cspice -c conda-forge' to install CSPICE for those platforms. SpiceyPy will also work similarly by running 'conda install spiceypy -c conda-forge'. You maybe
 able to extract the compiled libraries/executable utilities from the zip files hosted by anaconda as well.<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
You can view the changes (not that many) I needed to perform to get it working at
<a href="https://urldefense.us/v3/__https://github.com/conda-forge/cspice-feedstock/tree/master/recipe__;!!PvBDto6Hs4WbVuu7!aC4wtpxOROo1_M7LLge3yFOEQjjdLwhxcnlFu4lCP8B5nG_YFAi-rwjsZUD7wkWkHfGtgooKFj2XKw$" id="LPlnk" previewremoved="true">
https://github.com/conda-forge/cspice-feedstock/tree/master/recipe</a>. Interestingly, I did not need to patch inquire.c which maybe down to the various GCC flags that their CI workers configure for me, although I didn't investigate this difference. The only
 change I really needed to do was remove the use of the '-m64' GCC flag from the various mkprodct.csh scripts.
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
I would be curious for people with the relevant hardware to try out spiceypy/cspice conda-forge distributions.
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0); background-color:rgb(255,255,255)">
-Andrew<br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<br>
<div id="appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Spice_discussion <spice_discussion-bounces@naif.jpl.nasa.gov> on behalf of Manikantan Ramadas <manikantan@istrac.gov.in><br>
<b>Sent:</b> Friday, April 9, 2021 12:32 AM<br>
<b>To:</b> Wright, Edward D (US 392N) <edward.d.wright@jpl.nasa.gov><br>
<b>Cc:</b> spice_discussion@naif.jpl.nasa.gov <spice_discussion@naif.jpl.nasa.gov>; mramadas@gmail.com <mramadas@gmail.com><br>
<b>Subject:</b> Re: [Spice_discussion] CSPICE on M1 Apple-Silicon Macs</font>
<div> </div>
</div>
<div dir="ltr">
<p><strong><br>
</strong><strong><span style="background:red; color:white; font-family:"Times New Roman",serif; font-size:12pt">      External Email - Use Caution      </span></strong></p>
<p><strong><span style="background:red; color:white; font-family:"Times New Roman",serif; font-size:12pt"><br>
</span></strong></p>
<p><strong><span style="background:red; color:white; font-family:"Times New Roman",serif; font-size:12pt"><br>
</span></strong></p>
<div>
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi all,</p>
<p><br>
</p>
<p>Please see the email below. This earlier mail didn't go through because of the PDF attachment, I had, I understand. </p>
<p><br>
</p>
<p>Here I am sending the note in Text format. Hope it would help someone who is trying to get C SPICE library working on the Apple Silicon Macs.</p>
<p><br>
</p>
<div id="x_Signature">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt"><br>
Thanks and Regards,<br>
Manikantan Ramadas<font size="2"><font size="2"></font></font><br>
-- <br>
</span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt"><span style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">"By being pleasant always and smiling, it takes you nearer to God,</span><br style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">
<span style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">nearer than any prayer." - Sri Ramakrishna Paramahamsa</span><br style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">
<span style="font-family:Arial,serif,EmojiFont; font-size:13.3333px">------------------------------------------------------------------</span></span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt">
<div></div>
<br>
</span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt">
<div><br>
</div>
</span></font></div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt">
<div style="font-family:Tahoma; font-size:13px"><br>
</div>
<div style="font-family:Tahoma; font-size:13px"><font size="2" face="Arial"><span style="font-size:10pt"></span></font></div>
<br>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<br>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> mramadas@gmail.com <mramadas@gmail.com><br>
<b>Sent:</b> Thursday, April 8, 2021 12:17 AM<br>
<b>To:</b> Wright, Edward D (US 392N)<br>
<b>Cc:</b> spice_discussion@naif.jpl.nasa.gov; Manikantan Ramadas<br>
<b>Subject:</b> Re: [Spice_discussion] CSPICE on M1 Apple-Silicon Macs</font>
<div> </div>
</div>
<div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Hi Mr.Edward Wright,
<div class=""><br class="">
</div>
<div class="">Sorry about the delay in getting back. I couldn’t spend much time on this until now.</div>
<div class=""><br class="">
</div>
<div class="">Tonight, I did put in some time, and was able to make the SPICE Library compile on MacOS on Apple Silicon.</div>
<div class="">It had to do with the inclusion of the unistd.h header file that gives the access() function explicitly in the cspice/src/inquire.c</div>
<div class=""><br class="">
</div>
<div class="">I have written a short note on this. I have also include an Appendix in this Note on how to get the C Compiler environment going on Apple Silicon - because it was a bit of a learning curve for me, and it might help someone else.</div>
<div class=""><br class="">
</div>
<div class="">I have attached the Note, and a short file inquire.c.diff that you may use to quickly patch the inquire.c file (for Apple Silicon - if you were to make a SPICE library package for this hardware platform) as in:</div>
<div class="">patch inquire.c inquire.c.diff</div>
<div class=""><br class="">
</div>
<div class="">Thanks and Regards</div>
<div class="">R.Manikantan</div>
<div class=""><br class="">
</div>
<div class=""></div>
</div>
<div style="word-wrap:break-word; line-break:after-white-space">
<div></div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">
<div class=""></div>
<div class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 05-Mar-2021, at 9:31 PM, Wright, Edward D (US 392N) <<a href="mailto:edward.d.wright@jpl.nasa.gov" class="">edward.d.wright@jpl.nasa.gov</a>> wrote:</div>
<br class="x_x_Apple-interchange-newline">
<div class="">
<div dir="ltr" class="" style="font-family:Optima-Regular; font-size:16px; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<div id="x_x_x_divtagdefaultwrapper" dir="ltr" class="" style="font-size:12pt; font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div class="">To: R Manikantan<br class="">
From: Edward Wright<br class="">
<br class="">
As of now, no work on an Apple ARM64 Mac by NAIF. We built and successfully tested CSPICE on the Raspberry Pi platform, so I believe an ARM64 build a solvable problem.<br class="">
<br class="">
What compile errors did you observe?<br class="">
<br class="">
As always,<br class="">
Edward Wright<br class="">
<br class="">
<br class="">
<br class="">
</div>
</div>
<hr tabindex="-1" class="" style="display:inline-block; width:725.1875px">
<div id="x_x_x_divRplyFwdMsg" dir="ltr" class=""><font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">From:</b><span class="x_x_Apple-converted-space"> </span><a href="mailto:spice_discussion-bounces@naif.jpl.nasa.gov" class="">spice_discussion-bounces@naif.jpl.nasa.gov</a>
 <<a href="mailto:spice_discussion-bounces@naif.jpl.nasa.gov" class="">spice_discussion-bounces@naif.jpl.nasa.gov</a>> on behalf of Manikantan Ramadas <<a href="mailto:mramadas@gmail.com" class="">mramadas@gmail.com</a>><br class="">
<b class="">Sent:</b><span class="x_x_Apple-converted-space"> </span>Wednesday, March 3, 2021 9:20:06 AM<br class="">
<b class="">To:</b><span class="x_x_Apple-converted-space"> </span><a href="mailto:spice_discussion@naif.jpl.nasa.gov" class="">spice_discussion@naif.jpl.nasa.gov</a><br class="">
<b class="">Subject:</b><span class="x_x_Apple-converted-space"> </span>[Spice_discussion] CSPICE on M1 Apple-Silicon Macs</font>
<div class=""> </div>
</div>
</div>
<font size="2" class="" style="font-family:Optima-Regular; font-style:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none"><span class="" style="font-size:10pt">
<div class="x_x_PlainText">Hi all,<br class="">
<br class="">
I was wondering if any of us have successfully compiled and using CSPICE library on the new Apple Silicon (ARM64) M1 Macs?<br class="">
<br class="">
I got the gcc from Apple via Developer-Tools / XCODE package, but ran into certain compilation errors in the process. It would be good to know if anyone had already run into / solved issues on this front..<br class="">
<br class="">
Thanks & Regards,<br class="">
R Manikantan<br class="">
_______________________________________________<br class="">
Spice_discussion mailing list<br class="">
<a href="mailto:Spice_discussion@naif.jpl.nasa.gov" class="">Spice_discussion@naif.jpl.nasa.gov</a><br class="">
<a href="https://urldefense.us/v3/__https://nam02.safelinks.protection.outlook.com/?url=https*3A*2F*2Fnaif.jpl.nasa.gov*2Fmailman*2Flistinfo*2Fspice_discussion&data=04*7C01*7Caannex1*40jhu.edu*7C2148a386147844f106bf08d8fb622d04*7C9fa4f438b1e6473b803f86f8aedf0dec*7C0*7C0*7C637535746851819264*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C2000&sdata=kfHIVZkcvtD*2FsMzZ3fRcmMl3cZzoGFIzrchILFXMJv0*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSU!!PvBDto6Hs4WbVuu7!aC4wtpxOROo1_M7LLge3yFOEQjjdLwhxcnlFu4lCP8B5nG_YFAi-rwjsZUD7wkWkHfGtgorckwfntA$" class="">https://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion</a></div>
</span></font></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>