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

openblas: Improve recipe plus conan v2 #17173

Closed
wants to merge 26 commits into from

Conversation

joakimono
Copy link
Contributor

Specify library name and version: openblas/*


@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit fc62160
openblas/0.3.17
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.20
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.10
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.13
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
openblas/0.3.15
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
openblas/0.3.12
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.23
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib

Copy link
Contributor

@samuel-emrys samuel-emrys left a comment

Choose a reason for hiding this comment

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

A few small changes, but looking pretty good!

recipes/openblas/all/conanfile.py Outdated Show resolved Hide resolved
@@ -19,134 +23,221 @@ class OpenblasConan(ConanFile):
"fPIC": [True, False],
"build_lapack": [True, False],
"use_thread": [True, False],
"use_openmp": [True, False],
"dynamic_arch": [True, False],
}
default_options = {
"shared": False,
"fPIC": True,
"build_lapack": False,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest if it's possible to build lapack without fortran (I thought this was just a C api that ultimately still needed to link to the fortran libs?), then we should build it by default.

Because of the requirement that all CCI packages must build with the defaults of their dependencies, this opens the door to a number of scientific packages that choke without lapack support.

Suggested change
"build_lapack": False,
"build_lapack": True,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since openblas v0.3.21, it is possible to build with LAPACK support without Fortran. A f2c (fortran to c) converted copy of LAPACK 3.9.0 is bundled, which completely avoids the need for a Fortran runtime, see https://github.com/xianyi/OpenBLAS/releases/tag/v0.3.21 why 3.9.0 and not newer. This allows us to provide LAPACK on CCI without a Fortran compiler. One related issues is #4509.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a check in config_options() that changes the default build_lapack to True if the version is new enough. Note that the recipe then will have different default options depending on package version. I do not know if this against CCI policy.

Copy link
Contributor

@samuel-emrys samuel-emrys May 3, 2023

Choose a reason for hiding this comment

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

If that's the case, I'm not sure it's desirable to introduce different defaults across versions. My intuition would be to keep it stable across versions (so keep "build_lapack": False), but this has to be balanced with the benefits of having lapack available to support other conan center packages. @uilianries @prince-chrismc can either of you weigh in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reminder to possibly weigh in regarding this suggested change. @uilianries @prince-chrismc.

Copy link
Member

Choose a reason for hiding this comment

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

This has been scheduled for discussion with the team, thanks a lot for your patience

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any update on this topic? I'm willing to forego setting "build_lapack": True for >=0.3.21, alternatively, build both [True, False] (if possible) if this could expedite the merging of this pull request.

recipes/openblas/all/conanfile.py Show resolved Hide resolved
@conan-center-bot

This comment has been minimized.

1 similar comment
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

joakimono added 2 commits May 8, 2023 12:00
    - Allow disabling AVX512 via env variable, workaround for conan-io#12705
    - Only make gfortran a dependency if actually used, related to conan-io#5910, conan-io#1867, conan-io#5338
    - Add latest OpenBLAS release version 0.3.23
    - Move replace_in_file to patches instead
    - Fix intel fortran compiler identification in OpenBLAS cmake
    - Allow build_lapack without fortran using C_LAPACK since 0.3.23
    - Disable AVX512 by default: builld servers usually have this, but most consumer PCs do not
    - Set build_lapack=True when it can be built without Fortran
@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented May 8, 2023

Hooks produced the following warnings for commit 7c334c4
openblas/0.3.20
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
openblas/0.3.15
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.17
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.10
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.13
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.12
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.23
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib

joakimono added 2 commits May 10, 2023 09:54
    - Allow disabling AVX512 via env variable, workaround for conan-io#12705
    - Only make gfortran a dependency if actually used, related to conan-io#5910, conan-io#1867, conan-io#5338
    - Add latest OpenBLAS release version 0.3.23
    - Move replace_in_file to patches instead
    - Fix intel fortran compiler identification in OpenBLAS cmake
    - Allow build_lapack without fortran using C_LAPACK since 0.3.23
    - Disable AVX512 by default: builld servers usually have this, but most consumer PCs do not
    - Set build_lapack=True when it can be built without Fortran
@joakimono joakimono force-pushed the openblas/modernize-for-v2 branch from 7c334c4 to 99f8b27 Compare May 10, 2023 07:54
@samuel-emrys
Copy link
Contributor

@joakimono I think force pushing impacts review state and makes it difficult to see the changes you're making, so i think it's preferable to just fix with commits over the top. It's all squashed when merged anyway

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@github-actions
Copy link
Contributor

Hooks produced the following warnings for commit b508230
openblas/0.3.20
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.17
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.15
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
openblas/0.3.12
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
openblas/0.3.10
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
openblas/0.3.13
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
openblas/0.3.23
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas_d.0.3.dylib, libopenblas_d.dylib, libopenblas_d.0.dylib
post_package(): WARN: [APPLE RELOCATABLE SHARED LIBS (KB-H077)] install_name dir of these shared libs is not @rpath: libopenblas.dylib, libopenblas.0.3.dylib, libopenblas.0.dylib

@conan-center-bot

This comment has been minimized.

@jiaoew1991
Copy link
Contributor

I am very happy to see that all the checks have passed. I have been following for a long time, and I am really looking forward to this PR being merged as soon as possible.

@conan-center-bot

This comment has been minimized.

@samuel-emrys
Copy link
Contributor

@uilianries @RubenRBS looks like the ci on this one has been down for a fair while - any chance of a nudge? Looks like it's ready for re-review as well. Would be good to get this one in.

@conan-center-bot

This comment has been minimized.

@AbrilRBS AbrilRBS self-assigned this Aug 16, 2023
Copy link
Member

@danimtb danimtb left a comment

Choose a reason for hiding this comment

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

Hi!
Thank you for your patience and contributions to improve the recipe.

@RubenRBS and I have been taking a closer look at this and came up with the following ideas:

  • Changing the default option "build_lapack" is something that should be avoided, as this is changing the expectations for consumers.
  • Adding the Fortran dependency, even the Fortran runtime, adds a lot of complexity and the compiler is something that is not covered on CCI so it will be difficult to test and maintain.
  • Changes in the recipe are so big and affect the old versions of the library with too many patches that make it difficult to review and maintain.

Our suggestions go more along the line:

  • Creating a different conanfile.py for the new changes to avoid dealing with the different quirks of older versions.
  • As commented above, since version 0.3.21 the requirement for Fortran is not needed, so this new conanfile should support 0.3.21 onwards only to make things easier.

We hope that the suggestions make sense and thanks again for your patience.

@AbrilRBS
Copy link
Member

Again, thanks for your patience, I'd like to mention that in the future, it's usually faster to stagger PR changes into multiple PRs instead of a big one like this, as it takes us less time to understand them if they their size is smaller :)

@joakimono
Copy link
Contributor Author

@danimtb, @RubenRBS : Should I apply the suggested simplifications here, or create a separate PR?

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 4 (a3d8899c72eb0cc87b6de0224c049f989ea525b6):

  • openblas/0.3.20:
    All packages built successfully! (All logs)

  • openblas/0.3.17:
    All packages built successfully! (All logs)

  • openblas/0.3.15:
    All packages built successfully! (All logs)

  • openblas/0.3.12:
    All packages built successfully! (All logs)

  • openblas/0.3.13:
    All packages built successfully! (All logs)

  • openblas/0.3.10:
    All packages built successfully! (All logs)

  • openblas/0.3.23:
    All packages built successfully! (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds may be required once they are on the v2 ready list

All green in build 4 (a3d8899c72eb0cc87b6de0224c049f989ea525b6):

  • openblas/0.3.20:
    All packages built successfully! (All logs)

  • openblas/0.3.17:
    All packages built successfully! (All logs)

  • openblas/0.3.15:
    All packages built successfully! (All logs)

  • openblas/0.3.13:
    All packages built successfully! (All logs)

  • openblas/0.3.12:
    All packages built successfully! (All logs)

  • openblas/0.3.10:
    All packages built successfully! (All logs)

  • openblas/0.3.23:
    All packages built successfully! (All logs)

@samuel-emrys
Copy link
Contributor

@danimtb, @RubenRBS : Should I apply the suggested simplifications here, or create a separate PR?

@joakimono given the response times for the conan team recently, my suggestion would be:

  • Keep this PR with the conan 2 migration and version bump, but remove the fortran improvements you've made
  • Open a new PR with the fortran improvements for a new recipe

For what it's worth this decision doesn't make a lot of sense to me - this isn't a fork of openblas, it just enables an alternate configuration. The only real change as far as the user is concerned is the change in default parameter (which doesn't have to be the case). I think that creating a new recipe will be more confusing to users rather than less, especially given the inability to document what recipes are for or how/when they should be used.

My personal opinion is that the benefit provided by changing the default parameter in the latest version far outweighs the downside of changing a default parameter. Still, I think it's pretty important to get a conan 2 compatible version of openblas in ASAP, so my suggestion would be to proceed as above and we can defer a more detailed conversation about where fortran compatibility belongs to a separate PR.

@danimtb
Copy link
Member

danimtb commented Sep 5, 2023

@samuel-emrys thanks for your suggestions above and the general intention to move this PR forward.

Just for clarification, I am not suggesting creating a new reference with the fortran improvements, but instead, keep them under the same openblas references but using a different conanfile.py.

I know that could lead to having to maintain 2 conanfiles.py, but I think the chanches since 0.3.21 are significantly important to start with a new recipe and it will ease the maintenance and review of it. Just how I see it.

@samuel-emrys
Copy link
Contributor

Just for clarification, I am not suggesting creating a new reference with the fortran improvements, but instead, keep them under the same openblas references but using a different conanfile.py.

Ah, understood. I misinterpreted your original statement to mean the creation of a new openblas-fortran or similar.

@stale
Copy link

stale bot commented Oct 15, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 15, 2023
@ghost ghost mentioned this pull request Jan 7, 2024
Copy link
Contributor

This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.

@github-actions github-actions bot closed this Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants