-
Notifications
You must be signed in to change notification settings - Fork 121
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
ufs-srweather-app no longer builds successfully on MacOS #222
Comments
There are a couple of steps to build the srweather-app, with first one is to build the hpc-stack library collection, and the next one is to build the srweather-app. 1. Prerequisited for building the HPC-stack.Steps to build the hpc-stack libraries on MacOS x86_64 or M1 /arm64 are listed below. The documentation for the HPC-stack build is currently being updated. The following two options shown below have been tested; an example below is for the bash shell environment in the Terminal.app. 1.1. Install Homebrew and Xcode Command-Line Tools (CLT). Open Terminal.app and a web browser. Go to https://brew.sh, copy the command-line installation directive, and run it in a new Terminal window. Terminal will request a ‘sudo’ access password. The installation command would look similar to the following:
Alternative way of installing the Xcode command-line tools (CLT) done by the following: 1.2. Install GNU compiler Suite (e.g., version 11, with gcc, g++) and gfortran: Create symbolic links from the version-specific binaries to gcc and g++; a ‘sudo’ password may be requested. The path will likely be /opt/homebrew/bin/gcc-11 (Option 1), or 1.3. Install cmake utility via homebrew: 1.4. Install or upgrade make utility via homebrew: 1.5. Install Lmod, module management environment: 1.6. Install the libpng library: 1.7. Install wget: 1.8. Install or update python3. Verify python3 is installed and check the current version: 1.9. Install git and dependencies: 2. Building HPC-stack2.1. Download HPC-stack building code from github.com:
2.2. Configuration files are ./config/config.sh_ , where <machine> is <mac_m1_gnu> (Option 1) or <mac_gnu> (Option 2). List of libraries to be built for the hpc-stack and a few library-specific options are given in ./stack/stack.yaml_. 2.2. Verify the initialization of Lmod environment, or add it to the configuration file config/config.sh_, in a similar way it was done in #1.6: 2.3. Additionally, specify combination of compilers, python libraries used, and type of the MPI libraries, in the configuration file ./config/config.sh_ , e.g.:
2.4. When using gfortran higher than version 10, set the following flag in config_.sh:
2.5. Set environmental variables for compiler paths in config/config_.sh. Variable {GNU} is a directory where compiler binaries are located,
2.6. Specify the libraries to be built within the hpc-stack in the ./stack/stack_.yaml . The following flavors of MPI libraries have been successfully built: openmpi/4.1.2 (Option 1) mpich/3.3.2 (Option 2), e.g.:
2.7. Set building libpng library to NO in ./stack/stack.yaml_. (See #1.6.) . Leave the defaults for other libraries and versions in the 2.8. Set up the modules and the environment: where <machine> is “mac_m1_gnu” (Option 1), or “mac_gnu” (Option 2); and ${HPC_INSTALL_DIR} is the absolute path for the installation directory of the hpc-stack. You will be asked to choose whether or not you want to use "native" installations of python, compiler, and MPI. "Native" means that they are already installed on your system. Thus, you answer "YES" to python, "YES" to gnu compilers, and "NO" for MPI/mpich. NB: "-p" option requires an absolute path (full path) of the installation directory to be provided. 2.9. Building HPC-stack modules and libraries:
NB: “-m” option: it is needed to build separate modules for each library package. |
3. Building the SRW application3.1. Download the application:
A new directory ufs-srweather-app is created, which contains a git repository. Make this directory your SRW environmental variable:
3.2. Run the executable that pulls the SRW App components from external repositories:
3.3. Customization of the environment for building the SRW is done using scripts located in ${SRW}/env/, in particular, build__.env, where <platform> is macosx, is gnu for our build. and srw_common. The script build_macosx_gnu.env initializes the module environment, lists the location of hpc-stack modules, loads the meta-modules and modules, and sets compilers, additional flags and environment variables needed for building the SRW. ${HPC_INSTALL_DIR} variable is set to the installation directory for the hpc-stack. The srw_common contains a list of specific libraries and modules to be loaded, and it is sourced from the build_macosx_gnu.env .
Source the configuration file:
3.4. (Required for the Option 1, may be changed for Option 2 but not required.) Make the following change to the file ${SRW}/src/ufs-weather-model/FV3/atmos_cubed_sphere/CMakeLists.txt . Turn off the option for using QUAD_PRECISION, and change a line 35 to the following:
3.5. Build the SRW:
3.6. Verify that the following binaries are built in the directory ${SRW}/bin:
|
@natalie-perlin, thank you for the update and the thorough documentation! I will try this procedure on my MacOS machine today and I will update you on my results. |
@mkavulich - Updated the directions to build the HPC-stack and SRW on the Macs! |
@natalie-perlin Thanks for writing this up! I'm trying it with mac_m1_gnu, and building hpc-stack fails at hdf5. It is set with version 1.10.6 as-is, which I can't find as a branch on the repo, but even when trying something else there seems to be an issue with the way build_hdf5.sh sets up names for the directories as it clones and builds, and I haven't gotten to a workaround yet. Did you run into any issue like this? Thanks! |
@willmayfield - no issues building the hdf5 v.1.10.6... trying to attach my log hdf5.log ! hdf5.log |
@willmayfield - could this issue marked as resolved? |
Closing the issue. The builds are done on several Mac platforms (Intel/x86_64, M1/arm64) and OS versions (Darwin 19,20,21/ Catalina, Big Sur, Monterey). |
Description
See also ufs-community/regional_workflow#684
The original PR implementing MacOS capabilities on the develop branch (#539), instructions were provided in the form of a Google Doc (https://docs.google.com/document/d/14jlvL3nOi85NJCWSNnhHjjBsrAsR-mr8JfGFvVIybFI/edit). These tests worked at the time on my MacOS Catalina 10.15.7 machine, using gnu 9.4.0 compilers installed with Homebrew. However, the app will no longer build, specifically due to a UFS_UTILS compilation error as described below.
Steps to Reproduce
Additional Context
I have not been able to isolate exactly why this error is occurring. Nothing relevant in the fvcom_tools_lib.dir directory of UFS_UTILS seems to have changed since the last successful tests. I saw the same failure with both the develop branch and tag v1.2.0 of hpc-stack (the tag originally tested), and when I attempted to use the older hash from when this capability was first merged, I was met with CMake errors:
The only difference between the original tests and my current test is that my MacOS version has been updated; original tests were on MacOS Catalina (10.15.7), whereas my laptop has since been upgraded to MacOS Big Sur (11.6.4). I even re-installed Homebrew and the compilers and other packages installed, this had no effect.
Unfortunately I am short on hours for working on this project, so I am hoping someone else will be able to troubleshoot this issue in the near term.
The text was updated successfully, but these errors were encountered: