Skip to content
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 conda environment, fix Makefile and Macros, implement -nomodules #296

Merged
merged 6 commits into from
Feb 14, 2020

Conversation

phil-blain
Copy link
Member

PR checklist

  • Short (1 sentence) summary of your PR:
    Add a conda environment for macOS and Linux, mirroring Add conda environment to run on personal computers CICE#393
  • Developer(s):
    P. Blain
  • Suggest PR reviewers from list in the column to the right.
    @apcraig
  • Please copy the PR test results link or provide a summary of testing completed below.
    Did not run the tests suite. I tested that the procedure works on Mac and Linux.
  • How much do the PR code changes differ from the unmodified code?
    • bit for bit
    • different at roundoff level
    • more substantial
  • Does this PR create or have dependencies on CICE or any other models?
    • Yes
    • No
  • Does this PR add any new test cases?
    • Yes
    • No
  • Is the documentation being updated? ("Documentation" includes information on the wiki or in the .rst files from doc/source/, which are used to create the online technical docs at https://readthedocs.org/projects/cice-consortium-cice/.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:

This PR implements the conda environment for Icepack. The environment.yml file is simpler since Icepack has less dependencies. A few points:

  • I had to fix the Makefile to remove the faulty logic around CFLAGS_HOST, as in Add conda environment to run on personal computers CICE#393
  • I had to modify icepack.setup and setup_run_dirs.csh to implement the -nomodules logic which was already used by some env files but was ineffective.
  • As discussed yesterday I also fixed the Macros files for cheyenne and testmachine to use the correct environment variables for threading and PIO, as done in Macros fixes and diag_type fix CICE#396. Note that I did not change icepack.launch.csh to use omplace on cheyenne, as was done in Macros fixes and diag_type fix CICE#396. @apcraig I'll let you push directly to this branch if you want to add that, although I think it can be left for later as all test suites have 1x1 PEs so merging this PR will not switch on any threading on cheyenne.

The CFLAG_HOST variable was added in CICE-Consortium#257, and
some Makefile logic was added to define the variable to be blank if
the included Macros file does not define it.

However, the Make syntax is wrong, as 'ifndef' takes a variable name and
not
a reference to a variable [1], so

    ifndef $(CFLAGS_HOST)

should have been written

    ifndef CFLAGS_HOST

The effect of this error is to invert the logic of the check (!) since
if CFLAGS_HOST is defined, Make will check if a variable with name equal
to whatever CFLAGS_HOST is defined to be exists, which will most probably
be false, and the conditional will then evaluate to true and CFLAG_HOSTS
will be redefined to be blank, defeating the whole purpose of the flag.

Since there's no harm in Make referencing and empty variable, fix this
by just removing the conditional check.

[1] https://www.gnu.org/software/make/manual/html_node/Conditional-Syntax.html
These two files used outdated environment variables for
threading ("compile_threaded") and PIO ("IO_TYPE").

Replace these with the correct variables, ICE_THREADED and
ICE_IOTYPE.

Mirrors CICE-Consortium/CICE#396
Some env files wrap the calls for loading the build and run environment
in a conditional based on the argument `-nomodules`, so that
scripts that source the env file just to get the variables defined in it
do not run slower because they have to load the environment.

This logic was copied from CICE but was not implemented in the Icepack
scripts icepack.setup and setup_run_dirs.csh.

Add the argument '-nomodules' so that the logic becomes effective.
On Ubuntu and its derivatives, the csh shell at
/bin/csh, which is used in the shebangs of the Icepack scripts,
is not compatible with conda.

Mention that in the documentation and explain how to install tcsh as an
alternative, and configure the system such that /bin/csh points to
/bin/tcsh.
Copy link
Contributor

@apcraig apcraig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this on my Mac laptop using the updated documentation and everything works well. I will merge this in the next day or so unless there are any other comments.

@apcraig apcraig merged commit 03a9345 into CICE-Consortium:master Feb 14, 2020
@phil-blain phil-blain deleted the conda-env branch February 13, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants