Skip to content

Commit

Permalink
configure: add option to enable/disable libnuma
Browse files Browse the repository at this point in the history
It is not supported or not useful in some Linux environments, so allow
disabling it.
  • Loading branch information
jstebbins committed Apr 15, 2019
1 parent d572956 commit a144fd3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 2 deletions.
4 changes: 4 additions & 0 deletions contrib/x265_10bit/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ X265_10.CONFIGURE.static =
X265_10.CONFIGURE.shared = -DENABLE_SHARED=OFF
X265_10.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF

ifneq (1,$(FEATURE.numa))
X265_10.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
endif

ifneq (none,$(X265_10.GCC.g))
X265_10.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
else
Expand Down
4 changes: 4 additions & 0 deletions contrib/x265_12bit/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ X265_12.CONFIGURE.static =
X265_12.CONFIGURE.shared = -DENABLE_SHARED=OFF
X265_12.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DMAIN12=ON

ifneq (1,$(FEATURE.numa))
X265_12.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
endif

ifneq (none,$(X265_12.GCC.g))
X265_12.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
else
Expand Down
4 changes: 4 additions & 0 deletions contrib/x265_8bit/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ X265_8.CONFIGURE.static =
X265_8.CONFIGURE.shared = -DENABLE_SHARED=OFF
X265_8.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=OFF -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON

ifneq (1,$(FEATURE.numa))
X265_8.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
endif

ifneq (none,$(X265_8.GCC.g))
X265_8.CONFIGURE.extra += -DCMAKE_BUILD_TYPE=Debug
else
Expand Down
9 changes: 8 additions & 1 deletion gtk/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ AC_ARG_ENABLE(x265,
AS_HELP_STRING([--enable-x265], [enable x265 encoder]),
use_x265=yes, use_x265=no)

AC_ARG_ENABLE(numa,
AS_HELP_STRING([--enable-numa], [enable x265 NUMA support]),
use_numa=yes, use_numa=no)

AC_ARG_ENABLE(qsv,
AS_HELP_STRING([--enable-qsv], [enable QSV encoder]),
use_qsv=yes, use_qsv=no)
Expand Down Expand Up @@ -186,7 +190,10 @@ if test "x$use_fdk_aac" = "xyes" ; then
fi

if test "x$use_x265" = "xyes" ; then
HB_LIBS="$HB_LIBS -lx265 -lnuma"
HB_LIBS="$HB_LIBS -lx265"
if test "x$use_numa" = "xyes" ; then
HB_LIBS="$HB_LIBS -lnuma"
fi
fi

if test "x$use_qsv" = "xyes" ; then
Expand Down
3 changes: 3 additions & 0 deletions gtk/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ endif

ifeq (1,$(FEATURE.x265))
GTK.CONFIGURE.extra += --enable-x265
ifeq (1,$(FEATURE.numa))
GTK.CONFIGURE.extra += --enable-numa
endif
endif

ifeq (1,$(FEATURE.qsv))
Expand Down
5 changes: 5 additions & 0 deletions make/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,6 +1238,10 @@ def createCLI( cross = None ):
grp.add_argument( '--enable-x265', dest="enable_x265", default=True, action='store_true', help=(( 'enable %s' %h ) if h != argparse.SUPPRESS else h) )
grp.add_argument( '--disable-x265', dest="enable_x265", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) )

h = IfHost( 'x265 NUMA support', '*-*-linux', none=argparse.SUPPRESS ).value
grp.add_argument( '--enable-numa', dest="enable_numa", default=True, action='store_true', help=(( 'enable %s' %h ) if h != argparse.SUPPRESS else h) )
grp.add_argument( '--disable-numa', dest="enable_numa", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) )

h = IfHost( 'FDK AAC audio encoder', '*-*-*', none=argparse.SUPPRESS ).value
grp.add_argument( '--enable-fdk-aac', dest="enable_fdk_aac", default=False, action='store_true', help=(( 'enable %s' %h ) if h != argparse.SUPPRESS else h) )
grp.add_argument( '--disable-fdk-aac', dest="enable_fdk_aac", action='store_false', help=(( 'disable %s' %h ) if h != argparse.SUPPRESS else h) )
Expand Down Expand Up @@ -1821,6 +1825,7 @@ class Tools:
doc.add( 'FEATURE.vce', int( options.enable_vce ))

doc.add( 'FEATURE.x265', int( options.enable_x265 ))
doc.add( 'FEATURE.numa', int( options.enable_x265 and options.enable_numa ))

if host.match( '*-*-darwin*' ) and options.cross is None:
doc.add( 'FEATURE.xcode', int( not (Tools.xcodebuild.fail or options.disable_xcode) ))
Expand Down
5 changes: 4 additions & 1 deletion test/module.defs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ ifeq ($(BUILD.system),darwin)
TEST.GCC.f += IOKit CoreServices CoreText CoreGraphics AudioToolbox VideoToolbox CoreMedia CoreVideo Foundation
TEST.GCC.l += iconv
else ifeq ($(BUILD.system),linux)
TEST.GCC.l += pthread dl m numa
TEST.GCC.l += pthread dl m
ifeq (1, $(FEATURE.numa))
TEST.GCC.l += numa
endif
else ifeq ($(BUILD.system),kfreebsd)
TEST.GCC.l += pthread dl m
else ifeq ($(BUILD.system),freebsd)
Expand Down

0 comments on commit a144fd3

Please sign in to comment.