toolchain-external: add OpenMP support
v2 cover toolchain-external: add OpenMP support
This patchset adds OpenMP support to toolchain-external. The first patch adds a new 'BR2_TOOLCHAIN_HAS_OPENMP' option which causes libgomp.so.* to be added to TOOLCHAIN_EXTERNAL_LIBS, the second patch causes BR2_GCC_ENABLE_OPENMP to select BR2_TOOLCHAIN_HAS_OPENMP, the third patch enables BR2_TOOLCHAIN_HAS_OPENMP for all supporting external toolchains, and the fourth patch updates packages to check BR2_TOOLCHAIN_HAS_OPENMP instead of BR2_GCC_ENABLE_OPENMP.
Ed Blake (4):
toolchain-external: introduce BR2_TOOLCHAIN_HAS_OPENMP package/gcc: select BR2_TOOLCHAIN_HAS_OPENMP if BR2_GCC_ENABLE_OPENMP
toolchain-external: enable OpenMP for supporting toolchains
package: use BR2_TOOLCHAIN_HAS_OPENMP
package/fftw/fftw.mk | 4 ++-- package/flann/flann.mk | 2 +- package/gcc/Config.in.host | 1 + package/opencv3/opencv3.mk | 2 +- toolchain/Config.in | 3 +++ toolchain/toolchain-external/pkg-toolchain-external.mk | 4 ++++ .../toolchain-external-arm-aarch64-be/Config.in | 1 + .../toolchain-external-arm-aarch64/Config.in | 1 + .../toolchain-external/toolchain-external-arm-arm/Config.in | 1 + .../toolchain-external-codescape-img-mips/Config.in | 1 + .../toolchain-external-codescape-mti-mips/Config.in | 1 + .../toolchain-external-codesourcery-amd64/Config.in | 1 + .../toolchain-external-codesourcery-mips/Config.in | 1 + .../toolchain-external-linaro-aarch64-be/Config.in | 1 + .../toolchain-external-linaro-aarch64/Config.in | 1 + .../toolchain-external-linaro-arm/Config.in | 1 + .../toolchain-external-linaro-armeb/Config.in | 1 + 17 files changed, 23 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/4 toolchain-external: introduce BR2_TOOLCHAIN_HAS_OPENMP
Add new BR2_TOOLCHAIN_HAS_OPENMP option for toolchains with OpenMP support.
--- toolchain/Config.in | 3 +++ toolchain/toolchain-external/pkg-toolchain-external.mk | 4 ++++ 2 files changed, 7 insertions(+)
toolchain/Config.in +3 -0
@@ -168,6 +168,9 @@ config BR2_TOOLCHAIN_HAS_SSP config BR2_TOOLCHAIN_HAS_UCONTEXT bool +config BR2_TOOLCHAIN_HAS_OPENMP + bool + config BR2_TOOLCHAIN_SUPPORTS_PIE bool
toolchain/toolchain-external/pkg-toolchain-external.mk +4 -0
@@ -144,6 +144,10 @@ TOOLCHAIN_EXTERNAL_LIBS += libquadmath.so* endif endif +ifeq ($(BR2_TOOLCHAIN_HAS_OPENMP),y) +TOOLCHAIN_EXTERNAL_LIBS += libgomp.so.* +endif + TOOLCHAIN_EXTERNAL_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS))
Signature · 1 line
2.17.1
PATCH v2 2/4 package/gcc: select BR2_TOOLCHAIN_HAS_OPENMP if BR2_GCC_ENABLE_OPENMP
In reply to Ed BlakeBR2_TOOLCHAIN_HAS_OPENMP is also selected by external toolchains, so can be used by packages to determine OpenMP support.
--- package/gcc/Config.in.host | 1 + 1 file changed, 1 insertion(+)
package/gcc/Config.in.host +1 -0
@@ -129,6 +129,7 @@ config BR2_GCC_ENABLE_LTO config BR2_GCC_ENABLE_OPENMP bool "Enable compiler OpenMP support" depends on !BR2_PTHREADS_NONE && !BR2_arc && !BR2_microblaze + select BR2_TOOLCHAIN_HAS_OPENMP help Enable OpenMP support for the compiler
Signature · 1 line
2.17.1
PATCH v2 3/4 toolchain-external: enable OpenMP for supporting toolchains
In reply to Ed BlakeEnable OpenMP support in the following external toolchains:
toolchain-external-arm-aarch64-be
toolchain-external-arm-aarch64
toolchain-external-arm-arm
toolchain-external-codescape-img-mips
toolchain-external-codescape-mti-mips
toolchain-external-codesourcery-amd64
toolchain-external-codesourcery-mips
toolchain-external-linaro-aarch64-be
toolchain-external-linaro-aarch64
toolchain-external-linaro-arm
toolchain-external-linaro-armeb
--- .../toolchain-external-arm-aarch64-be/Config.in | 1 + .../toolchain-external/toolchain-external-arm-aarch64/Config.in | 1 + .../toolchain-external/toolchain-external-arm-arm/Config.in | 1 + .../toolchain-external-codescape-img-mips/Config.in | 1 + .../toolchain-external-codescape-mti-mips/Config.in | 1 + .../toolchain-external-codesourcery-amd64/Config.in | 1 + .../toolchain-external-codesourcery-mips/Config.in | 1 + .../toolchain-external-linaro-aarch64-be/Config.in | 1 + .../toolchain-external-linaro-aarch64/Config.in | 1 + .../toolchain-external/toolchain-external-linaro-arm/Config.in | 1 + .../toolchain-external/toolchain-external-linaro-armeb/Config.in | 1 + 11 files changed, 11 insertions(+)
toolchain/toolchain-external/toolchain-external-arm-aarch64-be/Config.in +1 -0
@@ -10,6 +10,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64_BE select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20 select BR2_TOOLCHAIN_GCC_AT_LEAST_8 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Arm toolchain for the AArch64 Big Endian architecture.
toolchain/toolchain-external/toolchain-external-arm-aarch64/Config.in +1 -0
@@ -10,6 +10,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_AARCH64 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20 select BR2_TOOLCHAIN_GCC_AT_LEAST_8 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Arm toolchain for the AArch64 architecture.
toolchain/toolchain-external/toolchain-external-arm-arm/Config.in +1 -0
@@ -17,6 +17,7 @@ config BR2_TOOLCHAIN_EXTERNAL_ARM_ARM select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_20 select BR2_TOOLCHAIN_GCC_AT_LEAST_8 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Arm toolchain for the ARM architecture. It uses GCC 8.2.1, GDB 8.1.1, glibc 2.28, Binutils 2.30. It generates code that
toolchain/toolchain-external/toolchain-external-codescape-img-mips/Config.in +1 -0
@@ -9,6 +9,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_IMG_MIPS select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7 select BR2_TOOLCHAIN_GCC_AT_LEAST_6 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Codescape IMG GNU Linux Toolchain 2018.09 for the MIPS architecture, from MIPS Tech LLC. It uses gcc 6.3.0,
toolchain/toolchain-external/toolchain-external-codescape-mti-mips/Config.in +1 -0
@@ -10,6 +10,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESCAPE_MTI_MIPS select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7 select BR2_TOOLCHAIN_GCC_AT_LEAST_6 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Codescape MTI GNU Linux Toolchain 2018.09 for the MIPS architecture, from MIPS Tech LLC. It uses gcc 6.3.0,
toolchain/toolchain-external/toolchain-external-codesourcery-amd64/Config.in +1 -0
@@ -8,6 +8,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_AMD64 select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_HAS_OPENMP select BR2_INSTALL_LIBSTDCPP select BR2_HOSTARCH_NEEDS_IA32_LIBS select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_7
toolchain/toolchain-external/toolchain-external-codesourcery-mips/Config.in +1 -0
@@ -11,6 +11,7 @@ config BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_MIPS select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_HAS_OPENMP select BR2_INSTALL_LIBSTDCPP select BR2_HOSTARCH_NEEDS_IA32_LIBS select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_4
toolchain/toolchain-external/toolchain-external-linaro-aarch64-be/Config.in +1 -0
@@ -10,6 +10,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64_BE select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10 select BR2_TOOLCHAIN_GCC_AT_LEAST_7 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Toolchain for the AArch64 Big Endian architecture, from http://www.linaro.org/engineering/armv8/
toolchain/toolchain-external/toolchain-external-linaro-aarch64/Config.in +1 -0
@@ -10,6 +10,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64 select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10 select BR2_TOOLCHAIN_GCC_AT_LEAST_7 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Toolchain for the AArch64 architecture, from http://www.linaro.org/engineering/armv8/
toolchain/toolchain-external/toolchain-external-linaro-arm/Config.in +1 -0
@@ -17,6 +17,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10 select BR2_TOOLCHAIN_GCC_AT_LEAST_7 select BR2_TOOLCHAIN_HAS_FORTRAN + select BR2_TOOLCHAIN_HAS_OPENMP help Linaro toolchain for the ARM architecture. It uses Linaro GCC 2018.05 (based on gcc 7.3.1), Linaro GDB 2018.05 (based on
toolchain/toolchain-external/toolchain-external-linaro-armeb/Config.in +1 -0
@@ -13,6 +13,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB select BR2_TOOLCHAIN_EXTERNAL_GLIBC select BR2_TOOLCHAIN_HAS_SSP select BR2_TOOLCHAIN_HAS_NATIVE_RPC + select BR2_TOOLCHAIN_HAS_OPENMP select BR2_INSTALL_LIBSTDCPP select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_10 select BR2_TOOLCHAIN_GCC_AT_LEAST_7
Signature · 1 line
2.17.1
PATCH v2 4/4 package: use BR2_TOOLCHAIN_HAS_OPENMP
In reply to Ed BlakeSwitch from using BR2_GCC_ENABLE_OPENMP to BR2_TOOLCHAIN_HAS_OPENMP to determine OpenMP support in the following packages:
fftw
flann
opencv3
--- package/fftw/fftw.mk | 4 ++-- package/flann/flann.mk | 2 +- package/opencv3/opencv3.mk | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
package/fftw/fftw.mk +2 -2
@@ -27,10 +27,10 @@ endif # Generic optimisations ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) FFTW_COMMON_CONF_OPTS += --enable-threads -FFTW_COMMON_CONF_OPTS += $(if $(BR2_GCC_ENABLE_OPENMP),--without,--with)-combined-threads +FFTW_COMMON_CONF_OPTS += $(if $(BR2_TOOLCHAIN_HAS_OPENMP),--without,--with)-combined-threads else FFTW_COMMON_CONF_OPTS += --disable-threads endif -FFTW_COMMON_CONF_OPTS += $(if $(BR2_GCC_ENABLE_OPENMP),--enable,--disable)-openmp +FFTW_COMMON_CONF_OPTS += $(if $(BR2_TOOLCHAIN_HAS_OPENMP),--enable,--disable)-openmp include $(sort $(wildcard package/fftw/*/*.mk))
package/flann/flann.mk +1 -1
@@ -14,7 +14,7 @@ FLANN_CONF_OPTS = \ -DBUILD_PYTHON_BINDINGS=OFF \ -DBUILD_MATLAB_BINDINGS=OFF \ -DBUILD_EXAMPLES=$(if $(BR2_PACKAGE_FLANN_EXAMPLES),ON,OFF) \ - -DUSE_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF) \ + -DUSE_OPENMP=$(if $(BR2_TOOLCHAIN_HAS_OPENMP),ON,OFF) \ -DPYTHON_EXECUTABLE=OFF \ -DCMAKE_DISABLE_FIND_PACKAGE_HDF5=TRUE
package/opencv3/opencv3.mk +1 -1
@@ -279,7 +279,7 @@ else OPENCV3_CONF_OPTS += -DWITH_OPENGL=OFF endif -OPENCV3_CONF_OPTS += -DWITH_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF) +OPENCV3_CONF_OPTS += -DWITH_OPENMP=$(if $(BR2_TOOLCHAIN_HAS_OPENMP),ON,OFF) ifeq ($(BR2_PACKAGE_OPENCV3_WITH_PNG),y) OPENCV3_CONF_OPTS += -DWITH_PNG=ON
Signature · 1 line
2.17.1
v2 cover toolchain-external: add OpenMP support
In reply to Ed BlakeHello Ed,
Quoted 5 lines · On Tue, 26 Mar 2019 12:30:44 +0000 Ed Blake <[email protected]> wrote:
Ed Blake (4):
toolchain-external: introduceBR2_TOOLCHAIN_HAS_OPENMPpackage/gcc: selectBR2_TOOLCHAIN_HAS_OPENMPifBR2_GCC_ENABLE_OPENMP
toolchain-external: enable OpenMP for supporting toolchains
package: useBR2_TOOLCHAIN_HAS_OPENMP
Thanks, this looks good to me overall, but I didn't receive PATCH 2/4, and patchwork didn't receive it as well. Do you know what happened with PATCH 2/4 ?
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
v2 cover toolchain-external: add OpenMP support
Quoted 5 lines · On Tue, 26 Mar 2019 14:53:57 +0100 Thomas Petazzoni…
Hello Ed,
On Tue, 26 Mar 2019 12:30:44 +0000
Ed Blake <[email protected]> wrote:
Quoted 8 lines
Quoted 5 lines
Ed Blake (4):
toolchain-external: introduceBR2_TOOLCHAIN_HAS_OPENMPpackage/gcc: selectBR2_TOOLCHAIN_HAS_OPENMPifBR2_GCC_ENABLE_OPENMP
toolchain-external: enable OpenMP for supporting toolchains
package: useBR2_TOOLCHAIN_HAS_OPENMPThanks, this looks good to me overall, but I didn't receive PATCH 2/4, and patchwork didn't receive it as well. Do you know what happened with PATCH 2/4 ?
It's appeared on patchwork now. Sorry, not sure why it was delayed.
Ed.
Quoted 4 lines
Best regards,
Thomas
v2 cover toolchain-external: add OpenMP support
In reply to Ed BlakeHello Ed,
Quoted 5 lines · On Tue, 26 Mar 2019 12:30:44 +0000 Ed Blake <[email protected]> wrote:
Ed Blake (4):
toolchain-external: introduceBR2_TOOLCHAIN_HAS_OPENMPpackage/gcc: selectBR2_TOOLCHAIN_HAS_OPENMPifBR2_GCC_ENABLE_OPENMP
toolchain-external: enable OpenMP for supporting toolchains
package: useBR2_TOOLCHAIN_HAS_OPENMP
Thanks, I've applied all four patches.
However, it would be good if you could send additional patches that:
(1) Allows a custom external toolchain to specify that it supports OpenMP. This needs to be done in toolchain/toolchain-external/toolchain-external-custom/Config.in.options
(2) Adds a check to the external toolchain logic to ensure that if BR2_TOOLCHAIN_HAS_OPENMP is enabled, the toolchain really supports it. This should be done in the $(2)_CONFIGURE_CMDS variable in pkg-toolchain-external.mk. You can for example write a check similar to check_fortran (see helpers.mk) that tries to compile a simple OpenMP program.
Do you think you could work on this ?
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
v2 cover toolchain-external: add OpenMP support
Quoted 19 lines · On Tue, 26 Mar 2019 20:22:22 +0100 Thomas Petazzoni…
Hello Ed,
Quoted 5 lines · On Tue, 26 Mar 2019 12:30:44 +0000 Ed Blake <[email protected]> wrote:
Ed Blake (4):
toolchain-external: introduceBR2_TOOLCHAIN_HAS_OPENMPpackage/gcc: selectBR2_TOOLCHAIN_HAS_OPENMPifBR2_GCC_ENABLE_OPENMP
toolchain-external: enable OpenMP for supporting toolchains
package: useBR2_TOOLCHAIN_HAS_OPENMPThanks, I've applied all four patches.
However, it would be good if you could send additional patches that:
(1) Allows a custom external toolchain to specify that it supports OpenMP. This needs to be done in toolchain/toolchain-external/toolchain-external-custom/Config.in.options
Quoted 8 lines
(2) Adds a check to the external toolchain logic to ensure that if
BR2_TOOLCHAIN_HAS_OPENMPis enabled, the toolchain really supports it. This should be done in the $(2)_CONFIGURE_CMDS variable in pkg-toolchain-external.mk. You can for example write a check similar tocheck_fortran(see helpers.mk) that tries to compile a simple OpenMP program.Do you think you could work on this ?
Sure, will do.
Ed.
Quoted 4 lines
Thanks!
Thomas