[Spice_discussion] CSPICE on M1 Apple-Silicon Macs

Andrew Annex aannex1 at jhu.edu
Sun Apr 11 10:04:03 PDT 2021


Hey All,

Relevant to this discussion, CSPICE for aarch64 and osx-arm64 is now available through the conda-forge (https://urldefense.us/v3/__https://conda-forge.org__;!!PvBDto6Hs4WbVuu7!e4-_XLnuWN-bKOhowVC4dzq0MTZ-exdyxVuCxlkADJ566FSVqj649d4wi1-6WShBYYU90KQeWwP08g$ , https://urldefense.us/v3/__https://anaconda.org/conda-forge/cspice__;!!PvBDto6Hs4WbVuu7!e4-_XLnuWN-bKOhowVC4dzq0MTZ-exdyxVuCxlkADJ566FSVqj649d4wi1-6WShBYYU90KRIfcj4JA$  ). 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.

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.

You can view the changes (not that many) I needed to perform to get it working at https://urldefense.us/v3/__https://github.com/conda-forge/cspice-feedstock/tree/master/recipe__;!!PvBDto6Hs4WbVuu7!e4-_XLnuWN-bKOhowVC4dzq0MTZ-exdyxVuCxlkADJ566FSVqj649d4wi1-6WShBYYU90KSWdAF1Rw$ . 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.

I would be curious for people with the relevant hardware to try out spiceypy/cspice conda-forge distributions.

-Andrew

________________________________
From: Spice_discussion <spice_discussion-bounces at naif.jpl.nasa.gov> on behalf of Manikantan Ramadas <manikantan at istrac.gov.in>
Sent: Friday, April 9, 2021 12:32 AM
To: Wright, Edward D (US 392N) <edward.d.wright at jpl.nasa.gov>
Cc: spice_discussion at naif.jpl.nasa.gov <spice_discussion at naif.jpl.nasa.gov>; mramadas at gmail.com <mramadas at gmail.com>
Subject: Re: [Spice_discussion] CSPICE on M1 Apple-Silicon Macs


      External Email - Use Caution



Hi all,


Please see the email below. This earlier mail didn't go through because of the PDF attachment, I had, I understand.


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.


Thanks and Regards,
Manikantan Ramadas
--
"By being pleasant always and smiling, it takes you nearer to God,
nearer than any prayer." - Sri Ramakrishna Paramahamsa
------------------------------------------------------------------






________________________________
From: mramadas at gmail.com <mramadas at gmail.com>
Sent: Thursday, April 8, 2021 12:17 AM
To: Wright, Edward D (US 392N)
Cc: spice_discussion at naif.jpl.nasa.gov; Manikantan Ramadas
Subject: Re: [Spice_discussion] CSPICE on M1 Apple-Silicon Macs

Hi Mr.Edward Wright,

Sorry about the delay in getting back. I couldn’t spend much time on this until now.

Tonight, I did put in some time, and was able to make the SPICE Library compile on MacOS on Apple Silicon.
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

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.

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:
patch inquire.c inquire.c.diff

Thanks and Regards
R.Manikantan


On 05-Mar-2021, at 9:31 PM, Wright, Edward D (US 392N) <edward.d.wright at jpl.nasa.gov<mailto:edward.d.wright at jpl.nasa.gov>> wrote:

To: R Manikantan
From: Edward Wright

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.

What compile errors did you observe?

As always,
Edward Wright



________________________________
From: spice_discussion-bounces at naif.jpl.nasa.gov<mailto:spice_discussion-bounces at naif.jpl.nasa.gov> <spice_discussion-bounces at naif.jpl.nasa.gov<mailto:spice_discussion-bounces at naif.jpl.nasa.gov>> on behalf of Manikantan Ramadas <mramadas at gmail.com<mailto:mramadas at gmail.com>>
Sent: Wednesday, March 3, 2021 9:20:06 AM
To: spice_discussion at naif.jpl.nasa.gov<mailto:spice_discussion at naif.jpl.nasa.gov>
Subject: [Spice_discussion] CSPICE on M1 Apple-Silicon Macs

Hi all,

I was wondering if any of us have successfully compiled and using CSPICE library on the new Apple Silicon (ARM64) M1 Macs?

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..

Thanks & Regards,
R Manikantan
_______________________________________________
Spice_discussion mailing list
Spice_discussion at naif.jpl.nasa.gov<mailto:Spice_discussion at naif.jpl.nasa.gov>
https://naif.jpl.nasa.gov/mailman/listinfo/spice_discussion<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!e4-_XLnuWN-bKOhowVC4dzq0MTZ-exdyxVuCxlkADJ566FSVqj649d4wi1-6WShBYYU90KSnG23h4Q$ >

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://naif.jpl.nasa.gov/pipermail/spice_discussion/attachments/20210411/9eff804a/attachment-0001.html>


More information about the Spice_discussion mailing list