haskell / docker-haskell

MIT License
63 stars 37 forks source link

Cannot find -lnuma when building executables on arm64 image #81

Closed msakai closed 2 years ago

msakai commented 2 years ago

Building executable on arm64 image fails with cannot find -lnuma error.

% docker run --platform linux/arm64 -it haskell:8.10.7 bash
root@d04edf654535:/# echo "main = return ()" > test.hs
root@d04edf654535:/# ghc test.hs
[1 of 1] Compiling Main             ( test.hs, test.o )
Linking test ...
/usr/bin/ld.gold: error: cannot find -lnuma

rts/posix/OSMem.c:370:0: error:
     error: undefined reference to 'mbind'

rts/posix/OSMem.c:748:0: error:
     error: undefined reference to 'numa_num_configured_nodes'

rts/posix/OSMem.c:758:0: error:
     error: undefined reference to 'numa_get_mems_allowed'

rts/posix/OSMem.c:748:0: error:
     error: undefined reference to 'numa_num_configured_nodes'

rts/posix/OSMem.c:763:0: error:
     error: undefined reference to 'numa_bitmask_free'

rts/posix/OSMem.c:748:0: error:
     error: undefined reference to 'numa_num_configured_nodes'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

This can be fixed by installing libnuma-dev.

I think it would be friendly if libnuma-dev is installed by default.

AlistairB commented 2 years ago

Thanks, good pickup! I think it is reasonable that libnuma-dev should always be installed. It is included in the slim images but not the regular ones. Adding it now.

AlistairB commented 2 years ago

A new version including the package will be released when https://github.com/docker-library/official-images/pull/12871 is merged.