conda-forge / gromacs-feedstock

A conda-smithy repository for gromacs.
BSD 3-Clause "New" or "Revised" License
0 stars 9 forks source link

Arch Migrator: Use cross-compilation for Linux aarch64 && ppc64le #49

Closed martin-g closed 1 month ago

martin-g commented 5 months ago

The PR is based on https://github.com/conda-forge/gromacs-feedstock/pull/43 but uses cross-compilation for Linux ARM64 and PPC64LE because TravisCI is very unreliable!

Checklist

conda-forge-webservices[bot] commented 5 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

I do have some suggestions for making it better though...

For recipe:

martin-g commented 5 months ago

@conda-forge-admin, please rerender

martin-g commented 5 months ago

@conda-forge-admin, please rerender

conda-forge-webservices[bot] commented 5 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

mabraham commented 5 months ago

Probably should bump the build number when it works. I have no idea how the cross compilation works, but if the tests pass then LGTM!

martin-g commented 5 months ago

The Linux ARM64 build fails with:

-- Performing Test CXX_COMPILE_WORKS_WITHOUT_SPECIAL_FLAGS
CMake Error at cmake/gmxManageSimd.cmake:50 (message):
  Cannot find SSE2 compiler flag.  Use a newer compiler, or disable SIMD
  support (slow).
martin-g commented 5 months ago

Does Gromacs support ppc64le ? What value for simdflavors should be used for it ? https://github.com/conda-forge/gromacs-feedstock/blob/00543141c1f0d3904eee62a3450eb869e8aae7b6/recipe/build.sh#L9C5-L9C16

conda-forge-webservices[bot] commented 5 months ago

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict. Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

conda-forge-webservices[bot] commented 5 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

mabraham commented 5 months ago

Does Gromacs support ppc64le ? What value for simdflavors should be used for it ? https://github.com/conda-forge/gromacs-feedstock/blob/00543141c1f0d3904eee62a3450eb869e8aae7b6/recipe/build.sh#L9C5-L9C16

Yes I think so. Use IBM_VSX. See https://manual.gromacs.org/current/install-guide/index.html#simd-support

martin-g commented 5 months ago

It builds fine now for Linux ARM64 but some test(s) fail - https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/940372/logs/82

martin-g commented 5 months ago

The problem is with the hardware_info_command:

++ cat /proc/cpuinfo '|' grep -m1 ''\''^flags'\'''
2024-05-22T11:32:25.7458593Z cat: invalid option -- 'm'

Currently https://github.com/conda-forge/gromacs-feedstock/pull/49/files#diff-d7075654874cb08007a21aaab3ecd4b3453a9087e7505d034d548b8938b599bcR176 uses only uname -m to detect the CPU architecture but since this is a cross-compilation it thinks it is x86_64 and tries to detect the AVX flavors ...

I am not sure why cat /proc/cpuinfo | grep -m1 ... says that cat does not have -m argument ...

mabraham commented 5 months ago

The problem is with the hardware_info_command:

++ cat /proc/cpuinfo '|' grep -m1 ''\''^flags'\'''
2024-05-22T11:32:25.7458593Z cat: invalid option -- 'm'

Currently https://github.com/conda-forge/gromacs-feedstock/pull/49/files#diff-d7075654874cb08007a21aaab3ecd4b3453a9087e7505d034d548b8938b599bcR176 uses only uname -m to detect the CPU architecture but since this is a cross-compilation it thinks it is x86_64 and tries to detect the AVX flavors ...

The script built via the bash heredoc runs when a user tries to use GROMACS. In general, a platform might support multiple SIMD flavours for which we have pre-compiled different binaries. This script decides which one to use. As such, it isn't going to work properly in a cross-compilation setup, but we don't need it to do that because we anyway can't run anything (including tests) without having the target hardware available. I assume you saw the error after the build and install completed when something tried to run a test. So I think the best approach is to leave the heredoc unmodified and instead don't try to run anything when we are cross compiling.

I am not sure why cat /proc/cpuinfo | grep -m1 ... says that cat does not have -m argument ...

Me neither

mabraham commented 5 months ago

It builds fine now for Linux ARM64 but some test(s) fail - https://dev.azure.com/conda-forge/84710dde-1620-425b-80d0-4cf5baca359d/_apis/build/builds/940372/logs/82

Link doesn't load anything for me

martin-g commented 5 months ago

and install completed when something tried to run a test

Yes! I think it happens before the test phase starts I wonder how the osx-arm64 tests worked until now since they also use cross-compilation.

martin-g commented 5 months ago

I think the tcsh script would break for the cross-compiled archs - https://github.com/conda-forge/gromacs-feedstock/pull/49/files#diff-d7075654874cb08007a21aaab3ecd4b3453a9087e7505d034d548b8938b599bcR215 This evaluates eagerly the cpu architecture at build time and it is wrong later at run time.

martin-g commented 5 months ago

@conda-forge-admin, please rerender

martin-g commented 5 months ago

Nice! The build is green now! If #50 is merged first then I will rebase this PR! But this PR also includes the improvements in #50, so #50 could be closed if you are OK to merge two "features" at once.

mabraham commented 5 months ago

I merged #50 so we can see clearly in the history what happened when if we later run into issues

martin-g commented 5 months ago

@conda-forge-admin, please rerender

martin-g commented 4 months ago

@conda-forge-admin, please rerender

martin-g commented 4 months ago

@conda-forge-admin, please rerender

conda-forge-webservices[bot] commented 2 months ago

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

martin-g commented 2 months ago

@conda-forge-admin, please rerender

martin-g commented 2 months ago

The 4 failing PR checks fail with failed with error: [Errno 28] No space left on device ... Any ideas what could be done to overcome this ?

martin-g commented 2 months ago

@conda-forge-admin, please rerender

martin-g commented 2 months ago

Progress! Now the build fails with

aarch64-conda-linux-gnu/bin/ld: /usr/local/cuda/lib64/libcudart_static.a: error adding symbols: file in wrong format
markjens commented 2 months ago

+1 for adding linux-aarch64 support for Gromacs's conda ! @martin-g It seems you are very close here! Can you finish this PR ?

martin-g commented 2 months ago

@martin-g It seems you are very close here! Can you finish this PR ?

I very much would like to but I am not sure why it breaks ... It fails only for CUDA 11.8 and double=no. I've found a similar issue:

martin-g commented 2 months ago

@conda-forge-admin, please ping team

conda-forge-webservices[bot] commented 2 months ago

Hi! This is the friendly automated conda-forge-webservice.

I was asked to ping @conda-forge/gromacs and so here I am doing that.

martin-g commented 1 month ago

@conda-forge-admin, please rerender

mabraham commented 1 month ago

Skipping seems like the practical solution. Few will use GROMACS with conda on ppc and need cuda

martin-g commented 1 month ago

Thanks for the feedback, @mabraham ! More opinions ? I hope the PR will be merged soon!