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

Enable conda packages on the Mac #4

Open
hansenms opened this issue Feb 9, 2022 · 8 comments
Open

Enable conda packages on the Mac #4

hansenms opened this issue Feb 9, 2022 · 8 comments
Assignees

Comments

@hansenms
Copy link
Member

hansenms commented Feb 9, 2022

We need to move through all the packages and make sure they build on the mac and add cross compile build job.

@roopchansinghv
Copy link
Member

Went through building ISMRMRD on macOS, and pushed a few changes to another branch here.

I have to admit, I can't see how compilation succeeds with the PugiXML Conda package included, and since we already include PugiXML with ISMRMRD, I would recommend removing that Conda package.

The other issue here is I got away with as few changes to the meta.yml file as I did here, as I ended up using an additional "-c conda-forge" argument for creating the environment, building the ISMRMRD Conda package, then finally installing the Conda package. We should discuss if for the Mac, we want to dial back package version requirements, so the "main" / default osx-64 Conda repository works, or if we are okay recommending using the package versions in Conda-Forge, and maintain better parity with the linux-x86-64 builds.

@hansenms
Copy link
Member Author

Looking at the CMakeLists file, I can see now that it actually defaults to using the pugixml that is included in the repo. We should maybe try to build with the one in the conda package, since it would be newer and sometimes XML parsers have some security problems. Moreover, we use pugixml in the Gadgetron, so I think it is a leftover requirement from there. I will take a look and see what the best path might be.

As for conda-forge packages, I think they are fine we rely on a bunch of them in various packages. However, I am not sure what you mean by an additional -c conda-forge requirement. The ./build.sh adds conda-forge from the gobals.yaml file already, so you should not need anything in addition to that.

On dialing back the requirements, I think it is important that we use the versions we will need to use in the Gadgetron. Since the binary compatibility stuff is tricky here, we should aim for the versions we will need to build the Gadgetron in the end. The goal is not only to get ISMRMRD to build, but also to make a conda package of ismrmrd that is compatible with what the Gadgetron would need. But we should as you suggest discuss all of this.

@hansenms
Copy link
Member Author

Quick comment on your branch. I think we should take advantage of the jinja templates to select different packages for Mac and Linux: https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#preprocessing-selectors

@roopchansinghv
Copy link
Member

roopchansinghv commented Feb 15, 2022

Thanks for that pointer - I glossed over it when I was going through the build tutorials, but have incorporated it into the latest commits I will push to the OS X build branch shortly.

I've also tried pushing the locally installable and working packages to my own personal space on Anaconda, but might it make more sense to add these to the Gadgetron's Anaconda space?

@hansenms
Copy link
Member Author

I think ultimately, we want to have the build pipeline run on both mac and Linux build machines and push to the main gadgetron channel. If you checkout the github workflows documentation on this: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#choosing-github-hosted-runners

We will probably want to refactor slightly since the commands to build will be the same on Linux and Mac. But we would essentially have a repeat of this file: https://github.com/gadgetron/gadgetron-conda-recipes/blob/master/.github/workflows/build.yml but with runs-on: macos-11 or something like that. You can experiment with it if you put up a PR because that will trigger the pipeline.

@roopchansinghv
Copy link
Member

roopchansinghv commented Feb 16, 2022

I went into each directory and built each package individually, at least to try to work out the issues with each one on Mac. This means I did not use the 'root level' build.sh script initially, so I did not have conda-forge included by default as a channel - so that takes care of that issue above, and the package version questions. The default Mac channels seem to lag behind conda-forge by a couple of minor release versions, so that issue is also addressed. There are still a couple of packages on conda-forge where the OS X is behind the Linux-64 versions, but I don't see these

I have also managed to get everything except the main Gadgetron package building locally on my Mac. Depending on how that goes, I will push the remaining changes, and set up a PR to trigger the test builds.

@roopchansinghv
Copy link
Member

Okay, so it seems that all of the support packages are now building on both the GitHub test environment, and on macOS.

What else needs to be done before tackling the issues I raised here with compiling Gadgetron on macOS?

@hansenms
Copy link
Member Author

I think we need to exercise this in the build pipeline. So we need to have the github action build on mac. We can for now restrict it to only the support packages, but if we get that working and push those, they you have a setup for working through the compiling issues on the Gadgetron side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants