-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Apple arm64 #191
Open
MicroTed
wants to merge
10
commits into
NCAR:develop
Choose a base branch
from
MicroTed:apple-arm64
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
461158d
First commit for building ncargraphics libraries on Apple M1 under Mo…
MicroTed 00d926e
Some more little fixes.
MicroTed a95986b
Updated description text
MicroTed c7fd686
Temporary fix to prevent out of bounds write when cpnumb is called f…
MicroTed 1567107
Added preprocessing flag to Format.c to declare string length variab…
MicroTed 6a092e4
Remove hack from cpnumb subroutine since the string length problem i…
MicroTed a216ba5
Removed check for arm64 and simply declare len1 etc. as 'long' for p…
MicroTed 6089cf2
undid previous change as it is no longer needed
MicroTed d81f82d
Add -O to compile options
MicroTed c4486cc
Removed wrf_constants.mod from object list because it doesn't need t…
MicroTed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
I have netcdf installed separately and other ncarg dependencies were installed with homebrew. GCC version 12 was installed with homebrew, as well. That version (gcc-12) is wired into the Darwin_Arm configure file and probably should be made generic. | ||
|
||
For Configure, my library and include settings are: | ||
|
||
/opt/X11/lib /Users/Shared/opt/local/netcdf480ser/lib /Users/Shared/homebrew/lib | ||
|
||
/opt/X11/include /opt/X11/include/freetype2 /Users/Shared/opt/local/netcdf480ser/include /Users/Shared/homebrew/include | ||
|
||
Make sure to install proj at version 7 in homebrew: | ||
brew install proj@7 | ||
And if proj v. 9 is install, then unlink that with 'brew unlink proj' and then link the v7 with 'brew link proj@7' | ||
|
||
Also need to set g++ at as g\+\+-12 so that ncl linking finds the gfortran library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Description: This file contains the configuration for a | ||
* gfortran/gcc build on a *64 bit* ARM (Apple Silicon) Mac system. | ||
* | ||
* You may need to modify it to change or include | ||
* options. This version was tested with GCC-12.2 | ||
* built with Homebrew and XCode 13.4.1 on OS 12.6 (Monterey) | ||
* | ||
* Note: if the build has trouble finding the | ||
* "gfortran" library, then you may need to modify | ||
* the "CtoFLibraries" line below and include a "-L" | ||
* path to help it. For example: | ||
* | ||
* #define CtoFLibraries -L/usr/local/lib -lgfortran -lquadmath | ||
* or | ||
* #define CtoFLibraries /usr/local/lib/libgfortran.a /usr/local/lib/libquadmath.a | ||
* | ||
* You'll need to change "/usr/local/lib" to | ||
* whatever directory contains "libgfortran.so". | ||
* | ||
* The references to the "User" macros below is for building the | ||
* ncargcc, ncargf90, nhlcc, etc, scripts. We don't want the | ||
* development stuff (like the CtoFLibraries) jammed into those | ||
* scripts, like "/usr/local/lib/libcairo.a"; instead, we want | ||
* clean paths like "-lcairo". | ||
* #define CtoFLibraries -L/Users/Shared/homebrew/Cellar/gcc/12.2.0/lib/gcc/current -lgfortran -lquadmath | ||
* #define CtoFLibrariesUser -L/Users/Shared/homebrew/Cellar/gcc/12.2.0/lib/gcc/current -lgfortran -lquadmath | ||
*/ | ||
#define DEBUG 1 | ||
#define HdfDefines -DDARWIN | ||
#define StdDefines -DSYSV -D_POSIX_SOURCE -D_XOPEN_SOURCE -DByteSwapped -D__UNIXOS2__ -D_DARWIN_C_SOURCE | ||
#define ByteSwapped | ||
#define Cstatic | ||
#define Cdynamic | ||
#define CppCommand '/usr/bin/cpp -traditional' | ||
#define CCompiler gcc-12 | ||
#define CxxCompiler g\+\+-12 | ||
#define FCompiler gfortran-12 | ||
#define CcOptions -ansi -fPIC -Wall -std=c99 -Wno-error=implicit-function-declaration -O | ||
#define FcOptions -fPIC -fno-range-check -Wall -fallow-argument-mismatch -fallow-invalid-boz -O | ||
#define CtoFLibraries -lgfortran -lquadmath | ||
#define CtoFLibrariesUser -lgfortran -lquadmath | ||
#define XToolLibrary -lXt -lSM -lICE | ||
#define BuildShared NO | ||
#define XLibrary -lXpm -lX11 -lXext | ||
|
||
#define LibSearchUser -L/opt/X11/lib | ||
#define IncSearchUser -I/opt/X11/include -I/opt/X11/include/freetype2 | ||
#define ExtraIncSearch -I/opt/X11/include/freetype2 | ||
|
||
#define ArchRecLibSearch -L/opt/X11/lib | ||
#define ArchRecIncSearch -I/opt/X11/include -I/opt/X11/include/freetype2 | ||
|
||
#define LexLibrary -ll | ||
|
||
FC = $(F77) | ||
|
||
/*************** Redefine Macros from Rules ********************************/ | ||
|
||
/* | ||
* Macro: MakeDir | ||
* | ||
* Description: This rule creates a directory - if a parent dir doesn't exist | ||
* it attempts to create it. | ||
*/ | ||
#ifndef MakeDir | ||
#define MakeDir(dir) @if (test ! -d dir); then ($(MKDIRHIER) dir); fi | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't disable the implicit function declaration error. This condition was made an error for a reason. It is important to fix it properly by declaring all functions before you use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe it used to be OK to have implicit declarations, but more recent compilers have started treating these as errors. I'm not the one to fix all those, and if I recall there are a lot of them.