* [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains
@ 2016-07-03 13:47 Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol Samuel Martin
` (14 more replies)
0 siblings, 15 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Hi all,
This third round of the series includes:
* refactoring of the libquadmath handling (which is a dependency of fortran on
some architecture);
* fixes from last review.
Note that all patches fixing the infrastructures but the last patch (adding
lapack package) of this are ready.
I'm still investigating a CMake on mis-behavior on the lapack package (causing
build failure unrelated to this rest of this sereis).
Regards,
Benjamin Kamath (1):
package/lapack: new package
Samuel Martin (13):
toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH
hidden symbol
package/gcc: complete the logic on libquadmath
package/gcc: fix fortran support
toolchain: add hidden symbol for fortran support in the toolchain
docs/manual: document dependency on fortran
package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate
pkg-cmake.mk: export the fortran compiler path in the CMake toolchain
file
toolchain/helpers: add fortran check
toolchain/toolchain-external: enable fortran check when it is selected
toolchain/toolchain-external: add libgfortran and libquadmath to the
TOOLCHAIN_EXTERNAL_LIBS list
toolchain/toolchain-external: add knob for fortran support
toolchain/toolchain-external: update external toolchain configuration
with BR2_TOOLCHAIN_HAS_FORTRAN
package/fftw: add fortran support
docs/manual/adding-packages-directory.txt | 4 ++++
package/Config.in | 1 +
package/fftw/fftw.mk | 3 ++-
package/gcc/Config.in.host | 8 +++++++
package/gcc/gcc-final/gcc-final.mk | 4 ++++
package/gcc/gcc.mk | 4 +++-
package/lapack/0001-case-sensitive-paths.patch | 22 +++++++++++++++++++
package/lapack/Config.in | 20 +++++++++++++++++
package/lapack/lapack.hash | 2 ++
package/lapack/lapack.mk | 25 ++++++++++++++++++++++
package/pkg-cmake.mk | 3 +++
support/misc/toolchainfile.cmake.in | 4 ++++
toolchain/helpers.mk | 18 ++++++++++++++++
toolchain/toolchain-common.in | 13 +++++++++++
toolchain/toolchain-external/Config.in | 14 ++++++++++++
toolchain/toolchain-external/toolchain-external.mk | 13 ++++++++++-
16 files changed, 155 insertions(+), 3 deletions(-)
create mode 100644 package/lapack/0001-case-sensitive-paths.patch
create mode 100644 package/lapack/Config.in
create mode 100644 package/lapack/lapack.hash
create mode 100644 package/lapack/lapack.mk
--
2.9.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-04 9:16 ` Arnout Vandecappelle
2016-07-03 13:47 ` [Buildroot] [PATCH v3 02/14] package/gcc: complete the logic on libquadmath Samuel Martin
` (13 subsequent siblings)
14 siblings, 1 reply; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
This hidden symbol allow to know when libquadmath can be built and installed.
Also, declaring this symbol in toolchain-common.in allows to use it in
both external and buildroot toolchain backend.
This will be needed for adding/improving the fortran support.
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
changes v2->v3:
- new patch
---
toolchain/toolchain-common.in | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 847c905..96ce3d1 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -419,3 +419,13 @@ config BR2_TOOLCHAIN_HAS_ATOMIC
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
+
+# - libquadmath is not needed/available on all architectures (but gcc
+# correctly handles this already).
+# - At least, libquadmath is available on:
+# - i*86
+# - x86_64
+# - When available, libquadmath requires wchar support.
+config BR2_TOOLCHAIN_HAS_LIBQUADMATH
+ bool
+ default y if BR2_i386 || BR2_x86_64
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 02/14] package/gcc: complete the logic on libquadmath
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 03/14] package/gcc: fix fortran support Samuel Martin
` (12 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
libquadmath requires wchar.
So, turn to positive logic and complete it to only enabling quadmath
support when it is available.
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
changes v2->v3:
- new patch
---
package/gcc/gcc.mk | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index a796f47..efcaf9b 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -107,7 +107,9 @@ HOST_GCC_COMMON_CONF_OPTS += --disable-libitm
endif
# quadmath support requires wchar
-ifeq ($(BR2_USE_WCHAR),)
+ifeq ($(BR2_USE_WCHAR)$(BR2_TOOLCHAIN_HAS_LIBQUADMATH),yy)
+HOST_GCC_COMMON_CONF_OPTS += --enable-libquadmath
+else
HOST_GCC_COMMON_CONF_OPTS += --disable-libquadmath
endif
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 03/14] package/gcc: fix fortran support
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 02/14] package/gcc: complete the logic on libquadmath Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 04/14] toolchain: add hidden symbol for fortran support in the toolchain Samuel Martin
` (11 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Fortran depends on libquadmath when available, make the buildroot
toolchain option depends on this new hidden symbol,
[Vincent: only do "HOST_GCC_FINAL_USR_LIBS += libquadmath" for i386 and
x86_64, otherwise it will fail saying "libquadmath.a: file not found"]
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- none
changes v2->v3:
- s/BR2_I386/BR2_i386/ (Thomas P.)
- use BR2_TOOLCHAIN_HAS_LIBQUADMATH to install the lib
- rephrase commit log
- update dependencies in Config.in
---
package/gcc/Config.in.host | 7 +++++++
package/gcc/gcc-final/gcc-final.mk | 4 ++++
2 files changed, 11 insertions(+)
diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index 44a72f1..8a42828 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -118,8 +118,15 @@ config BR2_TOOLCHAIN_BUILDROOT_CXX
C++ language and you want C++ libraries to be installed on
your target system.
+comment "Fortran support needs a toolchain w/ wchar"
+ depends on BR2_TOOLCHAIN_HAS_LIBQUADMATH
+ depends on !BR2_USE_WCHAR # libquadmath
+
config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
bool "Enable Fortran support"
+ # on architecture building libqadmath, wchar is required
+ depends on !BR2_TOOLCHAIN_HAS_LIBQUADMATH || \
+ (BR2_TOOLCHAIN_HAS_LIBQUADMATH && BR2_USE_WCHAR)
help
Enable this option if you want your toolchain to support the
Fortran language and you want Fortran libraries to be
diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk
index 78ceeba..284d34c 100644
--- a/package/gcc/gcc-final/gcc-final.mk
+++ b/package/gcc/gcc-final/gcc-final.mk
@@ -163,6 +163,10 @@ endif
ifeq ($(BR2_TOOLCHAIN_BUILDROOT_FORTRAN),y)
HOST_GCC_FINAL_USR_LIBS += libgfortran
+# fortran needs quadmath on x86 and x86_64
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBQUADMATH),y)
+HOST_GCC_FINAL_USR_LIBS += libquadmath
+endif
endif
ifeq ($(BR2_GCC_ENABLE_OPENMP),y)
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 04/14] toolchain: add hidden symbol for fortran support in the toolchain
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (2 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 03/14] package/gcc: fix fortran support Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 05/14] docs/manual: document dependency on fortran Samuel Martin
` (10 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
This symbol should be used in all packages requiring/testing for fortran
support.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
changes v1->v2:
- none
changes v2->v3:
- update A/R/T tags
---
toolchain/toolchain-common.in | 3 +++
1 file changed, 3 insertions(+)
diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
index 96ce3d1..65df31b 100644
--- a/toolchain/toolchain-common.in
+++ b/toolchain/toolchain-common.in
@@ -21,6 +21,9 @@ config BR2_ENABLE_LOCALE
config BR2_INSTALL_LIBSTDCPP
bool
+config BR2_TOOLCHAIN_HAS_FORTRAN
+ bool
+
config BR2_TOOLCHAIN_HAS_THREADS
bool
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 05/14] docs/manual: document dependency on fortran
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (3 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 04/14] toolchain: add hidden symbol for fortran support in the toolchain Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 06/14] package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate Samuel Martin
` (9 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
changes v2->v3:
- new patch
---
docs/manual/adding-packages-directory.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/manual/adding-packages-directory.txt b/docs/manual/adding-packages-directory.txt
index ee4a721..dc66f00 100644
--- a/docs/manual/adding-packages-directory.txt
+++ b/docs/manual/adding-packages-directory.txt
@@ -318,6 +318,10 @@ use in the comment.
** Dependency symbol: +BR2_INSTALL_LIBSTDCPP+
** Comment string: `C++`
+* Fortran support
+** Dependency symbol: +BR2_TOOLCHAIN_HAS_FORTRAN+
+** Comment string: `fortran`
+
* thread support
** Dependency symbol: +BR2_TOOLCHAIN_HAS_THREADS+
** Comment string: +threads+ (unless +BR2_TOOLCHAIN_HAS_THREADS_NPTL+
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 06/14] package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (4 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 05/14] docs/manual: document dependency on fortran Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 07/14] pkg-cmake.mk: export the fortran compiler path in the CMake toolchain file Samuel Martin
` (8 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
This is only for the Buildroot toolchain backend.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- none
changes v2->v3:
- fix typo in commit title (Thomas P.)
---
package/gcc/Config.in.host | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index 8a42828..4954cc0 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -127,6 +127,7 @@ config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
# on architecture building libqadmath, wchar is required
depends on !BR2_TOOLCHAIN_HAS_LIBQUADMATH || \
(BR2_TOOLCHAIN_HAS_LIBQUADMATH && BR2_USE_WCHAR)
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Enable this option if you want your toolchain to support the
Fortran language and you want Fortran libraries to be
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 07/14] pkg-cmake.mk: export the fortran compiler path in the CMake toolchain file
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (5 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 06/14] package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 08/14] toolchain/helpers: add fortran check Samuel Martin
` (7 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Since the fortran support is conditional, only enable it when needed.
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Cc: Benjamin Kamath <bkamath@spaceflight.com>
---
changes v1->v2:
- set CMAKE_Fortran_FLAGS in the toolchainfile.cmake (Benjamin K.)
changes v2->v3:
- none
---
package/pkg-cmake.mk | 3 +++
support/misc/toolchainfile.cmake.in | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk
index 6f0ecf9..9291523 100644
--- a/package/pkg-cmake.mk
+++ b/package/pkg-cmake.mk
@@ -236,9 +236,12 @@ $(HOST_DIR)/usr/share/buildroot/toolchainfile.cmake:
-e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \
-e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \
-e 's#@@TARGET_CXXFLAGS@@#$(call qstrip,$(TARGET_CXXFLAGS))#' \
+ -e 's#@@TARGET_FCFLAGS@@#$(call qstrip,$(TARGET_FCFLAGS))#' \
-e 's#@@TARGET_LDFLAGS@@#$(call qstrip,$(TARGET_LDFLAGS))#' \
-e 's#@@TARGET_CC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CC)))#' \
-e 's#@@TARGET_CXX@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_CXX)))#' \
+ -e 's#@@TARGET_FC@@#$(subst $(HOST_DIR)/,,$(call qstrip,$(TARGET_FC)))#' \
-e 's#@@CMAKE_SYSTEM_PROCESSOR@@#$(call qstrip,$(CMAKE_SYSTEM_PROCESSOR))#' \
+ -e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if $(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \
$(TOPDIR)/support/misc/toolchainfile.cmake.in \
> $@
diff --git a/support/misc/toolchainfile.cmake.in b/support/misc/toolchainfile.cmake.in
index 5cf381e..e550b8f 100644
--- a/support/misc/toolchainfile.cmake.in
+++ b/support/misc/toolchainfile.cmake.in
@@ -29,3 +29,7 @@ set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
# This toolchain file can be used both inside and outside Buildroot.
set(CMAKE_C_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CC@@")
set(CMAKE_CXX_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_CXX@@")
+if(@@TOOLCHAIN_HAS_FORTRAN@@)
+ set(CMAKE_Fortran_FLAGS "@@TARGET_FCFLAGS@@ ${CMAKE_Fortran_FLAGS}" CACHE STRING "Buildroot FCFLAGS")
+ set(CMAKE_Fortran_COMPILER "${RELOCATED_HOST_DIR}/@@TARGET_FC@@")
+endif()
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 08/14] toolchain/helpers: add fortran check
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (6 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 07/14] pkg-cmake.mk: export the fortran compiler path in the CMake toolchain file Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 09/14] toolchain/toolchain-external: enable fortran check when it is selected Samuel Martin
` (6 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- none
changes v2->v3:
- use real files as input/output in the test (Thomas P.)
---
toolchain/helpers.mk | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 108fdaa..74ec944 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -311,6 +311,24 @@ check_cplusplus = \
fi
#
+#
+# Check that the external toolchain supports Fortran
+#
+# $1: cross-gfortran path
+#
+check_fortran = \
+ __CROSS_FC=$(strip $1) ; \
+ __o=$(BUILD_DIR)/.br-toolchain-test-fortran.tmp.f.o ; \
+ printf 'program hello\n\tprint *, "Hello Fortran!\\n"\nend program hello\n' | \
+ $${__CROSS_FC} -x f95 -o $${__o} - ; \
+ if test $$? -ne 0 ; then \
+ rm -f $${__o}* ; \
+ echo "Fortran support is selected but is not available in external toolchain" ; \
+ exit 1 ; \
+ fi ; \
+ rm -f $${__o}* \
+
+#
# Check that the cross-compiler given in the configuration exists
#
# $1: cross-gcc path
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 09/14] toolchain/toolchain-external: enable fortran check when it is selected
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (7 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 08/14] toolchain/helpers: add fortran check Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 10/14] toolchain/toolchain-external: add libgfortran and libquadmath to the TOOLCHAIN_EXTERNAL_LIBS list Samuel Martin
` (5 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- none
changes v2->v3:
- remove CFLAGS in the check call (Thomas P.)
---
toolchain/toolchain-external/toolchain-external.mk | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 342bc84..4240a9b 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -160,6 +160,7 @@ TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += \
TOOLCHAIN_EXTERNAL_CROSS = $(TOOLCHAIN_EXTERNAL_BIN)/$(TOOLCHAIN_EXTERNAL_PREFIX)-
TOOLCHAIN_EXTERNAL_CC = $(TOOLCHAIN_EXTERNAL_CROSS)gcc$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_CXX = $(TOOLCHAIN_EXTERNAL_CROSS)g++$(TOOLCHAIN_EXTERNAL_SUFFIX)
+TOOLCHAIN_EXTERNAL_FC = $(TOOLCHAIN_EXTERNAL_CROSS)gfortran$(TOOLCHAIN_EXTERNAL_SUFFIX)
TOOLCHAIN_EXTERNAL_READELF = $(TOOLCHAIN_EXTERNAL_CROSS)readelf$(TOOLCHAIN_EXTERNAL_SUFFIX)
ifeq ($(filter $(HOST_DIR)/%,$(TOOLCHAIN_EXTERNAL_BIN)),)
@@ -521,6 +522,9 @@ define TOOLCHAIN_EXTERNAL_CONFIGURE_CMDS
if test "$(BR2_INSTALL_LIBSTDCPP)" = "y" ; then \
$(call check_cplusplus,$(TOOLCHAIN_EXTERNAL_CXX)) ; \
fi ; \
+ if test "$(BR2_TOOLCHAIN_HAS_FORTRAN)" = "y" ; then \
+ $(call check_fortran,$(TOOLCHAIN_EXTERNAL_FC)) ; \
+ fi ; \
if test "$(BR2_TOOLCHAIN_EXTERNAL_UCLIBC)" = "y" ; then \
$(call check_uclibc,$${SYSROOT_DIR}) ; \
elif test "$(BR2_TOOLCHAIN_EXTERNAL_MUSL)" = "y" ; then \
@@ -796,4 +800,3 @@ define TOOLCHAIN_EXTERNAL_INSTALL_TARGET_CMDS
endef
$(eval $(generic-package))
-
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 10/14] toolchain/toolchain-external: add libgfortran and libquadmath to the TOOLCHAIN_EXTERNAL_LIBS list
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (8 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 09/14] toolchain/toolchain-external: enable fortran check when it is selected Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 11/14] toolchain/toolchain-external: add knob for fortran support Samuel Martin
` (4 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- s/USR_LIB_EXTERNAL_LIBS/TOOLCHAIN_EXTERNAL_LIBS/
- only install libquadmath for x86{,_64} target (not built on other
arch.)
changes v2->v3:
- s/BR2_I386/BR2_i386/ (Thomas P.)
- use BR2_TOOLCHAIN_HAS_LIBQUADMATH to drive the libquadmath
installation
---
toolchain/toolchain-external/toolchain-external.mk | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 4240a9b..d6a3d0e 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -90,6 +90,14 @@ ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
TOOLCHAIN_EXTERNAL_LIBS += libstdc++.so.*
endif
+ifeq ($(BR2_TOOLCHAIN_HAS_FORTRAN),y)
+TOOLCHAIN_EXTERNAL_LIBS += libgfortran.so.*
+# fortran needs quadmath on x86 and x86_64
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBQUADMATH),y)
+TOOLCHAIN_EXTERNAL_LIBS += libquadmath.so*
+endif
+endif
+
TOOLCHAIN_EXTERNAL_LIBS += $(call qstrip,$(BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS))
# Details about sysroot directory selection.
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 11/14] toolchain/toolchain-external: add knob for fortran support
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (9 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 10/14] toolchain/toolchain-external: add libgfortran and libquadmath to the TOOLCHAIN_EXTERNAL_LIBS list Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 12/14] toolchain/toolchain-external: update external toolchain configuration with BR2_TOOLCHAIN_HAS_FORTRAN Samuel Martin
` (3 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- none
changes v2->v3:
- drop the wchar dependency, if the external toolchain has fortran, it
means all its requirements are met, so also drop the comment (Thomas P.)
---
toolchain/toolchain-external/Config.in | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 552536e..02b82e5 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -1020,6 +1020,14 @@ config BR2_TOOLCHAIN_EXTERNAL_CXX
support. If you don't know, leave the default value,
Buildroot will tell you if it's correct or not.
+config BR2_TOOLCHAIN_EXTERNAL_FORTRAN
+ bool "Toolchain has Fortran support?"
+ select BR2_TOOLCHAIN_HAS_FORTRAN
+ help
+ Select this option if your external toolchain has fortran
+ support. If you don't know, leave the default value,
+ Buildroot will tell you if it's correct or not.
+
config BR2_TOOLCHAIN_EXTRA_EXTERNAL_LIBS
string "Extra toolchain libraries to be copied to target"
help
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 12/14] toolchain/toolchain-external: update external toolchain configuration with BR2_TOOLCHAIN_HAS_FORTRAN
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (10 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 11/14] toolchain/toolchain-external: add knob for fortran support Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 13/14] package/fftw: add fortran support Samuel Martin
` (2 subsequent siblings)
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
[Vincent: BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX also has fortran]
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- update linaro 2016.02 arm selection
changes v2->v3:
- update linaro aarch64 2016.02 arm selection
---
toolchain/toolchain-external/Config.in | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/toolchain/toolchain-external/Config.in b/toolchain/toolchain-external/Config.in
index 02b82e5..471a844 100644
--- a/toolchain/toolchain-external/Config.in
+++ b/toolchain/toolchain-external/Config.in
@@ -27,6 +27,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM
select BR2_INSTALL_LIBSTDCPP
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Linaro toolchain for the ARM architecture. It uses Linaro
GCC 2014.09 (based on gcc 4.9), Linaro GDB 2013.10 (based on
@@ -50,6 +51,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARM
select BR2_INSTALL_LIBSTDCPP
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
select BR2_TOOLCHAIN_GCC_AT_LEAST_5
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Linaro toolchain for the ARM architecture. It uses Linaro
GCC 2016.02 (based on gcc 5.3), Linaro GDB 2016.02 (based on
@@ -73,6 +75,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_ARMEB
select BR2_INSTALL_LIBSTDCPP
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_1
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Linaro toolchain for the ARM big endian architecture. It
uses Linaro GCC 2014.09 (based on gcc 4.9), Linaro GDB
@@ -522,6 +525,7 @@ config BR2_TOOLCHAIN_EXTERNAL_BLACKFIN_UCLINUX
select BR2_HOSTARCH_NEEDS_IA32_LIBS
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_3
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Toolchain for the Blackfin architecture, from
http://blackfin.uclinux.org.
@@ -538,6 +542,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
select BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Toolchain for the AArch64 architecture, from
http://www.linaro.org/engineering/armv8/
@@ -554,6 +559,7 @@ config BR2_TOOLCHAIN_EXTERNAL_LINARO_AARCH64
select BR2_TOOLCHAIN_HAS_NATIVE_RPC
select BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_0
select BR2_TOOLCHAIN_GCC_AT_LEAST_5
+ select BR2_TOOLCHAIN_HAS_FORTRAN
help
Toolchain for the AArch64 architecture, from
http://www.linaro.org/engineering/armv8/
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 13/14] package/fftw: add fortran support
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (11 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 12/14] toolchain/toolchain-external: update external toolchain configuration with BR2_TOOLCHAIN_HAS_FORTRAN Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 14/14] package/lapack: new package Samuel Martin
2016-07-03 15:02 ` [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Thomas Petazzoni
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
changes v1->v2:
- add comment about fortran
changes v2->v3:
- none
---
package/fftw/fftw.mk | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/fftw/fftw.mk b/package/fftw/fftw.mk
index e89671f..bc4fb08 100644
--- a/package/fftw/fftw.mk
+++ b/package/fftw/fftw.mk
@@ -10,7 +10,8 @@ FFTW_INSTALL_STAGING = YES
FFTW_LICENSE = GPLv2+
FFTW_LICENSE_FILES = COPYING
-FFTW_CONF_OPTS = --disable-fortran
+# fortran support only enables generation and installation of fortran sources
+FFTW_CONF_OPTS = $(if $(BR2_TOOLCHAIN_HAS_FORTRAN),--enable,--disable)-fortran
FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_SINGLE),--enable,--disable)-single
FFTW_CONF_OPTS += $(if $(BR2_PACKAGE_FFTW_PRECISION_LONG_DOUBLE),--enable,--disable)-long-double
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 14/14] package/lapack: new package
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (12 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 13/14] package/fftw: add fortran support Samuel Martin
@ 2016-07-03 13:47 ` Samuel Martin
2016-07-03 15:02 ` [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Thomas Petazzoni
14 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-03 13:47 UTC (permalink / raw)
To: buildroot
From: Benjamin Kamath <kamath.ben@gmail.com>
lapack is a fortran-based linear algebra math library.
Signed-off-by: Benjamin Kamath <bkamath@spaceflight.com>
Signed-off-by: Samuel Martin <s.martin49@gmail.com>
---
changes v1->v2:
- integrate this patch in this series
- slightly tweak the commit log
- s/BR2_INSTALL_LIBFORTRAN/BR2_TOOLCHAIN_HAS_FORTRAN/
changes v2->v3:
- change the powerpc/uclibc dependency to allow build with musl (ThomasP)
- add comment when the toolchain does not have fortran support (ThomasP)
- fix license (ThomasP)
- fix case in config options (ThomasP)
---
package/Config.in | 1 +
package/lapack/0001-case-sensitive-paths.patch | 22 ++++++++++++++++++++++
package/lapack/Config.in | 20 ++++++++++++++++++++
package/lapack/lapack.hash | 2 ++
package/lapack/lapack.mk | 25 +++++++++++++++++++++++++
5 files changed, 70 insertions(+)
create mode 100644 package/lapack/0001-case-sensitive-paths.patch
create mode 100644 package/lapack/Config.in
create mode 100644 package/lapack/lapack.hash
create mode 100644 package/lapack/lapack.mk
diff --git a/package/Config.in b/package/Config.in
index 73bf32f..8305ffe 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1259,6 +1259,7 @@ menu "Other"
source "package/gmp/Config.in"
source "package/gsl/Config.in"
source "package/gtest/Config.in"
+ source "package/lapack/Config.in"
source "package/libargtable2/Config.in"
source "package/libatomic_ops/Config.in"
source "package/libbsd/Config.in"
diff --git a/package/lapack/0001-case-sensitive-paths.patch b/package/lapack/0001-case-sensitive-paths.patch
new file mode 100644
index 0000000..3722b88
--- /dev/null
+++ b/package/lapack/0001-case-sensitive-paths.patch
@@ -0,0 +1,22 @@
+Fix upper case issue in CMakeLists
+
+Fix the 3.6.0 release of lapack to work with case-sensitive file systems,
+reported as bug 145 in LAPACK's bug list. Corrected in SVN rev 1651.
+
+Signed-off-by: Benjamin Kamath <kamath.ben@gmail.com>
+
+diff -rupN lapack-3.6.0/CBLAS/CMakeLists.txt lapack-3.6.0-old/CBLAS/CMakeLists.txt
+--- lapack-3.6.0/CBLAS/CMakeLists.txt 2016-03-17 13:42:31.121248051 -0700
++++ lapack-3.6.0-old/CBLAS/CMakeLists.txt 2016-03-17 13:41:37.819316904 -0700
+@@ -65,9 +65,9 @@ if(ALL_TARGETS)
+ list(GET ALL_TARGETS 0 _cblas_config_build_guard_target)
+ endif()
+
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/cblas-config-version.cmake.in
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-version.cmake.in
+ ${LAPACK_BINARY_DIR}/cblas-config-version.cmake @ONLY)
+-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMAKE/cblas-config-build.cmake.in
++configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/cblas-config-build.cmake.in
+ ${LAPACK_BINARY_DIR}/cblas-config.cmake @ONLY)
+
+
diff --git a/package/lapack/Config.in b/package/lapack/Config.in
new file mode 100644
index 0000000..73b55c5
--- /dev/null
+++ b/package/lapack/Config.in
@@ -0,0 +1,20 @@
+comment "lapack/blas needs a toolchain w/ fortran"
+ depends on !(BR2_powerpc && BR2_TOOLCHAIN_USES_UCLIBC)
+ depends on !BR2_TOOLCHAIN_HAS_FORTRAN
+
+config BR2_PACKAGE_LAPACK
+ bool "lapack/blas"
+ depends on BR2_TOOLCHAIN_HAS_FORTRAN
+ # _fpu_control is used on PowerPC, but not available with uClibc
+ depends on !(BR2_powerpc && BR2_TOOLCHAIN_USES_UCLIBC)
+ help
+ LAPACK and BLAS FORTRAN implementation.
+
+ http://www.netlib.org/lapack/
+
+config BR2_PACKAGE_LAPACK_COMPLEX
+ bool "Complex/Complex16 support"
+ depends on BR2_PACKAGE_LAPACK
+ default y
+ help
+ Builds support for COMPLEX and COMPLEX16 data types.
diff --git a/package/lapack/lapack.hash b/package/lapack/lapack.hash
new file mode 100644
index 0000000..99d25b5
--- /dev/null
+++ b/package/lapack/lapack.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 a9a0082c918fe14e377bbd570057616768dca76cbdc713457d8199aaa233ffc3 lapack-3.6.0.tgz
diff --git a/package/lapack/lapack.mk b/package/lapack/lapack.mk
new file mode 100644
index 0000000..af6d627
--- /dev/null
+++ b/package/lapack/lapack.mk
@@ -0,0 +1,25 @@
+################################################################################
+#
+# lapack
+#
+################################################################################
+
+# This package provides 2 libraries:
+# - libblas
+# - liblapack
+
+LAPACK_VERSION = 3.6.0
+LAPACK_SOURCE = lapack-$(LAPACK_VERSION).tgz
+LAPACK_LICENSE = BSD-3c
+LAPACK_LICENSE_FILES = LICENSE
+LAPACK_SITE = http://www.netlib.org/lapack
+LAPACK_INSTALL_STAGING = YES
+LAPACK_CONF_OPTS = -DLAPACKE=ON -DCBLAS=ON
+
+ifeq ($(BR2_PACKAGE_LAPACK_COMPLEX),y)
+LAPACK_CONF_OPTS += -DBUILD_COMPLEX=ON -DBUILD_COMPLEX16=ON
+else
+LAPACK_CONF_OPTS += -DBUILD_COMPLEX=OFF -DBUILD_COMPLEX16=OFF
+endif
+
+$(eval $(cmake-package))
--
2.9.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
` (13 preceding siblings ...)
2016-07-03 13:47 ` [Buildroot] [PATCH v3 14/14] package/lapack: new package Samuel Martin
@ 2016-07-03 15:02 ` Thomas Petazzoni
2016-07-04 22:56 ` Samuel Martin
14 siblings, 1 reply; 21+ messages in thread
From: Thomas Petazzoni @ 2016-07-03 15:02 UTC (permalink / raw)
To: buildroot
Hello,
On Sun, 3 Jul 2016 15:47:36 +0200, Samuel Martin wrote:
> Samuel Martin (13):
> toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH
> hidden symbol
> package/gcc: complete the logic on libquadmath
> package/gcc: fix fortran support
> toolchain: add hidden symbol for fortran support in the toolchain
> docs/manual: document dependency on fortran
> package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate
> pkg-cmake.mk: export the fortran compiler path in the CMake toolchain
> file
> toolchain/helpers: add fortran check
> toolchain/toolchain-external: enable fortran check when it is selected
> toolchain/toolchain-external: add libgfortran and libquadmath to the
> TOOLCHAIN_EXTERNAL_LIBS list
> toolchain/toolchain-external: add knob for fortran support
> toolchain/toolchain-external: update external toolchain configuration
> with BR2_TOOLCHAIN_HAS_FORTRAN
> package/fftw: add fortran support
I've applied those patches, with some minor tweaks here and there.
However, I haven't applied the lapack patch since it fails to build
with the Linaro toolchain as we discussed.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol
2016-07-03 13:47 ` [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol Samuel Martin
@ 2016-07-04 9:16 ` Arnout Vandecappelle
2016-07-04 14:22 ` Thomas Petazzoni
0 siblings, 1 reply; 21+ messages in thread
From: Arnout Vandecappelle @ 2016-07-04 9:16 UTC (permalink / raw)
To: buildroot
On 03-07-16 15:47, Samuel Martin wrote:
> This hidden symbol allow to know when libquadmath can be built and installed.
>
> Also, declaring this symbol in toolchain-common.in allows to use it in
> both external and buildroot toolchain backend.
>
> This will be needed for adding/improving the fortran support.
>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> Signed-off-by: Samuel Martin <s.martin49@gmail.com>
>
> ---
> changes v2->v3:
> - new patch
> ---
> toolchain/toolchain-common.in | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/toolchain/toolchain-common.in b/toolchain/toolchain-common.in
> index 847c905..96ce3d1 100644
> --- a/toolchain/toolchain-common.in
> +++ b/toolchain/toolchain-common.in
> @@ -419,3 +419,13 @@ config BR2_TOOLCHAIN_HAS_ATOMIC
> default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_armeb
> default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_xtensa
> default y if BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 && BR2_ARCH_IS_64
> +
> +# - libquadmath is not needed/available on all architectures (but gcc
> +# correctly handles this already).
> +# - At least, libquadmath is available on:
> +# - i*86
> +# - x86_64
> +# - When available, libquadmath requires wchar support.
> +config BR2_TOOLCHAIN_HAS_LIBQUADMATH
> + bool
> + default y if BR2_i386 || BR2_x86_64
Wouldn't it make more sense to add here:
depends on BR2_USE_WCHAR
(and remove it from the .mk file)?
Regards,
Arnout
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol
2016-07-04 9:16 ` Arnout Vandecappelle
@ 2016-07-04 14:22 ` Thomas Petazzoni
0 siblings, 0 replies; 21+ messages in thread
From: Thomas Petazzoni @ 2016-07-04 14:22 UTC (permalink / raw)
To: buildroot
Hello,
On Mon, 4 Jul 2016 11:16:08 +0200, Arnout Vandecappelle wrote:
> > +# - libquadmath is not needed/available on all architectures (but gcc
> > +# correctly handles this already).
> > +# - At least, libquadmath is available on:
> > +# - i*86
> > +# - x86_64
> > +# - When available, libquadmath requires wchar support.
> > +config BR2_TOOLCHAIN_HAS_LIBQUADMATH
> > + bool
> > + default y if BR2_i386 || BR2_x86_64
>
> Wouldn't it make more sense to add here:
>
> depends on BR2_USE_WCHAR
>
> (and remove it from the .mk file)?
We thought about this, and discussed it with Samuel, but we had a good
reason not to do it. It was yesterday so I already forgot why.
Ah, there it is. Look at this option:
config BR2_TOOLCHAIN_BUILDROOT_FORTRAN
bool "Enable Fortran support"
+ # on architecture building libquadmath, wchar is required
+ depends on !BR2_TOOLCHAIN_HAS_LIBQUADMATH || \
+ (BR2_TOOLCHAIN_HAS_LIBQUADMATH && BR2_USE_WCHAR)
How would express the dependency of Fortran is
BR2_TOOLCHAIN_HAS_LIBQUADMATH handles the BR2_USE_WCHAR dependency?
libquadmath is only available on i386 and x86_64, and in *this* case
wchar is needed for Fortran support.
So, we want to show the Fortran option if:
* We are on an architecture that does not need libquadmath
or
* We are on an architecture that does need libquadmath, in which case
we also need wchar.
Do you see a better solution ?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains
2016-07-03 15:02 ` [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Thomas Petazzoni
@ 2016-07-04 22:56 ` Samuel Martin
2016-07-05 6:33 ` Thomas Petazzoni
0 siblings, 1 reply; 21+ messages in thread
From: Samuel Martin @ 2016-07-04 22:56 UTC (permalink / raw)
To: buildroot
Hi all,
On Sun, Jul 3, 2016 at 5:02 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Sun, 3 Jul 2016 15:47:36 +0200, Samuel Martin wrote:
>
>> Samuel Martin (13):
>> toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH
>> hidden symbol
>> package/gcc: complete the logic on libquadmath
>> package/gcc: fix fortran support
>> toolchain: add hidden symbol for fortran support in the toolchain
>> docs/manual: document dependency on fortran
>> package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate
>> pkg-cmake.mk: export the fortran compiler path in the CMake toolchain
>> file
>> toolchain/helpers: add fortran check
>> toolchain/toolchain-external: enable fortran check when it is selected
>> toolchain/toolchain-external: add libgfortran and libquadmath to the
>> TOOLCHAIN_EXTERNAL_LIBS list
>> toolchain/toolchain-external: add knob for fortran support
>> toolchain/toolchain-external: update external toolchain configuration
>> with BR2_TOOLCHAIN_HAS_FORTRAN
>> package/fftw: add fortran support
>
> I've applied those patches, with some minor tweaks here and there.
>
> However, I haven't applied the lapack patch since it fails to build
> with the Linaro toolchain as we discussed.
I've just rebased this patch on top of master (which includes this
commit [1] from Vicente), and now lapack builds correctly with
external prebuilt vendor toolchains.
[1] https://github.com/buildroot/buildroot/commit/c1d90e9bb7ad1b9737db9f6476a5bdaa27a9fa8a
Regards,
--
Samuel
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains
2016-07-04 22:56 ` Samuel Martin
@ 2016-07-05 6:33 ` Thomas Petazzoni
2016-07-05 6:48 ` Samuel Martin
0 siblings, 1 reply; 21+ messages in thread
From: Thomas Petazzoni @ 2016-07-05 6:33 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 5 Jul 2016 00:56:06 +0200, Samuel Martin wrote:
> I've just rebased this patch on top of master (which includes this
> commit [1] from Vicente), and now lapack builds correctly with
> external prebuilt vendor toolchains.
Excellent! So it was really due to the --sysroot being missing, which
makes sense.
Will you resubmit the lapack patch ?
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 21+ messages in thread
* [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains
2016-07-05 6:33 ` Thomas Petazzoni
@ 2016-07-05 6:48 ` Samuel Martin
0 siblings, 0 replies; 21+ messages in thread
From: Samuel Martin @ 2016-07-05 6:48 UTC (permalink / raw)
To: buildroot
On Tue, Jul 5, 2016 at 8:33 AM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Tue, 5 Jul 2016 00:56:06 +0200, Samuel Martin wrote:
>
>> I've just rebased this patch on top of master (which includes this
>> commit [1] from Vicente), and now lapack builds correctly with
>> external prebuilt vendor toolchains.
>
> Excellent! So it was really due to the --sysroot being missing, which
> makes sense.
>
> Will you resubmit the lapack patch ?
I wiil.
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
--
Samuel
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2016-07-05 6:48 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-03 13:47 [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 01/14] toolchain/toolchain-common.in: add BR2_TOOLCHAIN_HAS_LIBQUADMATH hidden symbol Samuel Martin
2016-07-04 9:16 ` Arnout Vandecappelle
2016-07-04 14:22 ` Thomas Petazzoni
2016-07-03 13:47 ` [Buildroot] [PATCH v3 02/14] package/gcc: complete the logic on libquadmath Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 03/14] package/gcc: fix fortran support Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 04/14] toolchain: add hidden symbol for fortran support in the toolchain Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 05/14] docs/manual: document dependency on fortran Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 06/14] package/gcc: select BR2_TOOLCHAIN_HAS_FORTRAN when appropriate Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 07/14] pkg-cmake.mk: export the fortran compiler path in the CMake toolchain file Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 08/14] toolchain/helpers: add fortran check Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 09/14] toolchain/toolchain-external: enable fortran check when it is selected Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 10/14] toolchain/toolchain-external: add libgfortran and libquadmath to the TOOLCHAIN_EXTERNAL_LIBS list Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 11/14] toolchain/toolchain-external: add knob for fortran support Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 12/14] toolchain/toolchain-external: update external toolchain configuration with BR2_TOOLCHAIN_HAS_FORTRAN Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 13/14] package/fftw: add fortran support Samuel Martin
2016-07-03 13:47 ` [Buildroot] [PATCH v3 14/14] package/lapack: new package Samuel Martin
2016-07-03 15:02 ` [Buildroot] [PATCH v3 00/14] Fortran support for all toolchains Thomas Petazzoni
2016-07-04 22:56 ` Samuel Martin
2016-07-05 6:33 ` Thomas Petazzoni
2016-07-05 6:48 ` Samuel Martin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox