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

[casacore] Add casacore port #31481

Closed
wants to merge 26 commits into from
Closed

Conversation

sjperkins
Copy link
Contributor

@sjperkins sjperkins commented May 17, 2023

  • Changes comply with the maintainer guide
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.
@sjperkins sjperkins marked this pull request as draft May 17, 2023 13:25
@sjperkins
Copy link
Contributor Author

ports/casacore/001-casacore-cmake.patch Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Show resolved Hide resolved
ports/casacore/portfile.cmake Outdated Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Outdated Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Outdated Show resolved Hide resolved
@FrankXie05 FrankXie05 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label May 18, 2023
SOURCE_PATH "${src}"
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_PYTHON=OFF

Choose a reason for hiding this comment

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

Any reason not to include the python build here? Without it it will not be possible to link python-casacore against this build

Should likely also set DCMAKE_BUILD_TYPE=Release

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 reason not to include the python build here? Without it it will not be possible to link python-casacore against this build

This disables PYTHON 2 support by default -- I don't believe python-casacore is building python 2 wheels these days

https://github.com/casacore/python-casacore/tree/master/.github/workflows

Should likely also set DCMAKE_BUILD_TYPE=Release

A vcpkg install casacore will install both Release and Debug builds.

Copy link

@bennahugo bennahugo May 24, 2023

Choose a reason for hiding this comment

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

Ah ok sorry I think I was confused. Yes this is the default:

option (BUILD_PYTHON "Build the python2 bindings" NO)
option (BUILD_PYTHON3 "Build the python3 bindings" YES)

While we are here it may be advisable to still include deprecated containers and functionality - I think the synthesis library from casarest and some of the classes in casacore are still in active use in Meqtrees / makems (the sarao version)
option (BUILD_DEPRECATED "build and install deprecated classes (such as Map)" YES)

Copy link
Contributor Author

@sjperkins sjperkins May 24, 2023

Choose a reason for hiding this comment

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

OK, I'll add a feature option for BUILD_DEPRECATED

Also /cc'ing @rtobar so that someone from the casacore project can take a quick look at this.

Copy link

Choose a reason for hiding this comment

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

Full disclosure: I'm only a semi-regular casacore contributor, but not part of the core team (e.g., I don't have write access).

I agree with the BUILD_PYTHON* discussion, it should definitely be built against python3 and not against python2.7. And from what I know, BUILD_DEPRECATED is still needed by a number of packages that haven't been ported to the more recent casacore releases where this was implemented (3.1 I think, so ~4 years ago "only").

SOURCE_PATH "${src}"
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_PYTHON=OFF
Copy link

Choose a reason for hiding this comment

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

Full disclosure: I'm only a semi-regular casacore contributor, but not part of the core team (e.g., I don't have write access).

I agree with the BUILD_PYTHON* discussion, it should definitely be built against python3 and not against python2.7. And from what I know, BUILD_DEPRECATED is still needed by a number of packages that haven't been ported to the more recent casacore releases where this was implemented (3.1 I think, so ~4 years ago "only").

ports/casacore/001-casacore-cmake.patch Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Outdated Show resolved Hide resolved
ports/casacore/001-casacore-cmake.patch Outdated Show resolved Hide resolved
Copy link

@rtobar rtobar left a comment

Choose a reason for hiding this comment

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

Leaving a few comments after being summoned here

@sjperkins
Copy link
Contributor Author

I did some investigation around making the Python builds work. Briefly when asked to compile Python3 support, casacore will link against Boost.Python and a specific Python ABI. This is primarily for building the python-casacore wheels. it seems there are three options here:

  1. Using the vcpkg python3 (3.10) port, install numpy in a virtual environment and build the casacore python3 against this. The downside here is that this restricts any builds to the py310 ABI. It may be possible to add, for instance python38, python39 and python310 features so that the developer can choose which ABI to build against, but the default python3 port is still 3.10 and it doesn't seem possible to override the python version in the features, only globally for the port with the overrides directive. Related issues:

  2. Depend on an external python3 installation, with numpy appropriately installed. I've tried this but vcpkg_find_acquire_program(PYTHON3) still seems to find the vcpkg python3.10 port, rather than, for example, the system python.

  3. Disable python3 support for the moment and create a vcpkg feature request issue for this to be added in future.

I don't need python3 support at the moment so I'm happy to go with (3).

@FrankXie05 can you suggest any improvements on (1) and (2)?

@sjperkins
Copy link
Contributor Author

  1. Using the vcpkg python3 (3.10) port, install numpy in a virtual environment and build the casacore python3 against this. The downside here is that this restricts any builds to the py310 ABI. It may be possible to add, for instance python38, python39 and python310 features so that the developer can choose which ABI to build against, but the default python3 port is still 3.10 and it doesn't seem possible to override the python version in the features, only globally for the port with the overrides directive. Related issues:
    @FrankXie05 can you suggest any improvements on (1) and (2)?

Ah, according to this, overlays should be used (and not separate python3y features as I suggested above)

Do not use features to implement alternatives

Features must be treated as additive functionality. If port[featureA] installs and port[featureB] installs, then port[featureA,featureB] must install. Moreover, if a second port depends on [featureA] and a third port depends on [featureB], installing both the second and third ports should have their dependencies satisfied.

Libraries in this situation must choose one of the available options as expressed in vcpkg, and users who want a different setting must use overlay ports at this time.

"version": "3.5.0",
"description": "The casacore libraries",
"homepage": "https://casacore.github.io/",
"supports": "!osx & !windows",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Official builds only run linux: https://github.com/casacore/casacore/tree/master/docker

I'm primarily interested in a linux casacore port

@sjperkins
Copy link
Contributor Author

Regarding Python builds, it looks like they'd be a fair amount of work to get right. I don't personally need them right now, so I'd provide to disable this feature and log an issue for it.

Similarly for other non-core features like ADIOS2

@sjperkins sjperkins closed this Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
4 participants