Opened 13 months ago

Last modified 12 months ago

#15688 new bug

HAVE_LIBNUMA is defined as non-zero even when libnuma does not exist

Reported by: osa1 Owned by:
Priority: normal Milestone:
Component: Build System (make) Version: 8.6.1
Keywords: Cc:
Operating System: Linux Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

I think this is a regression introduced in the last few weeks.

The libnuma dependency is checked correctly by the configure script, but somehow when I don't have libnuma installed I still have HAVE_LIBNUMA defined as non-zero so I end up with this error:

/usr/bin/x86_64-linux-gnu-ld.gold: error: cannot find -lnuma

rts/posix/OSMem.c:368:0: error:
     error: undefined reference to 'mbind'
    |
368 |     if (RtsFlags.GcFlags.numa) {
    | ^

rts/posix/OSMem.c:670:0: error:
     error: undefined reference to 'numa_num_configured_nodes'
    |
670 | }
    | ^

rts/posix/OSMem.c:680:0: error:
     error: undefined reference to 'numa_get_mems_allowed'
    |
680 |
    | ^

rts/posix/OSMem.c:670:0: error:
     error: undefined reference to 'numa_num_configured_nodes'
    |
670 | }
    | ^

rts/posix/OSMem.c:685:0: error:
     error: undefined reference to 'numa_bitmask_free'
    |
685 |     mask = numa_get_mems_allowed();
    | ^

rts/posix/OSMem.c:670:0: error:
     error: undefined reference to 'numa_num_configured_nodes'
    |
670 | }
    | ^
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
utils/ghc-cabal/ghc.mk:56: recipe for target 'utils/ghc-cabal/dist/build/tmp/ghc-cabal' failed

Installing libnuma-dev fixes this.

Relevant lines in config.log:

CabalHaveLibNuma='False'
#define HAVE_LIBNUMA 0

I have no idea why HAVE_LIBNUMA is not 0 when compiling the file.

Change History (2)

comment:1 Changed 13 months ago by bgamari

Can you confirm that includes/ghcautoconf.h also sets HAVE_LIBNUMA to 0?

comment:2 Changed 12 months ago by bgamari

Component: Build SystemBuild System (make)

The new Hadrian build system has been merged. Relabeling the tickets concerning the legacy make build system to prevent confusion.

Note: See TracTickets for help on using tickets.