AlabamaASRL / asset_asrl

https://alabamaasrl.github.io/asset_asrl/
Apache License 2.0
29 stars 6 forks source link

Compiling on a Mac/M1 architecture #7

Closed wbsteinMSFC closed 1 year ago

wbsteinMSFC commented 1 year ago

I know this isn't a high priority, and I'm playing around with this as an academic curiosity (I mainly will be running asset on linux anyways).

I've followed the linux install docs and so far so good (with a couple of intellectual jumps for those familiar with Macs etc).

I end up with the following compiler error: [build] clang: error: the clang compiler does not support '-march=native'

Since I'm not very familiar with compiling Asset, I figured I'd document this. Especially if it's an easy fix.

This isn't a priority so no need to rush to respond (unless you're bored :D)

jbpezent commented 1 year ago

@wbsteinMSFC You may be able to get it to compile on an M1 Mac, but I'd imagine it will throw an illegal instruction error as soon as you run the optimizer. The optimizer depends on intel MKL, which unfortunately doesn't support ARM cpus at the moment. As for the compiler error it seems that clang does not support -march=native on M1 macs. https://stackoverflow.com/questions/65966969/why-does-march-native-not-work-on-apple-m1

wbsteinMSFC commented 1 year ago

@jbpezent Yeah. I kinda figured. Although I was going to try to bootstrap MKL through rosetta, not the fastest way. But production would be on linux and tinkering would be on Mac. It looks like (rumor) that clang15 supports -march-native on M1. But VS Code was content with the other compilers it had and decided to ignore my freshly installed clang15. So we are not friends at the moment. :D

I may revisit this when I have more time, but it's a nice to have. The linux version is compiling as I type. Thanks guys!

wgledbetter commented 1 year ago

Regarding vscode not using clang 15, did you re-run "scan for kits" after installing it?

wbsteinMSFC commented 1 year ago

Haha. Yeah. No dice. I just got mad at it and started working on linux instead. No issues.

    William Stein
    Mission Analysis and Optimization Tech Fellow
    Jacobs Space Exploration Group | ESSCA Contract
    (256).961.1437 (o)
    ***@***.***

From: William Ledbetter @.> Reply-To: AlabamaASRL/asset_asrl @.> Date: Friday, January 6, 2023 at 8:22 AM To: AlabamaASRL/asset_asrl @.> Cc: William Stein @.>, State change @.***> Subject: [EXTERNAL] Re: [AlabamaASRL/asset_asrl] Compiling on a Mac/M1 architecture (Issue #7)

Regarding vscode not using clang 15, did you re-run "scan for kits" after installing it?

— Reply to this email directly, view it on GitHubhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAlabamaASRL%2Fasset_asrl%2Fissues%2F7%23issuecomment-1373704633&data=05%7C01%7Cwilliam.b.stein%40nasa.gov%7C725a7cb333704ebd938e08daeff16098%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638086117230562201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EKOzuPro7yG%2FGAfYbvRISXFav%2BPlfpdcmfDyy%2BPtGgA%3D&reserved=0, or unsubscribehttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA5B453CCOHZQPBO5DDEZPTDWRATANANCNFSM6AAAAAATP35GWQ&data=05%7C01%7Cwilliam.b.stein%40nasa.gov%7C725a7cb333704ebd938e08daeff16098%7C7005d45845be48ae8140d43da96dd17b%7C0%7C0%7C638086117230562201%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DXeyAoS3r2bTHRnjRrsjOkh4NUTiaZb7abrSAIiZfH0%3D&reserved=0. You are receiving this because you modified the open/close state.Message ID: @.***>