conda-forge / lapack-feedstock

A conda-smithy repository for lapack.
BSD 3-Clause "New" or "Revised" License
6 stars 12 forks source link

"lapack" package should be removed #33

Closed phil-blain closed 4 years ago

phil-blain commented 4 years ago

I have an environment created from a very simple spec:

channels:
  - conda-forge
  - nodefaults
dependencies:
# Build dependencies
  - compilers

This results in libgfortran being at version 4:

ls -l $CONDA_PREFIX/lib|grep libgfortran
-rwxrwxr-x   8 Philippe  staff   1.8M Aug 19  2019 libgfortran.4.dylib*
-rw-rw-r--   8 Philippe  staff   2.6M Aug 19  2019 libgfortran.a
lrwxr-xr-x   1 Philippe  staff    19B Mar 17 16:31 libgfortran.dylib@ -> libgfortran.4.dylib
-rw-rw-r--   1 Philippe  staff   268B Mar 17 16:31 libgfortran.spec

If I then install the lapack package (conda install lapack), it installs libgfortran.3.dylib and links the non-versioned symlink to this version:

$ conda install lapack
...
## Package Plan ##

  environment location: /Users/Philippe/Logiciels/miniconda3/envs/cice-lean-broken

  added / updated specs:
    - lapack

The following NEW packages will be INSTALLED:

  lapack             conda-forge/osx-64::lapack-3.6.1-0
  libgcc             conda-forge/osx-64::libgcc-4.8.5-1

$ ls -l $CONDA_PREFIX/lib|grep libgfortran
-rwxr-xr-x   4 Philippe  staff   1.2M Sep 18  2015 libgfortran.3.dylib*
-rwxrwxr-x   8 Philippe  staff   1.8M Aug 19  2019 libgfortran.4.dylib*
-rw-rw-r--   8 Philippe  staff   2.6M Aug 19  2019 libgfortran.a
lrwxr-xr-x   1 Philippe  staff    19B Mar 17 16:33 libgfortran.dylib@ -> libgfortran.3.dylib
-rw-rw-r--   1 Philippe  staff   268B Mar 17 16:31 libgfortran.spec

This then results in any program built by gfortran (in this environment) to use version 3:

$ otool -L cice
cice:
    ...
    @rpath/./libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
    ...

and the program segfaults at runtime in libgfortran (symbol _gfortran_reshape_c16) when the program uses array section indexing (eg. field_data(:,:,arg,:))...

Discussion with @isuruf on Gitter indicated this old package should be removed to prevent such errors, as the "lapack" package is very old ("liblapack" should be used instead).

@isuruf

phil-blain commented 4 years ago

Even worse, if I do conda install --revision 0 to try to go back to the state I was in before installing the "lapack" package, this removes all non-versioned symlinks (and the dylib they point to) for libraries that are at the same versions between revision 0 and revision 1.

This is really bad, as after conda install --revision 0 I find myself with an environment without any version whatsoever of libquadmath (which in itself means I can't compile with GFortran) and libgcc_s.1 (and no dynamic version of libgomp).

Also the non-versioned symlink for libgfortran is gone, only the libgfortran.4.dylib is left...

@isuruf should that be considered a bug in conda ?

isuruf commented 4 years ago

If there are two packages with the same contents then one of them overrides another. You'll have to create a new environment. Or install libgfortran with the --force option

phil-blain commented 4 years ago

I'm not sure I understand.... in my opinion doing conda install --revision 0 should return my environment exactly as it was in version 0, no ? Now it's missing some pieces. You are right that I can reinstall these missing pieces manually but I would assume I would not have to do that.

isuruf commented 4 years ago

I have no idea. I haven't used revision before.

phil-blain commented 4 years ago

Anyway thanks for your help! I'll open an issue in conda for the revision stuff.

jakirkham commented 4 years ago

If you are missing pieces, then it probably means those packages were cleared from your cache. I'm not sure if the revision feature will download them again (if so, how it does this is interesting) or just fail. That would be something worth checking.

phil-blain commented 4 years ago

@isuruf regarding the deletion of the "lapack" package, is there something I can do to help with that ? or does an admin have to do it ? can they simply be tagged broken ?

isuruf commented 4 years ago

@phil-blain, instead of removing, I think we should add a new output to this recipe called lapack that has liblapack as a requirement.