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

conda: Macros: add '-L' argument to the linker command #418

Merged
merged 1 commit into from
Mar 26, 2020

Conversation

phil-blain
Copy link
Member

PR checklist

  • Short (1 sentence) summary of your PR:
    add '-L' argument to the linker command under conda
  • 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.
    No test suite run. Tested this on my Ubuntu 17.04 system.
  • 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 Icepack 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/. A test build of the technical docs will be performed as part of the PR testing.)
    • Yes
    • No, does the documentation need to be updated at a later time?
      • Yes
      • No
  • Please provide any additional information or relevant details below:

On Linux, compiling CICE in serial mode under the conda environment
currently fails as the linker does not find the NetCDF libraries.

Compiling in parallel mode does work as the MPI compilation wrappers
seem to pass the necessary flag to the linker under the hood.

Explicitely tell the linker the location of the libraries using the
SLIBS variable in the Macros file. To be on the safe side, also do it
on macOS.

Sorry, something went wrong.

Partially verified

This commit is signed with the committer’s verified signature.
gsmet’s contribution has been verified via GPG key.
We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
On Linux, compiling CICE in serial mode under the conda environment
currently fails as the linker does not find the NetCDF libraries.

Compiling in parallel mode does work as the MPI compilation wrappers
seem to pass the necessary flag to the linker under the hood.

Explicitely tell the linker the location of the libraries using the
`SLIBS` variable in the Macros file. To be on the safe side, also do it
on macOS.
@phil-blain
Copy link
Member Author

@apcraig since I now have "triage" permission I can add labels and directly ask for reviews, super!

@phil-blain
Copy link
Member Author

Actually this is kind of a workaround, as it would work out of the box if our script were not using Tcsh: if you take a look at /path/to/miniconda/envs/cice/etc/conda/activate.d/ you will see that the conda compiler packages have activation scripts that set the appropriate standard environment variables (FC, LD, FFLAGS, LDFLAGS) when the environment is activated, but these scripts are just for Bash and do not have a Csh version.

This means that if we do conda activate cice && ./cice.build (instead of relying on the environment activation being done in the env file) it will work.

I'll see if I can open an issue on the repo for the conda-forge compilers to ask if they would be willing to add activation scripts for Csh (one can always ask !).

Copy link
Contributor

@eclare108213 eclare108213 left a comment

Choose a reason for hiding this comment

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

Serial CICE did not work when I tried it on my laptop a couple of months ago, and I hope that this fixes the problem. Makefiles are not my forte, so I'll let @apcraig approve.

@phil-blain
Copy link
Member Author

@apcraig apcraig merged commit 9040fe2 into CICE-Consortium:master Mar 26, 2020
@phil-blain phil-blain deleted the conda-env-serial branch June 3, 2020 19:28
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.

None yet

3 participants