From eb65a8970a2b166d67d192d93ac70083f38a3a6e Mon Sep 17 00:00:00 2001 From: Anton Chernov Date: Fri, 25 May 2018 18:34:20 +0200 Subject: [PATCH] Added fortran compiler * Added FC to all Dockerfiles * Changed cmake toolchains to use environment variables for compilers --- android-arm/Dockerfile | 3 ++- android-arm/Toolchain.cmake | 11 ++++++----- android-arm64/Dockerfile | 3 ++- android-arm64/Toolchain.cmake | 11 ++++++----- linux-arm64/Dockerfile.in | 3 ++- linux-arm64/Toolchain.cmake | 8 ++++---- linux-armv5/Dockerfile | 3 ++- linux-armv5/Toolchain.cmake | 8 ++++---- linux-armv6/Dockerfile | 3 ++- linux-armv6/Toolchain.cmake | 8 ++++---- linux-armv7/Dockerfile | 3 ++- linux-armv7/Toolchain.cmake | 6 +++--- linux-mips/Dockerfile.in | 3 ++- linux-mips/Toolchain.cmake | 6 +++--- linux-mipsel/Dockerfile | 3 ++- linux-mipsel/Toolchain.cmake | 8 ++++---- linux-ppc64le/Dockerfile | 3 ++- linux-ppc64le/Toolchain.cmake | 6 +++--- linux-s390x/Dockerfile.in | 3 ++- linux-s390x/Toolchain.cmake | 6 +++--- linux-x64/Dockerfile | 3 ++- linux-x64/Toolchain.cmake | 5 +++-- linux-x86/Toolchain.cmake | 5 +++-- manylinux-x64/Dockerfile.in | 3 ++- manylinux-x86/Dockerfile.in | 3 ++- windows-x64/Dockerfile | 3 ++- windows-x86/Dockerfile | 3 ++- 27 files changed, 76 insertions(+), 57 deletions(-) diff --git a/android-arm/Dockerfile b/android-arm/Dockerfile index 9a28c15..9bf7af0 100644 --- a/android-arm/Dockerfile +++ b/android-arm/Dockerfile @@ -14,7 +14,8 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ \ - LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld + LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \ + FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran ENV ANDROID_NDK_REVISION 16b ENV ANDROID_NDK_API 16 diff --git a/android-arm/Toolchain.cmake b/android-arm/Toolchain.cmake index 1399fee..5b64c58 100644 --- a/android-arm/Toolchain.cmake +++ b/android-arm/Toolchain.cmake @@ -2,17 +2,18 @@ set(CMAKE_SYSTEM_NAME Android) set(CMAKE_SYSTEM_VERSION 1) set(cross_triple arm-linux-androideabi) -set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /usr/${cross_triple}/) +set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) set(CMAKE_ANDROID_ARM_MODE 1) set(CMAKE_ANDROID_ARM_NEON 1) -set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang) -set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang++) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) -set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_SYSROOT /usr/${cross_triple}/sysroot) +set(CMAKE_SYSROOT $ENV{CROSS_ROOT}/sysroot) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) diff --git a/android-arm64/Dockerfile b/android-arm64/Dockerfile index dda6733..5d1d3cb 100644 --- a/android-arm64/Dockerfile +++ b/android-arm64/Dockerfile @@ -15,7 +15,8 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ \ - LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld + LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \ + FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran ENV ANDROID_NDK_REVISION 16b ENV ANDROID_NDK_API 21 diff --git a/android-arm64/Toolchain.cmake b/android-arm64/Toolchain.cmake index 8645275..152ff74 100644 --- a/android-arm64/Toolchain.cmake +++ b/android-arm64/Toolchain.cmake @@ -2,18 +2,19 @@ set(CMAKE_SYSTEM_NAME Android) set(CMAKE_SYSTEM_VERSION 1) set(cross_triple aarch64-linux-android) -set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN /usr/${cross_triple}/) +set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) set(CMAKE_ANDROID_ARM_MODE 1) set(CMAKE_ANDROID_ARM_NEON 1) -set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang) -set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-clang++) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) -set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple}) +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_SYSROOT /usr/${cross_triple}/sysroot) +set(CMAKE_SYSROOT $ENV{CROSS_ROOT}/sysroot) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/qemu-arm) diff --git a/linux-arm64/Dockerfile.in b/linux-arm64/Dockerfile.in index aedf1e8..365439e 100644 --- a/linux-arm64/Dockerfile.in +++ b/linux-arm64/Dockerfile.in @@ -31,7 +31,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-as \ CC=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-cpp \ CXX=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-ld + LD=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/bin/${CROSS_TRIPLE}/bin/${CROSS_TRIPLE}-gfortran ENV DEFAULT_DOCKCROSS_IMAGE dockcross/linux-arm64 WORKDIR /work diff --git a/linux-arm64/Toolchain.cmake b/linux-arm64/Toolchain.cmake index b2a07c3..29cdde6 100644 --- a/linux-arm64/Toolchain.cmake +++ b/linux-arm64/Toolchain.cmake @@ -5,11 +5,11 @@ set(CMAKE_SYSTEM_PROCESSOR aarch64) set(cross_triple "aarch64-unknown-linux-gnueabi") -set(CMAKE_C_COMPILER /usr/bin/aarch64-unknown-linux-gnueabi/bin/${cross_triple}-cc) -set(CMAKE_CXX_COMPILER /usr/bin/aarch64-unknown-linux-gnueabi/bin/${cross_triple}-c++) -set(CMAKE_Fortran_COMPILER /usr/bin/aarch64-unknown-linux-gnueabi/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) -set(CMAKE_FIND_ROOT_PATH /usr/bin/aarch64-unknown-linux-gnueabi) +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT}) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/linux-armv5/Dockerfile b/linux-armv5/Dockerfile index c3c0dfd..519d2f7 100644 --- a/linux-armv5/Dockerfile +++ b/linux-armv5/Dockerfile @@ -23,7 +23,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/bin/${CROSS_TRIPLE}-cpp-4.9 \ CXX=/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/bin/${CROSS_TRIPLE}-gfortran ENV QEMU_LD_PREFIX ${CROSS_ROOT}/libc ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${CROSS_ROOT}/libc/lib/${CROSS_TRIPLE}/" diff --git a/linux-armv5/Toolchain.cmake b/linux-armv5/Toolchain.cmake index 932ca15..6e37770 100644 --- a/linux-armv5/Toolchain.cmake +++ b/linux-armv5/Toolchain.cmake @@ -4,11 +4,11 @@ set(CMAKE_SYSTEM_PROCESSOR arm) set(cross_triple "arm-linux-gnueabi") -set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++) -set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) -set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple} /usr/${cross_triple}/libc/usr) +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT} $ENV{CROSS_ROOT}/libc/usr) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/linux-armv6/Dockerfile b/linux-armv6/Dockerfile index a7e1d8f..6c4e068 100644 --- a/linux-armv6/Dockerfile +++ b/linux-armv6/Dockerfile @@ -18,7 +18,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/bin/${CROSS_TRIPLE}-cpp \ CXX=/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/bin/${CROSS_TRIPLE}-gfortran # Raspberry Pi is ARMv6+VFP2, Debian armhf is ARMv7+VFP3 # Since this Dockerfile is targeting linux-arm from Raspberry Pi onward, diff --git a/linux-armv6/Toolchain.cmake b/linux-armv6/Toolchain.cmake index 1336f9d..39508d6 100644 --- a/linux-armv6/Toolchain.cmake +++ b/linux-armv6/Toolchain.cmake @@ -4,11 +4,11 @@ set(CMAKE_SYSTEM_PROCESSOR arm) set(cross_triple "arm-linux-gnueabihf") -set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++) -set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) -set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple} /usr/${cross_triple}/libc/usr) +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT} $ENV{CROSS_ROOT}/libc/usr) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/linux-armv7/Dockerfile b/linux-armv7/Dockerfile index 746b4d1..717899a 100644 --- a/linux-armv7/Dockerfile +++ b/linux-armv7/Dockerfile @@ -23,7 +23,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/bin/${CROSS_TRIPLE}-cpp-4.9 \ CXX=/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/bin/${CROSS_TRIPLE}-gfortran ENV DEFAULT_DOCKCROSS_IMAGE dockcross/linux-armv7 diff --git a/linux-armv7/Toolchain.cmake b/linux-armv7/Toolchain.cmake index 51601a9..9b69816 100644 --- a/linux-armv7/Toolchain.cmake +++ b/linux-armv7/Toolchain.cmake @@ -4,9 +4,9 @@ set(CMAKE_SYSTEM_PROCESSOR arm) set(cross_triple "arm-linux-gnueabihf") -set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-cc) -set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-c++) -set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) # Discard path returned by pkg-config and associated with HINTS in module # like FindOpenSSL. diff --git a/linux-mips/Dockerfile.in b/linux-mips/Dockerfile.in index 38da904..0b0f983 100644 --- a/linux-mips/Dockerfile.in +++ b/linux-mips/Dockerfile.in @@ -20,7 +20,8 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ - LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld + LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \ + FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran ENV QEMU_LD_PREFIX "${CROSS_ROOT}/${CROSS_TRIPLE}/sysroot" ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${QEMU_LD_PREFIX}" diff --git a/linux-mips/Toolchain.cmake b/linux-mips/Toolchain.cmake index 60eb52c..abf4616 100644 --- a/linux-mips/Toolchain.cmake +++ b/linux-mips/Toolchain.cmake @@ -5,9 +5,9 @@ set(CMAKE_SYSTEM_PROCESSOR mips) set(cross_triple "mips-unknown-linux-gnu") set(cross_root /usr/xcc/${cross_triple}) -set(CMAKE_C_COMPILER ${cross_root}/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER ${cross_root}/bin/${cross_triple}-g++) -set(CMAKE_Fortran_COMPILER ${cross_root}/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) set(CMAKE_FIND_ROOT_PATH ${cross_root}/lib ${cross_root}/${cross_triple}/lib) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/linux-mipsel/Dockerfile b/linux-mipsel/Dockerfile index a824cba..cbcb316 100644 --- a/linux-mipsel/Dockerfile +++ b/linux-mipsel/Dockerfile @@ -23,7 +23,8 @@ ENV AS=${CROSS_ROOT}/${CROSS_TRIPLE}-as \ CC=${CROSS_ROOT}/${CROSS_TRIPLE}-gcc \ CPP=${CROSS_ROOT}/${CROSS_TRIPLE}-cpp-4.9 \ CXX=${CROSS_ROOT}/${CROSS_TRIPLE}-g++ \ - LD=${CROSS_ROOT}/${CROSS_TRIPLE}-ld + LD=${CROSS_ROOT}/${CROSS_TRIPLE}-ld \ + FC=${CROSS_ROOT}/${CROSS_TRIPLE}-gfortran ENV QEMU_LD_PREFIX ${CROSS_ROOT}/libc ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${CROSS_ROOT}/libc/lib/${CROSS_TRIPLE}/" diff --git a/linux-mipsel/Toolchain.cmake b/linux-mipsel/Toolchain.cmake index c4c496a..70b8a32 100644 --- a/linux-mipsel/Toolchain.cmake +++ b/linux-mipsel/Toolchain.cmake @@ -4,11 +4,11 @@ set(CMAKE_SYSTEM_PROCESSOR mipsel) set(cross_triple "mipsel-linux-gnu") -set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++) -set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) -set(CMAKE_FIND_ROOT_PATH /usr/${cross_triple} /usr/${cross_triple}/libc/usr) +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT} $ENV{CROSS_ROOT}/libc/usr) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/linux-ppc64le/Dockerfile b/linux-ppc64le/Dockerfile index 73008c0..b7ecb18 100644 --- a/linux-ppc64le/Dockerfile +++ b/linux-ppc64le/Dockerfile @@ -32,7 +32,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/bin/${CROSS_TRIPLE}-cpp \ CXX=/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/bin/${CROSS_TRIPLE}-gfortran ENV DEFAULT_DOCKCROSS_IMAGE dockcross/linux-ppc64le WORKDIR /work diff --git a/linux-ppc64le/Toolchain.cmake b/linux-ppc64le/Toolchain.cmake index 69e1a95..50c94ac 100644 --- a/linux-ppc64le/Toolchain.cmake +++ b/linux-ppc64le/Toolchain.cmake @@ -4,9 +4,9 @@ set(CMAKE_SYSTEM_PROCESSOR ppc64le) set(cross_triple "powerpc64le-linux-gnu") -set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-cc) -set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-c++) -set(CMAKE_Fortran_COMPILER /usr/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) # Discard path returned by pkg-config and associated with HINTS in module # like FindOpenSSL. diff --git a/linux-s390x/Dockerfile.in b/linux-s390x/Dockerfile.in index fb5bf18..490a74d 100644 --- a/linux-s390x/Dockerfile.in +++ b/linux-s390x/Dockerfile.in @@ -20,7 +20,8 @@ ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gcc \ CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-g++ \ - LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld + LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \ + FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran ENV QEMU_LD_PREFIX "${CROSS_ROOT}/${CROSS_TRIPLE}/sysroot" ENV QEMU_SET_ENV "LD_LIBRARY_PATH=${CROSS_ROOT}/lib:${QEMU_LD_PREFIX}" diff --git a/linux-s390x/Toolchain.cmake b/linux-s390x/Toolchain.cmake index 70d29d3..1345cf9 100644 --- a/linux-s390x/Toolchain.cmake +++ b/linux-s390x/Toolchain.cmake @@ -5,9 +5,9 @@ set(CMAKE_SYSTEM_PROCESSOR s390x) set(cross_triple "s390x-ibm-linux-gnu") set(cross_root /usr/xcc/${cross_triple}) -set(CMAKE_C_COMPILER ${cross_root}/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER ${cross_root}/bin/${cross_triple}-g++) -set(CMAKE_Fortran_COMPILER ${cross_root}/bin/${cross_triple}-gfortran) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) set(CMAKE_FIND_ROOT_PATH ${cross_root}/lib ${cross_root}/${cross_triple}/lib) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/linux-x64/Dockerfile b/linux-x64/Dockerfile index 5f7da03..b713ff3 100644 --- a/linux-x64/Dockerfile +++ b/linux-x64/Dockerfile @@ -8,7 +8,8 @@ ENV AS=/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/bin/${CROSS_TRIPLE}-cpp \ CXX=/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/bin/${CROSS_TRIPLE}-gfortran COPY ${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop diff --git a/linux-x64/Toolchain.cmake b/linux-x64/Toolchain.cmake index 3ed842f..9866b79 100644 --- a/linux-x64/Toolchain.cmake +++ b/linux-x64/Toolchain.cmake @@ -4,8 +4,9 @@ set(CMAKE_SYSTEM_PROCESSOR x86_64) set(cross_triple "x86_64-linux-gnu") -set(CMAKE_C_COMPILER /usr/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER /usr/bin/${cross_triple}-g++) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) set(CMAKE_CROSSCOMPILING_EMULATOR /usr/bin/${cross_triple}-noop) diff --git a/linux-x86/Toolchain.cmake b/linux-x86/Toolchain.cmake index 4245df7..5495ed8 100644 --- a/linux-x86/Toolchain.cmake +++ b/linux-x86/Toolchain.cmake @@ -9,8 +9,9 @@ set(CMAKE_SYSTEM_PROCESSOR i686) set(cross_triple "i686-linux-gnu") -set(CMAKE_C_COMPILER /usr/${cross_triple}/bin/${cross_triple}-gcc) -set(CMAKE_CXX_COMPILER /usr/${cross_triple}/bin/${cross_triple}-g++) +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) # Discard path returned by pkg-config and associated with HINTS in module diff --git a/manylinux-x64/Dockerfile.in b/manylinux-x64/Dockerfile.in index b57784f..45f732c 100644 --- a/manylinux-x64/Dockerfile.in +++ b/manylinux-x64/Dockerfile.in @@ -14,7 +14,8 @@ ENV AS=${CROSS_ROOT}/as \ CC=${CROSS_ROOT}/gcc \ CPP=${CROSS_ROOT}/cpp \ CXX=${CROSS_ROOT}/g++ \ - LD=${CROSS_ROOT}/ld + LD=${CROSS_ROOT}/ld \ + FC=${CROSS_ROOT}/gfortran COPY linux-x64/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop diff --git a/manylinux-x86/Dockerfile.in b/manylinux-x86/Dockerfile.in index a823e92..9795274 100644 --- a/manylinux-x86/Dockerfile.in +++ b/manylinux-x86/Dockerfile.in @@ -14,7 +14,8 @@ ENV AS=${CROSS_ROOT}/as \ CC=${CROSS_ROOT}/gcc \ CPP=${CROSS_ROOT}/cpp \ CXX=${CROSS_ROOT}/g++ \ - LD=${CROSS_ROOT}/ld + LD=${CROSS_ROOT}/ld \ + FC=${CROSS_ROOT}/gfortran COPY linux-x86/${CROSS_TRIPLE}-noop.sh /usr/bin/${CROSS_TRIPLE}-noop diff --git a/windows-x64/Dockerfile b/windows-x64/Dockerfile index 1ccfb65..6005047 100644 --- a/windows-x64/Dockerfile +++ b/windows-x64/Dockerfile @@ -63,7 +63,8 @@ ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-cpp \ CXX=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gfortran ENV DEFAULT_DOCKCROSS_IMAGE dockcross/windows-x64 WORKDIR /work diff --git a/windows-x86/Dockerfile b/windows-x86/Dockerfile index fbe064d..542d3a6 100644 --- a/windows-x86/Dockerfile +++ b/windows-x86/Dockerfile @@ -63,7 +63,8 @@ ENV AS=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-as \ CC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gcc \ CPP=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-cpp \ CXX=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-g++ \ - LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld + LD=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-ld \ + FC=/usr/src/mxe/usr/bin/${CROSS_TRIPLE}-gfortran ENV DEFAULT_DOCKCROSS_IMAGE dockcross/windows-x86 WORKDIR /work