Allow enable / disable opencl at build time.

Change-Id: I65e2a71aae8317930d1575e7d82c11c3fd2b74de
This commit is contained in:
Kohei Yoshida
2013-09-11 17:46:35 -04:00
committed by Markus Mohrhard
parent f1717208ec
commit 03f548e6fb
7 changed files with 43 additions and 3 deletions

View File

@@ -155,9 +155,9 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,calc, \
sc \ sc \
scd \ scd \
scfilt \ scfilt \
scopencl \
scui \ scui \
solver \ solver \
$(if $(ENABLE_OPENCL),scopencl) \
$(if $(DISABLE_SCRIPTING),,vbaobj) \ $(if $(DISABLE_SCRIPTING),,vbaobj) \
$(if $(ENABLE_TELEPATHY),tubes) \ $(if $(ENABLE_TELEPATHY),tubes) \
)) ))

View File

@@ -147,6 +147,7 @@ export ENABLE_NPAPI_INTO_BROWSER=@ENABLE_NPAPI_INTO_BROWSER@
export ENABLE_ONLINE_UPDATE=@ENABLE_ONLINE_UPDATE@ export ENABLE_ONLINE_UPDATE=@ENABLE_ONLINE_UPDATE@
export ENABLE_OOENV=@ENABLE_OOENV@ export ENABLE_OOENV=@ENABLE_OOENV@
export ENABLE_OPENGL=@ENABLE_OPENGL@ export ENABLE_OPENGL=@ENABLE_OPENGL@
export ENABLE_OPENCL=@ENABLE_OPENCL@
export ENABLE_PACKAGEKIT=@ENABLE_PACKAGEKIT@ export ENABLE_PACKAGEKIT=@ENABLE_PACKAGEKIT@
export ENABLE_PCH=@ENABLE_PCH@ export ENABLE_PCH=@ENABLE_PCH@
export ENABLE_PDFIMPORT=@ENABLE_PDFIMPORT@ export ENABLE_PDFIMPORT=@ENABLE_PDFIMPORT@

View File

@@ -67,6 +67,13 @@
#define HAVE_FEATURE_MULTIUSER_ENVIRONMENT 0 #define HAVE_FEATURE_MULTIUSER_ENVIRONMENT 0
/*
* Whether we have the OpenCL headers and should compile in any
* support for that abstraction.
*/
#define HAVE_FEATURE_OPENCL 0
/* /*
* Whether the OS has Avahi support, * Whether the OS has Avahi support,
* This library is used for zeroconf service publication on the local network * This library is used for zeroconf service publication on the local network

View File

@@ -917,6 +917,10 @@ AC_ARG_ENABLE(opengl,
AS_HELP_STRING([--disable-opengl], AS_HELP_STRING([--disable-opengl],
[Determines whether to build the OpenGL 3D slide transitions component.])) [Determines whether to build the OpenGL 3D slide transitions component.]))
AC_ARG_ENABLE(opencl,
AS_HELP_STRING([--disable-opencl],
[Determines whether to build with OpenCL support.]))
AC_ARG_ENABLE(dbus, AC_ARG_ENABLE(dbus,
AS_HELP_STRING([--disable-dbus], AS_HELP_STRING([--disable-dbus],
[Determines whether to enable features that depend on dbus. [Determines whether to enable features that depend on dbus.
@@ -10222,6 +10226,26 @@ fi
AC_SUBST(SYSTEM_MESA_HEADERS) AC_SUBST(SYSTEM_MESA_HEADERS)
AC_SUBST(ENABLE_OPENGL) AC_SUBST(ENABLE_OPENGL)
dnl =================================================
dnl Check whether to build with OpenCL support.
dnl =================================================
AC_MSG_CHECKING([whether to build with the OpenCL support.])
ENABLE_OPENCL=
if test "x$enable_opencl" != "xno"; then
AC_MSG_RESULT([yes])
enable_opencl=yes
ENABLE_OPENCL=TRUE
AC_DEFINE(HAVE_FEATURE_OPENCL)
else
AC_MSG_RESULT([no])
enable_opencl=no
ENABLE_OPENCL=FALSE
fi
AC_SUBST(ENABLE_OPENCL)
# presenter minimizer extension? # presenter minimizer extension?
AC_MSG_CHECKING([whether to build the Presentation Minimizer extension]) AC_MSG_CHECKING([whether to build the Presentation Minimizer extension])
if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then if test "x$enable_ext_presenter_minimizer" != "xno" -a "x$enable_extension_integration" != "xno"; then

View File

@@ -15,11 +15,16 @@ $(eval $(call gb_Module_add_targets,sc,\
Library_sc \ Library_sc \
Library_scd \ Library_scd \
Library_scfilt \ Library_scfilt \
Library_scopencl \
Library_scui \ Library_scui \
UIConfig_scalc \ UIConfig_scalc \
)) ))
ifeq ($(ENABLE_OPENCL),TRUE)
$(eval $(call gb_Module_add_targets,sc,\
Library_scopencl \
))
endif
ifneq (,$(filter DESKTOP,$(BUILD_TYPE))) ifneq (,$(filter DESKTOP,$(BUILD_TYPE)))
$(eval $(call gb_Module_add_targets,sc,\ $(eval $(call gb_Module_add_targets,sc,\
Library_scqahelper \ Library_scqahelper \

View File

@@ -358,6 +358,7 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
if ( !msInstance ) if ( !msInstance )
{ {
#if HAVE_FEATURE_OPENCL
if ( ScInterpreter::GetGlobalConfig().mbOpenCLEnabled ) if ( ScInterpreter::GetGlobalConfig().mbOpenCLEnabled )
{ {
#ifdef DISABLE_DYNLOADING #ifdef DISABLE_DYNLOADING
@@ -382,7 +383,7 @@ FormulaGroupInterpreter *FormulaGroupInterpreter::getStatic()
msInstance = new sc::FormulaGroupInterpreterOpenCLMissing(); msInstance = new sc::FormulaGroupInterpreterOpenCLMissing();
#endif #endif
} }
#endif
if ( !msInstance ) // software fallback if ( !msInstance ) // software fallback
{ {
fprintf(stderr, "Create S/W interp\n"); fprintf(stderr, "Create S/W interp\n");

View File

@@ -196,7 +196,9 @@ void ScCalcOptionsDialog::FillOptionsList()
} }
pModel->Insert(createBoolItem(maCaptionEmptyStringAsZero,maConfig.mbEmptyStringAsZero)); pModel->Insert(createBoolItem(maCaptionEmptyStringAsZero,maConfig.mbEmptyStringAsZero));
#if HAVE_FEATURE_OPENCL
pModel->Insert(createBoolItem(maCaptionOpenCLEnabled,maConfig.mbOpenCLEnabled)); pModel->Insert(createBoolItem(maCaptionOpenCLEnabled,maConfig.mbOpenCLEnabled));
#endif
mpLbSettings->SetUpdateMode(true); mpLbSettings->SetUpdateMode(true);
} }