conda-forge / ghc-feedstock

A conda-smithy repository for ghc.
BSD 3-Clause "New" or "Revised" License
2 stars 14 forks source link

Build from source + cross compile ppc64le, aarch64 #14

Closed isuruf closed 3 years ago

isuruf commented 3 years ago

Checklist

conda-forge-linter commented 3 years ago

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

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

step21 commented 3 years ago

Thanks for this. For now I would suggest using 8.6.5 as that should work as far as I can tell. (based on the issue you linked https://gitlab.haskell.org/ghc/ghc/-/issues/16053)

step21 commented 3 years ago

Also, I notices aarch64 has a different error:

[291 of 291] Compiling Main             ( utils/ghc-cabal/Main.hs, bootstrapping/Main.o )
Linking utils/ghc-cabal/dist/build/tmp/ghc-cabal ...
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib64/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/../lib/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib64/libgmp.so when searching for -lgmp
/home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../lib/gcc/x86_64-conda-linux-gnu/7.5.0/../../../../x86_64-conda-linux-gnu/bin/ld: skipping incompatible /home/conda/feedstock_root/build_artifacts/ghc_1602178942944/_build_env/bin/../x86_64-conda-linux-gnu/sysroot/usr/lib/libgmp.so when searching for -lgmp
collect2: error: ld returned 1 exit status
`x86_64-conda-linux-gnu-gcc' failed in phase `Linker'. (Exit code: 1)
utils/genprimopcode/ghc.mk:19: utils/genprimopcode/dist/package-data.mk: No such file or directory
make[1]: *** [utils/ghc-cabal/ghc.mk:58: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Error 1
make: *** [Makefile:124: install] Error 2
isuruf commented 3 years ago

Feel free to push to this branch

step21 commented 3 years ago

thanks. in the meantime I pushed to my branch, x86_64 almost works, only fails test(s)/does not run as it complains about missing libtinfo.so.6. I am trying to just link it right now. aarch64 and ppc have some binary stripping issues as they complain about wrong library format.

step21 commented 3 years ago

removing -j${CPU_COUNT} should get rid of out of memory error, as at least x86_64 built successfully on my branch. ghc irc said that for other cross-compiling a custom build.mk should be necessary. though looking at x86 and ppc builds, it might not actually be necessary.

isuruf commented 3 years ago

https://github.com/conda-forge/ncurses-feedstock/pull/61 should fix aarch64 builds.

step21 commented 3 years ago

conda-forge/ncurses-feedstock#61

cool. Now just have to reduce memory :/ on an earlier version I managed to build on CI on x86_64 (using 8.2.2 or 8.4.4 I think) without running out of memory btw.

step21 commented 3 years ago

@conda-forge-admin, please restart ci

step21 commented 3 years ago

Seems like aarch compilation wants llvm.