From df89a11ae4a75eaa0b9fcc610044138cbea95243 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 13 Feb 2022 09:28:13 +1100 Subject: [PATCH 01/32] spdx lint --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index eff7340..d91c70b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -103,7 +103,7 @@ outputs: about: home: http://github.com/flang-compiler/flang - license: Apache 2.0 + license: Apache-2.0 license_file: LICENSE.txt summary: Flang is a Fortran compiler targeting LLVM. From 64b6169b261580f3d7ddd74a2d0d7b69a2d06bd5 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 29 Dec 2022 16:37:44 +1100 Subject: [PATCH 02/32] switch to LLVM flang --- recipe/bld.bat | 10 ++++---- recipe/build.sh | 15 ++++++------ recipe/meta.yaml | 61 ++++++++++++++++++++---------------------------- 3 files changed, 39 insertions(+), 47 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 9c82689..10ae5f6 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -7,13 +7,15 @@ cmake -G "Ninja" ^ -DCMAKE_C_COMPILER=clang-cl ^ -DCMAKE_CXX_COMPILER=clang-cl ^ -DCMAKE_BUILD_TYPE="Release" ^ + -DCMAKE_CXX_STANDARD=17 ^ -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^ -DTARGET_ARCHITECTURE=AMD64 ^ - %SRC_DIR% - -if errorlevel 1 exit 1 + %SRC_DIR%\flang +if %ERRORLEVEL% neq 0 exit 1 cmake --build . -if errorlevel 1 exit 1 +if %ERRORLEVEL% neq 0 exit 1 +cmake --install . +if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index 2df4080..5459a7d 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,12 +1,13 @@ mkdir build cd build -cmake \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ - -DCMAKE_PREFIX_PATH=$PREFIX \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_Fortran_COMPILER=flang \ - .. +cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_PREFIX_PATH=$PREFIX \ + ../flang -make -j${CPU_COUNT} +cmake --build . +cmake --install . diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d91c70b..6dfa0d7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,24 +1,15 @@ -{% set clang_variant = os.environ.get('CLANG_VARIANT', 'flang') %} -{% set flang_commit = "1192ff0775ddf94f7944dc40181406c088b4d575" %} -{% set llvm_version = "11.0.1" %} -{% set version = llvm_version %} -{% set sha256 = "e4fa46a0b29cabf4c4583231b79f923d6296efc4196099cbaebf5828f03a2607" %} -{% set build_number = "20210131" %} +{% set version = "15.0.5" %} package: name: flang-split version: {{ version }} source: - url: https://github.com/xoviat/flang/archive/{{ flang_commit }}.tar.gz - sha256: {{ sha256 }} + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz + sha256: 9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6 build: - number: {{ build_number }} - skip: true # [osx] - skip: true # [unix] - skip: true # [win32] - skip: true # [win and vc<14] + number: 0 track_features: - flang @@ -28,13 +19,12 @@ requirements: - {{ compiler('cxx') }} - cmake - ninja - - m2-sed # [win] - - m2-gawk # [win] - - m2-grep # [win] host: - - clangdev =={{ llvm_version }} - - llvm-openmp =={{ llvm_version }} - - llvmdev =={{ llvm_version }} + - clangdev =={{ version }} + - compiler-rt =={{ version }} + - llvm-openmp =={{ version }} + - llvmdev =={{ version }} + - mlir =={{ version }} test: commands: @@ -50,15 +40,14 @@ outputs: - {{ compiler('cxx') }} - cmake - ninja - - m2-sed # [win] - - m2-gawk # [win] - - m2-grep # [win] host: - - clangdev =={{ llvm_version }} - - llvm-openmp =={{ llvm_version }} - - llvmdev =={{ llvm_version }} + - clangdev =={{ version }} + - compiler-rt =={{ version }} + - llvm-openmp =={{ version }} + - llvmdev =={{ version }} + - mlir =={{ version }} run: - - llvm-openmp =={{ llvm_version }} + - llvm-openmp =={{ version }} - name: flang script: install_flang.sh # [unix] @@ -72,16 +61,15 @@ outputs: - {{ compiler('cxx') }} - cmake - ninja - - m2-sed # [win] - - m2-gawk # [win] - - m2-grep # [win] host: - - clangdev =={{ llvm_version }} - - llvm-openmp =={{ llvm_version }} - - llvmdev =={{ llvm_version }} + - clangdev =={{ version }} + - compiler-rt =={{ version }} + - llvm-openmp =={{ version }} + - llvmdev =={{ version }} + - mlir =={{ version }} run: - - clangdev =={{ llvm_version }} - - llvm-openmp =={{ llvm_version }} + - clangdev =={{ version }} + - llvm-openmp =={{ version }} - {{ pin_subpackage('libflang', exact=True) }} test: files: @@ -102,10 +90,11 @@ outputs: about: - home: http://github.com/flang-compiler/flang + home: https://flang.llvm.org license: Apache-2.0 - license_file: LICENSE.txt + license_file: flang/LICENSE.TXT summary: Flang is a Fortran compiler targeting LLVM. + dev_url: https://github.com/llvm/llvm-project extra: recipe-maintainers: From db120e412042eb5bf4f53884a5c792874f819544 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 6 Feb 2023 17:21:33 +1100 Subject: [PATCH 03/32] follow upstream standalone build instructions --- recipe/build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 5459a7d..fb621c9 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -1,13 +1,23 @@ +#!/bin/bash +set -ex + mkdir build cd build cmake -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=17 \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_PREFIX_PATH=$PREFIX \ + -DFLANG_ENABLE_WERROR=ON \ + -DLLVM_BUILD_MAIN_SRC_DIR=.. \ + -DLLVM_EXTERNAL_LIT=$PREFIX/bin/lit \ + -DLLVM_LIT_ARGS=-v \ + -DLLVM_CMAKE_DIR=$PREFIX/lib/cmake/llvm \ + -DCLANG_DIR=$PREFIX/lib/cmake/clang \ + -DMLIR_DIR=$PREFIX/lib/cmake/mlir \ ../flang - cmake --build . cmake --install . From 581afc3f99f292dfc58d1177a6b1b288f69178a7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 14 Feb 2023 14:31:30 +1100 Subject: [PATCH 04/32] switch to rc sources/target --- recipe/conda_build_config.yaml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipe/conda_build_config.yaml diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml new file mode 100644 index 0000000..b2aedab --- /dev/null +++ b/recipe/conda_build_config.yaml @@ -0,0 +1,5 @@ +channel_targets: + - conda-forge llvm_rc + +channel_sources: + - conda-forge/label/llvm_rc,conda-forge From 2903f5570bb806c61febfebf7281fb9fe349494b Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 14 Feb 2023 14:30:46 +1100 Subject: [PATCH 05/32] collected changes while building 16.0.0.rc2 * add lit * don't build tests * adapt bld.bat * reduce parallelism in `cmake --build` * build shared libs * use cos7 sysroot * host-depend on llvm/libclang-cpp for run-exports * use flang-new for now --- recipe/bld.bat | 14 +++++++++++++- recipe/build.sh | 5 +++-- recipe/meta.yaml | 15 ++++++++++++--- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 10ae5f6..49ac750 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -1,15 +1,27 @@ +@echo on + mkdir build cd build set "PROCESSOR_ARCHITECTURE=AMD64" cmake -G "Ninja" ^ + -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_C_COMPILER=clang-cl ^ -DCMAKE_CXX_COMPILER=clang-cl ^ -DCMAKE_BUILD_TYPE="Release" ^ -DCMAKE_CXX_STANDARD=17 ^ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ^ + -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ - -DCMAKE_INSTALL_PREFIX:PATH=%LIBRARY_PREFIX% ^ + -DFLANG_ENABLE_WERROR=ON ^ + -DLLVM_BUILD_MAIN_SRC_DIR=.. ^ + -DLLVM_EXTERNAL_LIT=%LIBRARY_BIN%/lit ^ + -DLLVM_LIT_ARGS=-v ^ + -DLLVM_CMAKE_DIR=%LIBRARY_LIB%/cmake/llvm ^ + -DCLANG_DIR=%LIBRARY_LIB%/cmake/clang ^ + -DFLANG_INCLUDE_TESTS=OFF ^ + -DMLIR_DIR=%LIBRARY_LIB%/cmake/mlir ^ -DTARGET_ARCHITECTURE=AMD64 ^ %SRC_DIR%\flang if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index fb621c9..49b12c6 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -5,19 +5,20 @@ mkdir build cd build cmake -G Ninja \ + -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_PREFIX_PATH=$PREFIX \ -DFLANG_ENABLE_WERROR=ON \ - -DLLVM_BUILD_MAIN_SRC_DIR=.. \ -DLLVM_EXTERNAL_LIT=$PREFIX/bin/lit \ -DLLVM_LIT_ARGS=-v \ -DLLVM_CMAKE_DIR=$PREFIX/lib/cmake/llvm \ -DCLANG_DIR=$PREFIX/lib/cmake/clang \ + -DFLANG_INCLUDE_TESTS=OFF \ -DMLIR_DIR=$PREFIX/lib/cmake/mlir \ ../flang -cmake --build . +cmake --build . -j1 cmake --install . diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6dfa0d7..59d5d35 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "15.0.5" %} +{% set version = "16.0.0.rc2" %} package: name: flang-split @@ -6,7 +6,7 @@ package: source: url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 9c4278a6b8884eb7f4ae7dfe3c8e5445019824885e47cfdf1392563c47316fd6 + sha256: 2ae53e4d9cdc46e660359a5311f276bd4cb39c310345de951c580a09b4f34861 build: number: 0 @@ -17,11 +17,13 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} + - sysroot_linux-64 =2.17 # [linux64] - cmake - ninja host: - clangdev =={{ version }} - compiler-rt =={{ version }} + - lit =={{ version }} - llvm-openmp =={{ version }} - llvmdev =={{ version }} - mlir =={{ version }} @@ -38,6 +40,7 @@ outputs: build: - {{ compiler('c') }} - {{ compiler('cxx') }} + - sysroot_linux-64 =2.17 # [linux64] - cmake - ninja host: @@ -59,6 +62,7 @@ outputs: build: - {{ compiler('c') }} - {{ compiler('cxx') }} + - sysroot_linux-64 =2.17 # [linux64] - cmake - ninja host: @@ -67,6 +71,9 @@ outputs: - llvm-openmp =={{ version }} - llvmdev =={{ version }} - mlir =={{ version }} + # for required run-exports + - llvm =={{ version }} + - libclang-cpp =={{ version }} run: - clangdev =={{ version }} - llvm-openmp =={{ version }} @@ -77,7 +84,9 @@ outputs: commands: # TODO - Figure out why the following line is needed. - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 # [win64] - - flang hello_world.f90 + # see naming discussion: https://discourse.llvm.org/t/reviving-rename-flang-new-to-flang/68130/2 + # - flang hello_world.f90 + - flang-new -flang-experimental-exec hello_world.f90 - ./a.out # [unix] - a.exe # [win] From d80205c6c38f56f236916cf04cc77b408d7f8b33 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 25 Feb 2023 13:36:36 +1100 Subject: [PATCH 06/32] adapt to new lib structure --- recipe/bld.bat | 3 --- recipe/build.sh | 1 - recipe/install_flang.bat | 11 ++++++----- recipe/install_flang.sh | 15 +++++++++++---- recipe/install_libflang.bat | 8 ++++---- recipe/install_libflang.sh | 16 +++++++++++++--- recipe/install_libfortran_main.bat | 3 +++ recipe/install_libfortran_main.sh | 4 ++++ recipe/meta.yaml | 27 +++++++++++++++++++++++++++ 9 files changed, 68 insertions(+), 20 deletions(-) create mode 100644 recipe/install_libfortran_main.bat create mode 100644 recipe/install_libfortran_main.sh diff --git a/recipe/bld.bat b/recipe/bld.bat index 49ac750..8307e65 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -28,6 +28,3 @@ if %ERRORLEVEL% neq 0 exit 1 cmake --build . if %ERRORLEVEL% neq 0 exit 1 - -cmake --install . -if %ERRORLEVEL% neq 0 exit 1 diff --git a/recipe/build.sh b/recipe/build.sh index 49b12c6..82c7bef 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -21,4 +21,3 @@ cmake -G Ninja \ ../flang cmake --build . -j1 -cmake --install . diff --git a/recipe/install_flang.bat b/recipe/install_flang.bat index 3d64e5d..f60aae6 100644 --- a/recipe/install_flang.bat +++ b/recipe/install_flang.bat @@ -2,12 +2,13 @@ cd %SRC_DIR%\build call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 cmake --build . --target install -if errorlevel 1 exit 1 +if %ERRORLEVEL% neq 0 exit 1 -rm %LIBRARY_BIN%\flang.dll -rm %LIBRARY_BIN%\flangrti.dll -rm %LIBRARY_BIN%\ompstub.dll -rm %LIBRARY_BIN%\pgmath.dll +:: don't repackage libflang output +rm %LIBRARY_BIN%\FortranRuntime.dll +rm %LIBRARY_BIN%\FortranDecimal.dll +:: same for libfortran-main +rm %LIBRARY_LIB%\Fortran_main.lib :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. :: This will allow them to be run on environment activation. diff --git a/recipe/install_flang.sh b/recipe/install_flang.sh index 4ca1655..1fc5cd4 100644 --- a/recipe/install_flang.sh +++ b/recipe/install_flang.sh @@ -1,8 +1,15 @@ +#!/bin/bash +set -ex + cd $SRC_DIR/build -make install -rm $PREFIX/lib/libflang${SHLIB_EXT} -rm $PREFIX/lib/libflangrti${SHLIB_EXT} -rm $PREFIX/lib/libompstub${SHLIB_EXT} + +cmake --install . + +# don't repackage libflang output +rm $PREFIX/lib/libFortranRuntime* +rm $PREFIX/lib/libFortranDecimal* +# same for libfortran-main +rm $PREFIX/lib/libFortran_main.a for CHANGE in "activate" "deactivate" do diff --git a/recipe/install_libflang.bat b/recipe/install_libflang.bat index 087c483..8a0d3e2 100644 --- a/recipe/install_libflang.bat +++ b/recipe/install_libflang.bat @@ -1,4 +1,4 @@ -cp %SRC_DIR%/build/bin/flang.dll %LIBRARY_BIN%\ -cp %SRC_DIR%/build/bin/flangrti.dll %LIBRARY_BIN%\ -cp %SRC_DIR%/build/bin/ompstub.dll %LIBRARY_BIN%\ -cp %SRC_DIR%/build/bin/pgmath.dll %LIBRARY_BIN%\ +@echo on + +cp build\lib\FortranRuntime.lib %LIBRARY_LIB% +cp build\lib\FortranDecimal.lib %LIBRARY_LIB% diff --git a/recipe/install_libflang.sh b/recipe/install_libflang.sh index 5827c97..aef25b9 100644 --- a/recipe/install_libflang.sh +++ b/recipe/install_libflang.sh @@ -1,3 +1,13 @@ -cp $SRC_DIR/build/lib/libflang${SHLIB_EXT} $PREFIX/lib -cp $SRC_DIR/build/lib/libflangrti${SHLIB_EXT} $PREFIX/lib -cp $SRC_DIR/build/lib/libompstub${SHLIB_EXT} $PREFIX/lib +#!/bin/bash +set -ex + +if [[ "${target_platform}" == linux-* ]]; then + # copy symlink & its target, e.g. libFortranRuntime.so.16 & libFortranRuntime.so + cp $SRC_DIR/build/lib/libFortranRuntime*${SHLIB_EXT}* $PREFIX/lib + # same for libFortranDecimal + cp $SRC_DIR/build/lib/libFortranDecimal*${SHLIB_EXT}* $PREFIX/lib +else + # try static builds on unix due to segfaults with shared ones + cp $SRC_DIR/build/lib/libFortranRuntime.a $PREFIX/lib + cp $SRC_DIR/build/lib/libFortranDecimal.a $PREFIX/lib +fi diff --git a/recipe/install_libfortran_main.bat b/recipe/install_libfortran_main.bat new file mode 100644 index 0000000..07afb25 --- /dev/null +++ b/recipe/install_libfortran_main.bat @@ -0,0 +1,3 @@ +@echo on + +cp build\lib\Fortran_main.lib %LIBRARY_LIB% diff --git a/recipe/install_libfortran_main.sh b/recipe/install_libfortran_main.sh new file mode 100644 index 0000000..4240bdd --- /dev/null +++ b/recipe/install_libfortran_main.sh @@ -0,0 +1,4 @@ +#!/bin/bash +set -ex + +cp $SRC_DIR/build/lib/libFortran_main.a $PREFIX/lib diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 59d5d35..664bf90 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -51,6 +51,28 @@ outputs: - mlir =={{ version }} run: - llvm-openmp =={{ version }} + test: + commands: + - test -f $PREFIX/lib/libFortranRuntime.so # [linux] + - test -f $PREFIX/lib/libFortranRuntime.dylib # [osx] + - if not exist %LIBRARY_BIN%\FortranRuntime.dll exit 1 # [win] + + - name: libfortran-main + script: install_libfortran_main.sh # [unix] + script: install_libfortran_main.bat # [win] + requirements: + host: + - clangdev =={{ version }} + - compiler-rt =={{ version }} + - llvm-openmp =={{ version }} + - llvmdev =={{ version }} + - mlir =={{ version }} + run: + # not sure what we need here + test: + commands: + - test -f $PREFIX/lib/libFortran_main.a # [unix] + - if not exist %LIBRARY_LIB%\Fortran_main.lib exit 1 # [win] - name: flang script: install_flang.sh # [unix] @@ -78,6 +100,7 @@ outputs: - clangdev =={{ version }} - llvm-openmp =={{ version }} - {{ pin_subpackage('libflang', exact=True) }} + - {{ pin_subpackage('libfortran-main', exact=True) }} test: files: - hello_world.f90 @@ -97,6 +120,10 @@ outputs: requirements: - {{ pin_subpackage('flang', exact=True) }} + - name: libfortran-main_{{ target_platform }} + requirements: + - {{ pin_subpackage('libfortran-main', exact=True) }} + about: home: https://flang.llvm.org From d78cce02fb3f8337e38bf92eea4ee4edeedbe5ef Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 4 Mar 2023 11:53:45 +1100 Subject: [PATCH 07/32] collected changes while building 16.0.0.rc3 * use CMake modules from LLVM source * set correct path for mlir-tblgen * use relative paths in bld.bat * add mlir as a build-dep when cross-compiling * don't enable -Werror on windows * need newer glibc --- recipe/bld.bat | 4 ++-- recipe/build.sh | 5 +++++ recipe/meta.yaml | 7 +++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 8307e65..3654c28 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -13,8 +13,8 @@ cmake -G "Ninja" ^ -DCMAKE_CXX_STANDARD=17 ^ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ + -DCMAKE_MODULE_PATH=../cmake/Modules ^ -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ - -DFLANG_ENABLE_WERROR=ON ^ -DLLVM_BUILD_MAIN_SRC_DIR=.. ^ -DLLVM_EXTERNAL_LIT=%LIBRARY_BIN%/lit ^ -DLLVM_LIT_ARGS=-v ^ @@ -23,7 +23,7 @@ cmake -G "Ninja" ^ -DFLANG_INCLUDE_TESTS=OFF ^ -DMLIR_DIR=%LIBRARY_LIB%/cmake/mlir ^ -DTARGET_ARCHITECTURE=AMD64 ^ - %SRC_DIR%\flang + ..\flang if %ERRORLEVEL% neq 0 exit 1 cmake --build . diff --git a/recipe/build.sh b/recipe/build.sh index 82c7bef..5caabed 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -4,7 +4,12 @@ set -ex mkdir build cd build +if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then + CMAKE_ARGS="$CMAKE_ARGS -DLLVM_CONFIG_PATH=$BUILD_PREFIX/bin/llvm-config -DMLIR_TABLEGEN_EXE=$BUILD_PREFIX/bin/mlir-tblgen" +fi + cmake -G Ninja \ + ${CMAKE_ARGS} \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=17 \ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 664bf90..8625cd7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "16.0.0.rc2" %} +{% set version = "16.0.0.rc3" %} package: name: flang-split @@ -6,7 +6,7 @@ package: source: url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 2ae53e4d9cdc46e660359a5311f276bd4cb39c310345de951c580a09b4f34861 + sha256: 8fa9792a1a04f78d023b87c5e5bd25010d5f73a5c0ae1830e897d85821ee9325 build: number: 0 @@ -20,6 +20,7 @@ requirements: - sysroot_linux-64 =2.17 # [linux64] - cmake - ninja + - mlir =={{ version }} # [build_platform != target_platform] host: - clangdev =={{ version }} - compiler-rt =={{ version }} @@ -27,6 +28,7 @@ requirements: - llvm-openmp =={{ version }} - llvmdev =={{ version }} - mlir =={{ version }} + - zlib test: commands: @@ -93,6 +95,7 @@ outputs: - llvm-openmp =={{ version }} - llvmdev =={{ version }} - mlir =={{ version }} + - sysroot_linux-64 ==2.17 # [linux64] # for required run-exports - llvm =={{ version }} - libclang-cpp =={{ version }} From bc7f2462ec2c7ac23c27e2098a1d8f4bcb623838 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 16 Mar 2023 13:44:09 +1100 Subject: [PATCH 08/32] ensure we use matching clang on osx --- recipe/conda_build_config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index b2aedab..237bba4 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,3 +1,8 @@ +c_compiler_version: # [osx] + - 17 # [osx] +cxx_compiler_version: # [osx] + - 17 # [osx] + channel_targets: - conda-forge llvm_rc From 6aff7a79e36acacf3b29f5a92b995b6e97003730 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 16 Mar 2023 13:40:33 +1100 Subject: [PATCH 09/32] collected changes while building 16.0.0.rc4 * add patch to ensure compiler-rt gets linked on windows/unix directly (patching HandleCompilerRT did not work) * remove -Werror also on unix (fails on osx) * run-depend on sysroot on linux * also use -DCMAKE_MODULE_PATH on unix --- recipe/bld.bat | 2 +- recipe/build.sh | 2 +- recipe/meta.yaml | 24 ++++------- ...ompiler-rt-builtins-on-windows-apple.patch | 41 +++++++++++++++++++ 4 files changed, 52 insertions(+), 17 deletions(-) create mode 100644 recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch diff --git a/recipe/bld.bat b/recipe/bld.bat index 3654c28..c49776c 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -14,7 +14,7 @@ cmake -G "Ninja" ^ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -DCMAKE_MODULE_PATH=../cmake/Modules ^ - -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^ + -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%;%LIBRARY_LIB%/clang/%PKG_VERSION% ^ -DLLVM_BUILD_MAIN_SRC_DIR=.. ^ -DLLVM_EXTERNAL_LIT=%LIBRARY_BIN%/lit ^ -DLLVM_LIT_ARGS=-v ^ diff --git a/recipe/build.sh b/recipe/build.sh index 5caabed..05de59c 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -15,8 +15,8 @@ cmake -G Ninja \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_MODULE_PATH=../cmake/Modules \ -DCMAKE_PREFIX_PATH=$PREFIX \ - -DFLANG_ENABLE_WERROR=ON \ -DLLVM_EXTERNAL_LIT=$PREFIX/bin/lit \ -DLLVM_LIT_ARGS=-v \ -DLLVM_CMAKE_DIR=$PREFIX/lib/cmake/llvm \ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8625cd7..8616b2f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "16.0.0.rc3" %} +{% set version = "16.0.0.rc4" %} package: name: flang-split @@ -6,7 +6,11 @@ package: source: url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 8fa9792a1a04f78d023b87c5e5bd25010d5f73a5c0ae1830e897d85821ee9325 + sha256: 36e723b0befd0874a799253f5cfac8b00fe5bbfec3020ccf7b4fdae566a7e089 + patches: + # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); + # probably related to https://github.com/llvm/llvm-project/issues/63286 + - patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch build: number: 0 @@ -17,10 +21,10 @@ requirements: build: - {{ compiler('c') }} - {{ compiler('cxx') }} - - sysroot_linux-64 =2.17 # [linux64] - cmake - ninja - - mlir =={{ version }} # [build_platform != target_platform] + - sysroot_linux-64 ==2.17 # [linux64] + - mlir =={{ version }} # [build_platform != target_platform] host: - clangdev =={{ version }} - compiler-rt =={{ version }} @@ -39,12 +43,6 @@ outputs: script: install_libflang.sh # [unix] script: install_libflang.bat # [win] requirements: - build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - sysroot_linux-64 =2.17 # [linux64] - - cmake - - ninja host: - clangdev =={{ version }} - compiler-rt =={{ version }} @@ -84,22 +82,18 @@ outputs: - libflang >={{ version }} requirements: build: - - {{ compiler('c') }} - - {{ compiler('cxx') }} - - sysroot_linux-64 =2.17 # [linux64] - cmake - - ninja host: - clangdev =={{ version }} - compiler-rt =={{ version }} - llvm-openmp =={{ version }} - llvmdev =={{ version }} - mlir =={{ version }} - - sysroot_linux-64 ==2.17 # [linux64] # for required run-exports - llvm =={{ version }} - libclang-cpp =={{ version }} run: + - sysroot_{{ target_platform }} ==2.17 # [linux] - clangdev =={{ version }} - llvm-openmp =={{ version }} - {{ pin_subpackage('libflang', exact=True) }} diff --git a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch new file mode 100644 index 0000000..51c22fd --- /dev/null +++ b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch @@ -0,0 +1,41 @@ +From df3c0c85c00ce0cda604f63c46aeb3b5349cfd46 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Mon, 17 Apr 2023 23:38:48 +1100 +Subject: [PATCH] always link in compiler-rt builtins on windows & apple + +rather than patching HandleCompilerRT.cmake, we just +use the fact that we know where the library is located +--- + flang/CMakeLists.txt | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt +index b048ea220e..80ed2b0223 100644 +--- a/flang/CMakeLists.txt ++++ b/flang/CMakeLists.txt +@@ -46,9 +46,22 @@ endif() + include(GNUInstallDirs) + + # MSVC + clang-cl build requires clang_rt.builtin.${target} library +-if (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang) +- include(HandleCompilerRT) +- find_compiler_rt_library(builtins CLANG_RT_BUILTINS_LIBRARY) ++if (MSVC OR APPLE) ++ if (MSVC) ++ cmake_path(SET CLANG_RT_BUILTINS_LIBRARY ++ NORMALIZE ++ "$ENV{LIBRARY_LIB}/clang/$ENV{PKG_VERSION}/lib/windows/clang_rt.builtins-x86_64.lib") ++ else() ++ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") ++ cmake_path(SET CLANG_RT_BUILTINS_LIBRARY ++ NORMALIZE ++ "$ENV{PREFIX}/lib/clang/$ENV{PKG_VERSION}/lib/libclang_rt.builtins_arm64_osx.a") ++ else() ++ cmake_path(SET CLANG_RT_BUILTINS_LIBRARY ++ NORMALIZE ++ "$ENV{PREFIX}/lib/clang/$ENV{PKG_VERSION}/lib/libclang_rt.builtins_x86_64_osx.a") ++ endif() ++ endif() + get_filename_component(LIBDIR "${CLANG_RT_BUILTINS_LIBRARY}" DIRECTORY) + if (IS_DIRECTORY "${LIBDIR}") + link_libraries(${CLANG_RT_BUILTINS_LIBRARY}) From 267195daf179af87ec0812b9c4c1164337b6aae9 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 17 Apr 2023 13:56:20 +1100 Subject: [PATCH 10/32] set FORTRANFLAGS in activate.sh --- recipe/activate.sh | 13 ++++++++++--- recipe/deactivate.sh | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/recipe/activate.sh b/recipe/activate.sh index de9978b..c7b3958 100644 --- a/recipe/activate.sh +++ b/recipe/activate.sh @@ -1,10 +1,17 @@ -export _OLD_LIBRARY_PATH=$LIBRARY_PATH export _OLD_CPATH=$CPATH +export _OLD_LIBRARY_PATH=$LIBRARY_PATH +export _OLD_FORTRANFLAGS=$FORTRANFLAGS if [ -z "$CONDA_PREFIX" ]; then - export LIBRARY_PATH=$LIBRARY_PATH:$PREFIX/lib export CPATH=$CPATH:$PREFIX/include + export LIBRARY_PATH=$LIBRARY_PATH:$PREFIX/lib + export FORTRANFLAGS="$FORTRANFLAGS -isystem ${CONDA_PREFIX}/include" else - export LIBRARY_PATH=$LIBRARY_PATH:$CONDA_PREFIX/lib export CPATH=$CPATH:$CONDA_PREFIX/include + export LIBRARY_PATH=$LIBRARY_PATH:$CONDA_PREFIX/lib + export FORTRANFLAGS="$FORTRANFLAGS -isystem ${PREFIX}/include -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=${PREFIX}=/usr/local/src/conda-prefix" + export FORTRANFLAGS="$FORTRANFLAGS --sysroot=$CONDA_BUILD_SYSROOT" fi + +export FFLAGS=$FORTRANFLAGS +export Fortran_FLAGS=$FORTRANFLAGS diff --git a/recipe/deactivate.sh b/recipe/deactivate.sh index 5695966..a58df93 100644 --- a/recipe/deactivate.sh +++ b/recipe/deactivate.sh @@ -1,2 +1,3 @@ -export LIBRARY_PATH=$_OLD_LIBRARY_PATH export CPATH=$_OLD_CPATH +export FORTRANFLAGS=$_OLD_FORTRANFLAGS +export LIBRARY_PATH=$_OLD_LIBRARY_PATH From 9d4383b77533d0f84a812519fcf36e4dfec88df7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 17 Apr 2023 22:41:44 +1100 Subject: [PATCH 11/32] pull in compiler activation to test env --- recipe/meta.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8616b2f..fb4f5fb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -99,6 +99,9 @@ outputs: - {{ pin_subpackage('libflang', exact=True) }} - {{ pin_subpackage('libfortran-main', exact=True) }} test: + requires: + - {{ compiler('c') }} + - {{ compiler('cxx') }} files: - hello_world.f90 commands: From cc517ab7753606cea05dd8e65dd87ec8ab49e466 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 13 Jun 2023 17:48:22 +1100 Subject: [PATCH 12/32] don't build shared libs on windows and osx --- recipe/bld.bat | 1 - recipe/build.sh | 6 +++++- recipe/install_libflang.sh | 2 +- recipe/meta.yaml | 7 +++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index c49776c..98a9522 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -6,7 +6,6 @@ cd build set "PROCESSOR_ARCHITECTURE=AMD64" cmake -G "Ninja" ^ - -DBUILD_SHARED_LIBS=ON ^ -DCMAKE_C_COMPILER=clang-cl ^ -DCMAKE_CXX_COMPILER=clang-cl ^ -DCMAKE_BUILD_TYPE="Release" ^ diff --git a/recipe/build.sh b/recipe/build.sh index 05de59c..92baebb 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -8,9 +8,13 @@ if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then CMAKE_ARGS="$CMAKE_ARGS -DLLVM_CONFIG_PATH=$BUILD_PREFIX/bin/llvm-config -DMLIR_TABLEGEN_EXE=$BUILD_PREFIX/bin/mlir-tblgen" fi +if [[ "${target_platform}" == linux-* ]]; then + # unclear segfaults with shared builds on osx + CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=ON" +fi + cmake -G Ninja \ ${CMAKE_ARGS} \ - -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ diff --git a/recipe/install_libflang.sh b/recipe/install_libflang.sh index aef25b9..0e3f13a 100644 --- a/recipe/install_libflang.sh +++ b/recipe/install_libflang.sh @@ -7,7 +7,7 @@ if [[ "${target_platform}" == linux-* ]]; then # same for libFortranDecimal cp $SRC_DIR/build/lib/libFortranDecimal*${SHLIB_EXT}* $PREFIX/lib else - # try static builds on unix due to segfaults with shared ones + # static builds on unix due to segfaults with shared ones cp $SRC_DIR/build/lib/libFortranRuntime.a $PREFIX/lib cp $SRC_DIR/build/lib/libFortranDecimal.a $PREFIX/lib fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index fb4f5fb..e7dee61 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -53,9 +53,12 @@ outputs: - llvm-openmp =={{ version }} test: commands: + # shared lib on linux - test -f $PREFIX/lib/libFortranRuntime.so # [linux] - - test -f $PREFIX/lib/libFortranRuntime.dylib # [osx] - - if not exist %LIBRARY_BIN%\FortranRuntime.dll exit 1 # [win] + # static lib on osx (segfaults with shared ones) + - test -f $PREFIX/lib/libFortranRuntime.a # [osx] + # static lib on win (fails to export symbols for shared build) + - if not exist %LIBRARY_LIB%\FortranRuntime.lib exit 1 # [win] - name: libfortran-main script: install_libfortran_main.sh # [unix] From aef1d233253178084f7e6a73332722a2c81cfc9c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 13 Jun 2023 14:42:37 +1100 Subject: [PATCH 13/32] collected changes while building 16.0.5 * add build env for outputs; for strong run-exports and because windows expects it * add ninja to install flang * avoid clobbering libs in other outputs * remove extra call in win flang tests * remove host-deps of libfortran-main * run-depend on compiler-rt for libflang on windows * depend on conda to deduplicate already-installed files * clean-up libfortran-main --- recipe/install_flang.bat | 6 ------ recipe/install_flang.sh | 6 ------ recipe/meta.yaml | 32 +++++++++++++++++++++++--------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/recipe/install_flang.bat b/recipe/install_flang.bat index f60aae6..9e023d5 100644 --- a/recipe/install_flang.bat +++ b/recipe/install_flang.bat @@ -4,12 +4,6 @@ call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd6 cmake --build . --target install if %ERRORLEVEL% neq 0 exit 1 -:: don't repackage libflang output -rm %LIBRARY_BIN%\FortranRuntime.dll -rm %LIBRARY_BIN%\FortranDecimal.dll -:: same for libfortran-main -rm %LIBRARY_LIB%\Fortran_main.lib - :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. :: This will allow them to be run on environment activation. FOR %%F IN (activate deactivate) DO ( diff --git a/recipe/install_flang.sh b/recipe/install_flang.sh index 1fc5cd4..31a88c0 100644 --- a/recipe/install_flang.sh +++ b/recipe/install_flang.sh @@ -5,12 +5,6 @@ cd $SRC_DIR/build cmake --install . -# don't repackage libflang output -rm $PREFIX/lib/libFortranRuntime* -rm $PREFIX/lib/libFortranDecimal* -# same for libfortran-main -rm $PREFIX/lib/libFortran_main.a - for CHANGE in "activate" "deactivate" do mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e7dee61..885754b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "16.0.0.rc4" %} +{% set version = "16.0.5" %} package: name: flang-split @@ -6,7 +6,7 @@ package: source: url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 36e723b0befd0874a799253f5cfac8b00fe5bbfec3020ccf7b4fdae566a7e089 + sha256: 37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863 patches: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 @@ -43,6 +43,10 @@ outputs: script: install_libflang.sh # [unix] script: install_libflang.bat # [win] requirements: + build: + # for strong run-exports + - {{ compiler('c') }} + - {{ compiler('cxx') }} host: - clangdev =={{ version }} - compiler-rt =={{ version }} @@ -51,6 +55,9 @@ outputs: - mlir =={{ version }} run: - llvm-openmp =={{ version }} + # necessary to link on windows (even for static lib), e.g. + # FortranDecimal.lib(binary-to-decimal.cpp.obj) : error LNK2019: unresolved external symbol __udivti3 ... + - compiler-rt =={{ version }} # [win] test: commands: # shared lib on linux @@ -64,12 +71,13 @@ outputs: script: install_libfortran_main.sh # [unix] script: install_libfortran_main.bat # [win] requirements: + build: + # if there's no build env, windows fails with EnvironmentLocationNotFound (what?!) + - {{ compiler('c') }} # [win] + - {{ compiler('cxx') }} # [win] host: - - clangdev =={{ version }} - - compiler-rt =={{ version }} - - llvm-openmp =={{ version }} - - llvmdev =={{ version }} - - mlir =={{ version }} + # this is just here to have a non-empty host environment + - {{ pin_subpackage('libflang', exact=True) }} run: # not sure what we need here test: @@ -86,6 +94,10 @@ outputs: requirements: build: - cmake + - ninja + # for strong run-exports + - {{ compiler('c') }} + - {{ compiler('cxx') }} host: - clangdev =={{ version }} - compiler-rt =={{ version }} @@ -95,6 +107,10 @@ outputs: # for required run-exports - llvm =={{ version }} - libclang-cpp =={{ version }} + # ninja really wants to find z.lib on win + - zlib # [win] + - {{ pin_subpackage('libflang', exact=True) }} + - {{ pin_subpackage('libfortran-main', exact=True) }} run: - sysroot_{{ target_platform }} ==2.17 # [linux] - clangdev =={{ version }} @@ -108,8 +124,6 @@ outputs: files: - hello_world.f90 commands: - # TODO - Figure out why the following line is needed. - - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 # [win64] # see naming discussion: https://discourse.llvm.org/t/reviving-rename-flang-new-to-flang/68130/2 # - flang hello_world.f90 - flang-new -flang-experimental-exec hello_world.f90 From 4f035e7c8fd7fca167a1745e7ddc8b80e02b94a6 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 15 Jun 2023 14:26:03 +1100 Subject: [PATCH 14/32] don't let libflang depend on llvm-openmp for some silly reason, conda-build insists on merging build & host envs for the later outputs, leading to resolution conflicts due to llvm-opemp vs. libgomp coming from gcc. According to the link-check on linux, it's also not used anyway... --- recipe/meta.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 885754b..6a60f78 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -50,11 +50,9 @@ outputs: host: - clangdev =={{ version }} - compiler-rt =={{ version }} - - llvm-openmp =={{ version }} - llvmdev =={{ version }} - mlir =={{ version }} run: - - llvm-openmp =={{ version }} # necessary to link on windows (even for static lib), e.g. # FortranDecimal.lib(binary-to-decimal.cpp.obj) : error LNK2019: unresolved external symbol __udivti3 ... - compiler-rt =={{ version }} # [win] From 41026abc4b2eac83f231e3270312a34f6de661f4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 1 Jul 2023 10:20:22 +1100 Subject: [PATCH 15/32] add symbol AVOID_NATIVE_UINT128_T on windows --- recipe/bld.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/recipe/bld.bat b/recipe/bld.bat index 98a9522..7d95479 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -14,6 +14,7 @@ cmake -G "Ninja" ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -DCMAKE_MODULE_PATH=../cmake/Modules ^ -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%;%LIBRARY_LIB%/clang/%PKG_VERSION% ^ + -DAVOID_NATIVE_UINT128_T=1 ^ -DLLVM_BUILD_MAIN_SRC_DIR=.. ^ -DLLVM_EXTERNAL_LIT=%LIBRARY_BIN%/lit ^ -DLLVM_LIT_ARGS=-v ^ From f8799f59699e3d5e23f59b2c07ded7bc805347e2 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 1 Jul 2023 13:44:33 +1100 Subject: [PATCH 16/32] backport patch for AVOID_NATIVE_UINT128_T macro --- recipe/meta.yaml | 2 ++ ...ompiler-rt-builtins-on-windows-apple.patch | 6 ++--- ...typo-in-AVOID_NATIVE_UINT128_T-macro.patch | 23 +++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 6a60f78..35059a2 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,6 +11,8 @@ source: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 - patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch + # backport https://github.com/llvm/llvm-project/commit/21bff9ca42e4735a52aa1e981b1ccd0d3b274b34 + - patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch build: number: 0 diff --git a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch index 51c22fd..eb0e6fc 100644 --- a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch +++ b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch @@ -1,7 +1,7 @@ -From df3c0c85c00ce0cda604f63c46aeb3b5349cfd46 Mon Sep 17 00:00:00 2001 +From bd2a2c0e635395c9f7a16c1d032bfa6dff92ab3d Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 17 Apr 2023 23:38:48 +1100 -Subject: [PATCH] always link in compiler-rt builtins on windows & apple +Subject: [PATCH 1/2] always link in compiler-rt builtins on windows & apple rather than patching HandleCompilerRT.cmake, we just use the fact that we know where the library is located @@ -10,7 +10,7 @@ use the fact that we know where the library is located 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt -index b048ea220e..80ed2b0223 100644 +index b048ea220e2..80ed2b0223b 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -46,9 +46,22 @@ endif() diff --git a/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch b/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch new file mode 100644 index 0000000..4841722 --- /dev/null +++ b/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch @@ -0,0 +1,23 @@ +From 022f9fde8fe312e26018a224a8f494f4646477b4 Mon Sep 17 00:00:00 2001 +From: Slava Zakharin +Date: Mon, 24 Apr 2023 13:16:55 -0700 +Subject: [PATCH 2/2] [NFC][flang] Fixed typo in AVOID_NATIVE_UINT128_T macro. + Differential Revision: https://reviews.llvm.org/D149097 + +--- + flang/include/flang/Common/uint128.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/flang/include/flang/Common/uint128.h b/flang/include/flang/Common/uint128.h +index b12e1729341..bfd2eef01f6 100644 +--- a/flang/include/flang/Common/uint128.h ++++ b/flang/include/flang/Common/uint128.h +@@ -261,7 +261,7 @@ private: + using UnsignedInt128 = Int128; + using SignedInt128 = Int128; + +-#if !AVOID_NATIVE_UINT128_t && (defined __GNUC__ || defined __clang__) && \ ++#if !AVOID_NATIVE_UINT128_T && (defined __GNUC__ || defined __clang__) && \ + defined __SIZEOF_INT128__ + using uint128_t = __uint128_t; + using int128_t = __int128_t; From 92805aaf34c1aea607a5ae9f2577e6001a9d2604 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 7 Jul 2023 07:40:59 +0200 Subject: [PATCH 17/32] backport https://reviews.llvm.org/D154660 --- recipe/meta.yaml | 2 + ...ompiler-rt-builtins-on-windows-apple.patch | 2 +- ...typo-in-AVOID_NATIVE_UINT128_T-macro.patch | 2 +- ...ime-build-with-AVOID_NATIVE_INT128_T.patch | 218 ++++++++++++++++++ 4 files changed, 222 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 35059a2..b27ea45 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,6 +13,8 @@ source: - patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch # backport https://github.com/llvm/llvm-project/commit/21bff9ca42e4735a52aa1e981b1ccd0d3b274b34 - patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch + # backport https://reviews.llvm.org/D154660 + - patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch build: number: 0 diff --git a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch index eb0e6fc..a8397ac 100644 --- a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch +++ b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch @@ -1,7 +1,7 @@ From bd2a2c0e635395c9f7a16c1d032bfa6dff92ab3d Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 17 Apr 2023 23:38:48 +1100 -Subject: [PATCH 1/2] always link in compiler-rt builtins on windows & apple +Subject: [PATCH 1/3] always link in compiler-rt builtins on windows & apple rather than patching HandleCompilerRT.cmake, we just use the fact that we know where the library is located diff --git a/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch b/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch index 4841722..f6a614f 100644 --- a/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch +++ b/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch @@ -1,7 +1,7 @@ From 022f9fde8fe312e26018a224a8f494f4646477b4 Mon Sep 17 00:00:00 2001 From: Slava Zakharin Date: Mon, 24 Apr 2023 13:16:55 -0700 -Subject: [PATCH 2/2] [NFC][flang] Fixed typo in AVOID_NATIVE_UINT128_T macro. +Subject: [PATCH 2/3] [NFC][flang] Fixed typo in AVOID_NATIVE_UINT128_T macro. Differential Revision: https://reviews.llvm.org/D149097 --- diff --git a/recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch b/recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch new file mode 100644 index 0000000..dc3f20d --- /dev/null +++ b/recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch @@ -0,0 +1,218 @@ +From 4469984bd243a664641b3fc617b63d6627c18016 Mon Sep 17 00:00:00 2001 +From: Peter Klausler +Date: Thu, 6 Jul 2023 15:07:00 -0700 +Subject: [PATCH 3/3] [flang] Allow runtime build with AVOID_NATIVE_INT128_T=1 + +--- + flang/runtime/command.cpp | 10 +++++++--- + flang/runtime/io-api.cpp | 4 +++- + flang/runtime/numeric.cpp | 24 ++++++++++++------------ + flang/runtime/tools.h | 19 +++++++++++++++++-- + 4 files changed, 39 insertions(+), 18 deletions(-) + +diff --git a/flang/runtime/command.cpp b/flang/runtime/command.cpp +index 6ee012f8525..dfe0ac9f15a 100644 +--- a/flang/runtime/command.cpp ++++ b/flang/runtime/command.cpp +@@ -107,9 +107,13 @@ static void StoreLengthToDescriptor( + } + + template struct FitsInIntegerKind { +- bool operator()(std::int64_t value) { +- return value <= std::numeric_limits>::max(); ++ bool operator()([[maybe_unused]] std::int64_t value) { ++ if constexpr (KIND >= 8) { ++ return true; ++ } else { ++ return value <= std::numeric_limits>::max(); ++ } + } + }; + +diff --git a/flang/runtime/io-api.cpp b/flang/runtime/io-api.cpp +index 197cfcc2f7f..289cb805279 100644 +--- a/flang/runtime/io-api.cpp ++++ b/flang/runtime/io-api.cpp +@@ -1427,7 +1427,9 @@ static enum Iostat CheckUnitNumberInRangeImpl(INT unit, bool handleError, + // Only provide the bad unit number in the message if SignalError can print + // it accurately. Otherwise, the generic IostatUnitOverflow message will be + // used. +- if (static_cast(unit) == unit) { ++ if constexpr (sizeof(INT) > sizeof(std::intmax_t)) { ++ errorHandler.SignalError(IostatUnitOverflow); ++ } else if (static_cast(unit) == unit) { + errorHandler.SignalError(IostatUnitOverflow, + "UNIT number %jd is out of range", static_cast(unit)); + } else { +diff --git a/flang/runtime/numeric.cpp b/flang/runtime/numeric.cpp +index 7afa5802db0..e740d39e16e 100644 +--- a/flang/runtime/numeric.cpp ++++ b/flang/runtime/numeric.cpp +@@ -305,7 +305,7 @@ CppTypeFor RTNAME(Ceiling4_8)( + CppTypeFor x) { + return Ceiling>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Ceiling4_16)( + CppTypeFor x) { + return Ceiling>(x); +@@ -327,7 +327,7 @@ CppTypeFor RTNAME(Ceiling8_8)( + CppTypeFor x) { + return Ceiling>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Ceiling8_16)( + CppTypeFor x) { + return Ceiling>(x); +@@ -350,7 +350,7 @@ CppTypeFor RTNAME(Ceiling10_8)( + CppTypeFor x) { + return Ceiling>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Ceiling10_16)( + CppTypeFor x) { + return Ceiling>(x); +@@ -373,7 +373,7 @@ CppTypeFor RTNAME(Ceiling16_8)( + CppTypeFor x) { + return Ceiling>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Ceiling16_16)( + CppTypeFor x) { + return Ceiling>(x); +@@ -433,7 +433,7 @@ CppTypeFor RTNAME(Floor4_8)( + CppTypeFor x) { + return Floor>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Floor4_16)( + CppTypeFor x) { + return Floor>(x); +@@ -455,7 +455,7 @@ CppTypeFor RTNAME(Floor8_8)( + CppTypeFor x) { + return Floor>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Floor8_16)( + CppTypeFor x) { + return Floor>(x); +@@ -478,7 +478,7 @@ CppTypeFor RTNAME(Floor10_8)( + CppTypeFor x) { + return Floor>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Floor10_16)( + CppTypeFor x) { + return Floor>(x); +@@ -501,7 +501,7 @@ CppTypeFor RTNAME(Floor16_8)( + CppTypeFor x) { + return Floor>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Floor16_16)( + CppTypeFor x) { + return Floor>(x); +@@ -709,7 +709,7 @@ CppTypeFor RTNAME(Nint4_8)( + CppTypeFor x) { + return Nint>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Nint4_16)( + CppTypeFor x) { + return Nint>(x); +@@ -731,7 +731,7 @@ CppTypeFor RTNAME(Nint8_8)( + CppTypeFor x) { + return Nint>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Nint8_16)( + CppTypeFor x) { + return Nint>(x); +@@ -754,7 +754,7 @@ CppTypeFor RTNAME(Nint10_8)( + CppTypeFor x) { + return Nint>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Nint10_16)( + CppTypeFor x) { + return Nint>(x); +@@ -777,7 +777,7 @@ CppTypeFor RTNAME(Nint16_8)( + CppTypeFor x) { + return Nint>(x); + } +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + CppTypeFor RTNAME(Nint16_16)( + CppTypeFor x) { + return Nint>(x); +diff --git a/flang/runtime/tools.h b/flang/runtime/tools.h +index a9c942d53ee..fb3b56e4cb0 100644 +--- a/flang/runtime/tools.h ++++ b/flang/runtime/tools.h +@@ -128,7 +128,7 @@ inline RESULT ApplyType( + return FUNC{}(std::forward(x)...); + case 8: + return FUNC{}(std::forward(x)...); +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + case 16: + return FUNC{}(std::forward(x)...); + #endif +@@ -226,7 +226,7 @@ inline RESULT ApplyIntegerKind(int kind, Terminator &terminator, A &&...x) { + return FUNC<4>{}(std::forward(x)...); + case 8: + return FUNC<8>{}(std::forward(x)...); +-#ifdef __SIZEOF_INT128__ ++#if defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T + case 16: + return FUNC<16>{}(std::forward(x)...); + #endif +@@ -304,6 +304,11 @@ std::optional> inline constexpr GetResultType( + return std::make_pair(TypeCategory::Integer, maxKind); + case TypeCategory::Real: + case TypeCategory::Complex: ++#if !(defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T) ++ if (xKind == 16) { ++ break; ++ } ++#endif + return std::make_pair(yCat, yKind); + default: + break; +@@ -312,6 +317,11 @@ std::optional> inline constexpr GetResultType( + case TypeCategory::Real: + switch (yCat) { + case TypeCategory::Integer: ++#if !(defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T) ++ if (yKind == 16) { ++ break; ++ } ++#endif + return std::make_pair(TypeCategory::Real, xKind); + case TypeCategory::Real: + case TypeCategory::Complex: +@@ -323,6 +333,11 @@ std::optional> inline constexpr GetResultType( + case TypeCategory::Complex: + switch (yCat) { + case TypeCategory::Integer: ++#if !(defined __SIZEOF_INT128__ && !AVOID_NATIVE_UINT128_T) ++ if (yKind == 16) { ++ break; ++ } ++#endif + return std::make_pair(TypeCategory::Complex, xKind); + case TypeCategory::Real: + case TypeCategory::Complex: From 44b461eaa5436aa219b436050f6b56d4345e0b7c Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 27 Jul 2023 20:43:02 +1100 Subject: [PATCH 18/32] MNT: Re-rendered with conda-build 3.26.0, conda-smithy 3.24.1, and conda-forge-pinning 2023.07.26.21.58.02 --- .azure-pipelines/azure-pipelines-linux.yml | 40 ++++++++ .azure-pipelines/azure-pipelines-osx.yml | 33 +++++++ .azure-pipelines/azure-pipelines-win.yml | 80 ++++++---------- .ci_support/README | 7 +- .ci_support/linux_64_.yaml | 23 +++++ .ci_support/osx_64_.yaml | 23 +++++ .ci_support/win_64_.yaml | 12 +-- .circleci/config.yml | 5 +- .gitattributes | 2 + .scripts/build_steps.sh | 87 +++++++++++++++++ .scripts/logging_utils.sh | 35 +++++++ .scripts/run_docker_build.sh | 105 +++++++++++++++++++++ .scripts/run_osx_build.sh | 90 ++++++++++++++++++ LICENSE.txt | 32 +++++-- README.md | 89 +++++++++++++---- azure-pipelines.yml | 4 +- build-locally.py | 36 ++++++- 17 files changed, 610 insertions(+), 93 deletions(-) create mode 100644 .azure-pipelines/azure-pipelines-linux.yml create mode 100644 .azure-pipelines/azure-pipelines-osx.yml create mode 100644 .ci_support/linux_64_.yaml create mode 100644 .ci_support/osx_64_.yaml create mode 100755 .scripts/build_steps.sh create mode 100755 .scripts/logging_utils.sh create mode 100755 .scripts/run_docker_build.sh create mode 100755 .scripts/run_osx_build.sh diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml new file mode 100644 index 0000000..a20f315 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-linux.yml @@ -0,0 +1,40 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: linux + pool: + vmImage: ubuntu-latest + strategy: + matrix: + linux_64_: + CONFIG: linux_64_ + UPLOAD_PACKAGES: 'True' + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-cos7-x86_64 + timeoutInMinutes: 360 + + steps: + # configure qemu binfmt-misc running. This allows us to run docker containers + # embedded qemu-static + - script: | + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + ls /proc/sys/fs/binfmt_misc/ + condition: not(startsWith(variables['CONFIG'], 'linux_64')) + displayName: Configure binfmt_misc + + - script: | + export CI=azure + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + .scripts/run_docker_build.sh + displayName: Run docker build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml new file mode 100644 index 0000000..9e4e167 --- /dev/null +++ b/.azure-pipelines/azure-pipelines-osx.yml @@ -0,0 +1,33 @@ +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +# -*- mode: yaml -*- + +jobs: +- job: osx + pool: + vmImage: macOS-11 + strategy: + matrix: + osx_64_: + CONFIG: osx_64_ + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 + + steps: + # TODO: Fast finish on azure pipelines? + - script: | + export CI=azure + export OSX_FORCE_SDK_DOWNLOAD="1" + export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME + export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) + if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_osx_build.sh + displayName: Run OSX build + env: + BINSTAR_TOKEN: $(BINSTAR_TOKEN) + FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) + STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 1fd8ea1..75da5df 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -5,7 +5,7 @@ jobs: - job: win pool: - vmImage: vs2017-win2016 + vmImage: windows-2022 strategy: matrix: win_64_: @@ -14,48 +14,30 @@ jobs: timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_TEMP: D:\\tmp steps: - - script: | - choco install vcpython27 -fdv -y --debug - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Install vcpython27.msi (if needed) - - # Cygwin's git breaks conda-build. (See https://github.com/conda-forge/conda-smithy-feedstock/pull/2.) - # - script: rmdir C:\cygwin /s /q - # continueOnError: true - - - powershell: | - Set-PSDebug -Trace 1 - - $batchcontent = @" - ECHO ON - SET vcpython=C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0 - - DIR "%vcpython%" - - CALL "%vcpython%\vcvarsall.bat" %* - "@ - - $batchDir = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC" - $batchPath = "$batchDir" + "\vcvarsall.bat" - New-Item -Path $batchPath -ItemType "file" -Force - - Set-Content -Value $batchcontent -Path $batchPath - - Get-ChildItem -Path $batchDir + - task: PythonScript@0 + displayName: 'Download Miniforge' + inputs: + scriptSource: inline + script: | + import urllib.request + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' + path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" + urllib.request.urlretrieve(url, path) - Get-ChildItem -Path ($batchDir + '\..') + - script: | + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge - condition: contains(variables['CONFIG'], 'vs2008') - displayName: Patch vs2008 (if needed) + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH - - task: CondaEnvironment@1 - inputs: - packageSpecs: 'python=3.6 conda-build conda "conda-forge-ci-setup=3" pip' # Optional - installOptions: "-c conda-forge" - updateConda: true - displayName: Install conda-build and activate environment + - script: | + call activate base + mamba.exe install "python=3.10" conda-build conda pip boa conda-forge-ci-setup=3 -c conda-forge --strict-channel-priority --yes + displayName: Install conda-build - script: set PYTHONUNBUFFERED=1 displayName: Set PYTHONUNBUFFERED @@ -72,25 +54,16 @@ jobs: call activate base run_conda_forge_build_setup displayName: conda-forge build setup - - - # Special cased version setting some more things! - - script: | - call activate base - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml - displayName: Build recipe (vs2008) - env: - VS90COMNTOOLS: "C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\bin" - PYTHONUNBUFFERED: 1 - condition: contains(variables['CONFIG'], 'vs2008') - script: | call activate base - conda.exe build "recipe" -m .ci_support\%CONFIG%.yaml + if EXIST LICENSE.txt ( + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" + ) + conda.exe mambabuild "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% displayName: Build recipe env: PYTHONUNBUFFERED: 1 - condition: not(contains(variables['CONFIG'], 'vs2008')) - script: | set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" call activate base @@ -100,6 +73,9 @@ jobs: - script: | set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" + set "TEMP=$(UPLOAD_TEMP)" + if not exist "%TEMP%\" md "%TEMP%" + set "TMP=%TEMP%" call activate base upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml displayName: Upload package @@ -107,4 +83,4 @@ jobs: BINSTAR_TOKEN: $(BINSTAR_TOKEN) FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) - condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False'))) \ No newline at end of file + condition: and(succeeded(), not(eq(variables['UPLOAD_PACKAGES'], 'False')), not(eq(variables['Build.Reason'], 'PullRequest'))) \ No newline at end of file diff --git a/.ci_support/README b/.ci_support/README index e4e2dce..a47316b 100644 --- a/.ci_support/README +++ b/.ci_support/README @@ -1 +1,6 @@ -This file is automatically generated by conda-smithy. To change any matrix elements, you should change conda-smithy's input conda_build_config.yaml and re-render the recipe, rather than editing these files directly. \ No newline at end of file +This file is automatically generated by conda-smithy. If any +particular build configuration is expected, but it is not found, +please make sure all dependencies are satisfiable. To add/modify any +matrix elements, you should create/change conda-smithy's input +recipe/conda_build_config.yaml and re-render the recipe, rather than +editing these files directly. diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml new file mode 100644 index 0000000..e0b4086 --- /dev/null +++ b/.ci_support/linux_64_.yaml @@ -0,0 +1,23 @@ +c_compiler: +- gcc +c_compiler_version: +- '12' +cdt_name: +- cos6 +channel_sources: +- conda-forge/label/llvm_rc,conda-forge +channel_targets: +- conda-forge llvm_rc +cxx_compiler: +- gxx +cxx_compiler_version: +- '12' +docker_image: +- quay.io/condaforge/linux-anvil-cos7-x86_64 +target_platform: +- linux-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +zlib: +- '1.2' diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml new file mode 100644 index 0000000..9760adb --- /dev/null +++ b/.ci_support/osx_64_.yaml @@ -0,0 +1,23 @@ +MACOSX_DEPLOYMENT_TARGET: +- '10.9' +c_compiler: +- clang +c_compiler_version: +- '17' +channel_sources: +- conda-forge/label/llvm_rc,conda-forge +channel_targets: +- conda-forge llvm_rc +cxx_compiler: +- clangxx +cxx_compiler_version: +- '17' +macos_machine: +- x86_64-apple-darwin13.4.0 +target_platform: +- osx-64 +zip_keys: +- - c_compiler_version + - cxx_compiler_version +zlib: +- '1.2' diff --git a/.ci_support/win_64_.yaml b/.ci_support/win_64_.yaml index 5875235..eb1ff89 100644 --- a/.ci_support/win_64_.yaml +++ b/.ci_support/win_64_.yaml @@ -1,12 +1,12 @@ c_compiler: -- vs2017 +- vs2019 channel_sources: -- conda-forge,defaults +- conda-forge/label/llvm_rc,conda-forge channel_targets: -- conda-forge main +- conda-forge llvm_rc cxx_compiler: -- vs2017 +- vs2019 target_platform: - win-64 -vc: -- '14' +zlib: +- '1.2' diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ad461b..8b4ef2f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,14 @@ # This file was generated automatically from conda-smithy. To update this configuration, # update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- +# -*- mode: jinja-yaml -*- version: 2 jobs: build: working_directory: ~/test - machine: true + machine: + image: ubuntu-2004:current steps: - run: # The Circle-CI build should not be active, but if this is not true for some reason, do a fast finish. diff --git a/.gitattributes b/.gitattributes index 9060b27..7f32763 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9,6 +9,7 @@ bld.bat text eol=crlf # github helper pieces to make some files not show up in diffs automatically .azure-pipelines/* linguist-generated=true .circleci/* linguist-generated=true +.ci_support/README linguist-generated=true .drone/* linguist-generated=true .drone.yml linguist-generated=true .github/* linguist-generated=true @@ -18,6 +19,7 @@ bld.bat text eol=crlf .gitignore linguist-generated=true .travis.yml linguist-generated=true .scripts/* linguist-generated=true +.woodpecker.yml linguist-generated=true LICENSE.txt linguist-generated=true README.md linguist-generated=true azure-pipelines.yml linguist-generated=true diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh new file mode 100755 index 0000000..595f8b5 --- /dev/null +++ b/.scripts/build_steps.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +# -*- mode: jinja-shell -*- + +set -xeuo pipefail +export FEEDSTOCK_ROOT="${FEEDSTOCK_ROOT:-/home/conda/feedstock_root}" +source ${FEEDSTOCK_ROOT}/.scripts/logging_utils.sh + + +( endgroup "Start Docker" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +export PYTHONUNBUFFERED=1 +export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" +export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" +export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" + +cat >~/.condarc < /dev/null + +if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then + cp "${FEEDSTOCK_ROOT}/LICENSE.txt" "${RECIPE_ROOT}/recipe-scripts-license.txt" +fi + +if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then + if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" + fi + conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + + # Drop into an interactive shell + /bin/bash +else + conda mambabuild "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + ( startgroup "Validating outputs" ) 2> /dev/null + + validate_recipe_outputs "${FEEDSTOCK_NAME}" + + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" + fi + + ( endgroup "Uploading packages" ) 2> /dev/null +fi + +( startgroup "Final checks" ) 2> /dev/null + +touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh new file mode 100755 index 0000000..57bc95c --- /dev/null +++ b/.scripts/logging_utils.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# Provide a unified interface for the different logging +# utilities CI providers offer. If unavailable, provide +# a compatible fallback (e.g. bare `echo xxxxxx`). + +function startgroup { + # Start a foldable group of log lines + # Pass a single argument, quoted + case ${CI:-} in + azure ) + echo "##[group]$1";; + travis ) + echo "$1" + echo -en 'travis_fold:start:'"${1// /}"'\\r';; + github_actions ) + echo "::group::$1";; + * ) + echo "$1";; + esac +} 2> /dev/null + +function endgroup { + # End a foldable group of log lines + # Pass a single argument, quoted + + case ${CI:-} in + azure ) + echo "##[endgroup]";; + travis ) + echo -en 'travis_fold:end:'"${1// /}"'\\r';; + github_actions ) + echo "::endgroup::";; + esac +} 2> /dev/null diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh new file mode 100755 index 0000000..9236239 --- /dev/null +++ b/.scripts/run_docker_build.sh @@ -0,0 +1,105 @@ +#!/usr/bin/env bash + +# PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +# will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +# changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +# benefit from the improvement. + +source .scripts/logging_utils.sh + +( startgroup "Configure Docker" ) 2> /dev/null + +set -xeo pipefail + +THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" +PROVIDER_DIR="$(basename $THISDIR)" + +FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" +RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" + +if [ -z ${FEEDSTOCK_NAME} ]; then + export FEEDSTOCK_NAME=$(basename ${FEEDSTOCK_ROOT}) +fi + +docker info + +# In order for the conda-build process in the container to write to the mounted +# volumes, we need to run with the same id as the host machine, which is +# normally the owner of the mounted volumes, or at least has write permission +export HOST_USER_ID=$(id -u) +# Check if docker-machine is being used (normally on OSX) and get the uid from +# the VM +if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then + export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) +fi + +ARTIFACTS="$FEEDSTOCK_ROOT/build_artifacts" + +if [ -z "$CONFIG" ]; then + set +x + FILES=`ls .ci_support/linux_*` + CONFIGS="" + for file in $FILES; do + CONFIGS="${CONFIGS}'${file:12:-5}' or "; + done + echo "Need to set CONFIG env variable. Value can be one of ${CONFIGS:0:-4}" + exit 1 +fi + +if [ -z "${DOCKER_IMAGE}" ]; then + SHYAML_INSTALLED="$(shyaml -h || echo NO)" + if [ "${SHYAML_INSTALLED}" == "NO" ]; then + echo "WARNING: DOCKER_IMAGE variable not set and shyaml not installed. Trying to parse with coreutils" + DOCKER_IMAGE=$(cat .ci_support/${CONFIG}.yaml | grep '^docker_image:$' -A 1 | tail -n 1 | cut -b 3-) + if [ "${DOCKER_IMAGE}" = "" ]; then + echo "No docker_image entry found in ${CONFIG}. Falling back to quay.io/condaforge/linux-anvil-comp7" + DOCKER_IMAGE="quay.io/condaforge/linux-anvil-comp7" + fi + else + DOCKER_IMAGE="$(cat "${FEEDSTOCK_ROOT}/.ci_support/${CONFIG}.yaml" | shyaml get-value docker_image.0 quay.io/condaforge/linux-anvil-comp7 )" + fi +fi + +mkdir -p "$ARTIFACTS" +DONE_CANARY="$ARTIFACTS/conda-forge-build-done-${CONFIG}" +rm -f "$DONE_CANARY" + +# Allow people to specify extra default arguments to `docker run` (e.g. `--rm`) +DOCKER_RUN_ARGS="${CONDA_FORGE_DOCKER_RUN_ARGS}" +if [ -z "${CI}" ]; then + DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" +fi + +( endgroup "Configure Docker" ) 2> /dev/null + +( startgroup "Start Docker" ) 2> /dev/null + +export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" +export IS_PR_BUILD="${IS_PR_BUILD:-False}" +docker pull "${DOCKER_IMAGE}" +docker run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ + -e CONFIG \ + -e HOST_USER_ID \ + -e UPLOAD_PACKAGES \ + -e IS_PR_BUILD \ + -e GIT_BRANCH \ + -e UPLOAD_ON_BRANCH \ + -e CI \ + -e FEEDSTOCK_NAME \ + -e CPU_COUNT \ + -e BUILD_WITH_CONDA_DEBUG \ + -e BUILD_OUTPUT_ID \ + -e BINSTAR_TOKEN \ + -e FEEDSTOCK_TOKEN \ + -e STAGING_BINSTAR_TOKEN \ + "${DOCKER_IMAGE}" \ + bash \ + "/home/conda/feedstock_root/${PROVIDER_DIR}/build_steps.sh" + +# verify that the end of the script was reached +test -f "$DONE_CANARY" + +# This closes the last group opened in `build_steps.sh` +( endgroup "Final checks" ) 2> /dev/null \ No newline at end of file diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh new file mode 100755 index 0000000..5ef2a19 --- /dev/null +++ b/.scripts/run_osx_build.sh @@ -0,0 +1,90 @@ +#!/usr/bin/env bash + +# -*- mode: jinja-shell -*- + +source .scripts/logging_utils.sh + +set -xe + +MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} + +( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" +MINIFORGE_FILE="Mambaforge-MacOSX-$(uname -m).sh" +curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" +rm -rf ${MINIFORGE_HOME} +bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} + +( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null + +( startgroup "Configuring conda" ) 2> /dev/null + +source ${MINIFORGE_HOME}/etc/profile.d/conda.sh +conda activate base + +mamba install --update-specs --quiet --yes --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 +mamba update --update-specs --yes --quiet --channel conda-forge \ + conda-build pip boa conda-forge-ci-setup=3 + + + +echo -e "\n\nSetting up the condarc and mangling the compiler." +setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml + +if [[ "${CI:-}" != "" ]]; then + mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml +fi + +if [[ "${CI:-}" != "" ]]; then + echo -e "\n\nMangling homebrew in the CI to avoid conflicts." + /usr/bin/sudo mangle_homebrew + /usr/bin/sudo -k +else + echo -e "\n\nNot mangling homebrew as we are not running in CI" +fi + +echo -e "\n\nRunning the build setup script." +source run_conda_forge_build_setup + + + +( endgroup "Configuring conda" ) 2> /dev/null + +echo -e "\n\nMaking the build clobber file" +make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml + +if [[ -f LICENSE.txt ]]; then + cp LICENSE.txt "recipe/recipe-scripts-license.txt" +fi + +if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then + if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then + EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" + fi + conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ + ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + + # Drop into an interactive shell + /bin/bash +else + + conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ + --suppress-variables ${EXTRA_CB_OPTIONS:-} \ + --clobber-file ./.ci_support/clobber_${CONFIG}.yaml + ( startgroup "Validating outputs" ) 2> /dev/null + + validate_recipe_outputs "${FEEDSTOCK_NAME}" + + ( endgroup "Validating outputs" ) 2> /dev/null + + ( startgroup "Uploading packages" ) 2> /dev/null + + if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then + upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml + fi + + ( endgroup "Uploading packages" ) 2> /dev/null +fi \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index 5f30279..2ec51d7 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,13 +1,27 @@ -BSD 3-clause license -Copyright (c) 2015-2020, conda-forge contributors +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors All rights reserved. -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/README.md b/README.md index dd71227..b9d0d32 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,16 @@ -About flang -=========== +About flang-feedstock +===================== -Home: http://github.com/flang-compiler/flang +Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/flang-feedstock/blob/main/LICENSE.txt) -Package license: Apache 2.0 +Home: https://flang.llvm.org -Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/flang-feedstock/blob/master/LICENSE.txt) +Package license: Apache-2.0 Summary: Flang is a Fortran compiler targeting LLVM. +Development: https://github.com/llvm/llvm-project + Current build status ==================== @@ -20,17 +22,31 @@ Current build status
- - + + + + + + + + @@ -48,7 +64,13 @@ Current release info | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-flang-green.svg)](https://anaconda.org/conda-forge/flang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang.svg)](https://anaconda.org/conda-forge/flang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang.svg)](https://anaconda.org/conda-forge/flang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang.svg)](https://anaconda.org/conda-forge/flang) | | [![Conda Recipe](https://img.shields.io/badge/recipe-flang_linux--64-green.svg)](https://anaconda.org/conda-forge/flang_linux-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_linux-64.svg)](https://anaconda.org/conda-forge/flang_linux-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_linux-64.svg)](https://anaconda.org/conda-forge/flang_linux-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_linux-64.svg)](https://anaconda.org/conda-forge/flang_linux-64) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-flang_osx--64-green.svg)](https://anaconda.org/conda-forge/flang_osx-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_osx-64.svg)](https://anaconda.org/conda-forge/flang_osx-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_osx-64.svg)](https://anaconda.org/conda-forge/flang_osx-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_osx-64.svg)](https://anaconda.org/conda-forge/flang_osx-64) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-flang_win--64-green.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libflang-green.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main-green.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_linux--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_osx--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_osx-64.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_osx-64.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_osx-64.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | +| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_win--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | Installing flang ================ @@ -57,25 +79,52 @@ Installing `flang` from the `conda-forge` channel can be achieved by adding `con ``` conda config --add channels conda-forge +conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `flang, flang_linux-64, libflang` can be installed with: +Once the `conda-forge` channel has been enabled, `flang, flang_linux-64, flang_osx-64, flang_win-64, libflang, libfortran-main, libfortran-main_linux-64, libfortran-main_osx-64, libfortran-main_win-64` can be installed with `conda`: ``` -conda install flang flang_linux-64 libflang +conda install flang flang_linux-64 flang_osx-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_osx-64 libfortran-main_win-64 ``` -It is possible to list all of the versions of `flang` available on your platform with: +or with `mamba`: + +``` +mamba install flang flang_linux-64 flang_osx-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_osx-64 libfortran-main_win-64 +``` + +It is possible to list all of the versions of `flang` available on your platform with `conda`: ``` conda search flang --channel conda-forge ``` +or with `mamba`: + +``` +mamba search flang --channel conda-forge +``` + +Alternatively, `mamba repoquery` may provide more information: + +``` +# Search all versions available on your platform: +mamba repoquery search flang --channel conda-forge + +# List packages depending on `flang`: +mamba repoquery whoneeds flang --channel conda-forge + +# List dependencies of `flang`: +mamba repoquery depends flang --channel conda-forge +``` + About conda-forge ================= -[![Powered by NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](http://numfocus.org) +[![Powered by +NumFOCUS](https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A)](https://numfocus.org) conda-forge is a community-led conda channel of installable packages. In order to provide high-quality builds, the process has been automated into the @@ -85,10 +134,12 @@ for each of the installable packages. Such a repository is known as a *feedstock A feedstock is made up of a conda recipe (the instructions on what and how to build the package) and the necessary configurations for automatic building using freely available continuous integration services. Thanks to the awesome service provided by -[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/) -and [TravisCI](https://travis-ci.com/) it is possible to build and upload installable -packages to the [conda-forge](https://anaconda.org/conda-forge) -[Anaconda-Cloud](https://anaconda.org/) channel for Linux, Windows and OSX respectively. +[Azure](https://azure.microsoft.com/en-us/services/devops/), [GitHub](https://github.com/), +[CircleCI](https://circleci.com/), [AppVeyor](https://www.appveyor.com/), +[Drone](https://cloud.drone.io/welcome), and [TravisCI](https://travis-ci.com/) +it is possible to build and upload installable packages to the +[conda-forge](https://anaconda.org/conda-forge) [Anaconda-Cloud](https://anaconda.org/) +channel for Linux, Windows and OSX respectively. To manage the continuous integration and simplify feedstock maintenance [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. @@ -127,9 +178,9 @@ build distinct package versions. In order to produce a uniquely identifiable distribution: * If the version of a package **is not** being increased, please add or increase - the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string). + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string). * If the version of a package **is** being increased, please remember to return - the [``build/number``](https://conda.io/docs/user-guide/tasks/build-packages/define-metadata.html#build-number-and-string) + the [``build/number``](https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#build-number-and-string) back to 0. Feedstock Maintainers diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 93cf692..6b346f5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,4 +3,6 @@ # -*- mode: yaml -*- jobs: - - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-linux.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml + - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index 3453cfe..3f4b7a7 100755 --- a/build-locally.py +++ b/build-locally.py @@ -7,15 +7,21 @@ import glob import subprocess from argparse import ArgumentParser +import platform def setup_environment(ns): os.environ["CONFIG"] = ns.config os.environ["UPLOAD_PACKAGES"] = "False" + os.environ["IS_PR_BUILD"] = "True" if ns.debug: os.environ["BUILD_WITH_CONDA_DEBUG"] = "1" if ns.output_id: os.environ["BUILD_OUTPUT_ID"] = ns.output_id + if "MINIFORGE_HOME" not in os.environ: + os.environ["MINIFORGE_HOME"] = os.path.join( + os.path.dirname(__file__), "miniforge3" + ) def run_docker_build(ns): @@ -23,6 +29,11 @@ def run_docker_build(ns): subprocess.check_call([script]) +def run_osx_build(ns): + script = ".scripts/run_osx_build.sh" + subprocess.check_call([script]) + + def verify_config(ns): valid_configs = { os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") @@ -46,10 +57,17 @@ def verify_config(ns): else: raise ValueError("config " + ns.config + " is not valid") # Remove the following, as implemented - if not ns.config.startswith("linux"): + if ns.config.startswith("win"): raise ValueError( - f"only Linux configs currently supported, got {ns.config}" + f"only Linux/macOS configs currently supported, got {ns.config}" ) + elif ns.config.startswith("osx"): + if "OSX_SDK_DIR" not in os.environ: + raise RuntimeError( + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=SDKs' " + "to download the SDK automatically to 'SDKs/MacOSX.sdk'. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." + ) def main(args=None): @@ -68,7 +86,19 @@ def main(args=None): verify_config(ns) setup_environment(ns) - run_docker_build(ns) + try: + if ns.config.startswith("linux") or ( + ns.config.startswith("osx") and platform.system() == "Linux" + ): + run_docker_build(ns) + elif ns.config.startswith("osx"): + run_osx_build(ns) + finally: + recipe_license_file = os.path.join( + "recipe", "recipe-scripts-license.txt" + ) + if os.path.exists(recipe_license_file): + os.remove(recipe_license_file) if __name__ == "__main__": From b8dce5b94c118b7f79b73c7bdbaeb6936f774385 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 27 Jul 2023 20:45:49 +1100 Subject: [PATCH 19/32] build from upstream main (in anticipation of 17.0.0-rc1) --- recipe/meta.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b27ea45..3b1fe3f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,12 +1,14 @@ -{% set version = "16.0.5" %} +{% set version = "17.0.0.dev0" %} package: name: flang-split version: {{ version }} source: - url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863 + git_url: https://github.com/llvm/llvm-project.git + git_rev: a4f4d82c35b80b681687b545200456e79a82d9c2 + # url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz + # sha256: 37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863 patches: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 From 5e3eb684ccde47ab4776d91229213e5c97712203 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 27 Jul 2023 20:51:01 +1100 Subject: [PATCH 20/32] rebase patches --- recipe/meta.yaml | 4 +- ...ompiler-rt-builtins-on-windows-apple.patch | 8 ++-- ...typo-in-AVOID_NATIVE_UINT128_T-macro.patch | 23 --------- ...me-build-with-AVOID_NATIVE_INT128_T.patch} | 48 +++++++++---------- 4 files changed, 29 insertions(+), 54 deletions(-) delete mode 100644 recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch rename recipe/patches/{0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch => 0002-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch} (84%) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3b1fe3f..3d2681e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -13,10 +13,8 @@ source: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 - patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch - # backport https://github.com/llvm/llvm-project/commit/21bff9ca42e4735a52aa1e981b1ccd0d3b274b34 - - patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch # backport https://reviews.llvm.org/D154660 - - patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch + - patches/0002-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch build: number: 0 diff --git a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch index a8397ac..3af60b0 100644 --- a/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch +++ b/recipe/patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch @@ -1,7 +1,7 @@ -From bd2a2c0e635395c9f7a16c1d032bfa6dff92ab3d Mon Sep 17 00:00:00 2001 +From 1d75402d4382084b27b32e38c1591da253200507 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 17 Apr 2023 23:38:48 +1100 -Subject: [PATCH 1/3] always link in compiler-rt builtins on windows & apple +Subject: [PATCH 1/2] always link in compiler-rt builtins on windows & apple rather than patching HandleCompilerRT.cmake, we just use the fact that we know where the library is located @@ -10,10 +10,10 @@ use the fact that we know where the library is located 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt -index b048ea220e2..80ed2b0223b 100644 +index ac30da89995..dd68d5b417c 100644 --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt -@@ -46,9 +46,22 @@ endif() +@@ -47,9 +47,22 @@ endif() include(GNUInstallDirs) # MSVC + clang-cl build requires clang_rt.builtin.${target} library diff --git a/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch b/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch deleted file mode 100644 index f6a614f..0000000 --- a/recipe/patches/0002-NFC-flang-Fixed-typo-in-AVOID_NATIVE_UINT128_T-macro.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 022f9fde8fe312e26018a224a8f494f4646477b4 Mon Sep 17 00:00:00 2001 -From: Slava Zakharin -Date: Mon, 24 Apr 2023 13:16:55 -0700 -Subject: [PATCH 2/3] [NFC][flang] Fixed typo in AVOID_NATIVE_UINT128_T macro. - Differential Revision: https://reviews.llvm.org/D149097 - ---- - flang/include/flang/Common/uint128.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/flang/include/flang/Common/uint128.h b/flang/include/flang/Common/uint128.h -index b12e1729341..bfd2eef01f6 100644 ---- a/flang/include/flang/Common/uint128.h -+++ b/flang/include/flang/Common/uint128.h -@@ -261,7 +261,7 @@ private: - using UnsignedInt128 = Int128; - using SignedInt128 = Int128; - --#if !AVOID_NATIVE_UINT128_t && (defined __GNUC__ || defined __clang__) && \ -+#if !AVOID_NATIVE_UINT128_T && (defined __GNUC__ || defined __clang__) && \ - defined __SIZEOF_INT128__ - using uint128_t = __uint128_t; - using int128_t = __int128_t; diff --git a/recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch b/recipe/patches/0002-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch similarity index 84% rename from recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch rename to recipe/patches/0002-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch index dc3f20d..d808901 100644 --- a/recipe/patches/0003-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch +++ b/recipe/patches/0002-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch @@ -1,7 +1,7 @@ -From 4469984bd243a664641b3fc617b63d6627c18016 Mon Sep 17 00:00:00 2001 +From 060ffd3f6425a1cfbc93a2a8b9c8f320f3d3d2d0 Mon Sep 17 00:00:00 2001 From: Peter Klausler Date: Thu, 6 Jul 2023 15:07:00 -0700 -Subject: [PATCH 3/3] [flang] Allow runtime build with AVOID_NATIVE_INT128_T=1 +Subject: [PATCH 2/2] [flang] Allow runtime build with AVOID_NATIVE_INT128_T=1 --- flang/runtime/command.cpp | 10 +++++++--- @@ -11,7 +11,7 @@ Subject: [PATCH 3/3] [flang] Allow runtime build with AVOID_NATIVE_INT128_T=1 4 files changed, 39 insertions(+), 18 deletions(-) diff --git a/flang/runtime/command.cpp b/flang/runtime/command.cpp -index 6ee012f8525..dfe0ac9f15a 100644 +index 6c4f611daaa..b81a0791c5e 100644 --- a/flang/runtime/command.cpp +++ b/flang/runtime/command.cpp @@ -107,9 +107,13 @@ static void StoreLengthToDescriptor( @@ -32,10 +32,10 @@ index 6ee012f8525..dfe0ac9f15a 100644 }; diff --git a/flang/runtime/io-api.cpp b/flang/runtime/io-api.cpp -index 197cfcc2f7f..289cb805279 100644 +index fe58bbc75f8..bf05c79ae8f 100644 --- a/flang/runtime/io-api.cpp +++ b/flang/runtime/io-api.cpp -@@ -1427,7 +1427,9 @@ static enum Iostat CheckUnitNumberInRangeImpl(INT unit, bool handleError, +@@ -1483,7 +1483,9 @@ static enum Iostat CheckUnitNumberInRangeImpl(INT unit, bool handleError, // Only provide the bad unit number in the message if SignalError can print // it accurately. Otherwise, the generic IostatUnitOverflow message will be // used. @@ -47,10 +47,10 @@ index 197cfcc2f7f..289cb805279 100644 "UNIT number %jd is out of range", static_cast(unit)); } else { diff --git a/flang/runtime/numeric.cpp b/flang/runtime/numeric.cpp -index 7afa5802db0..e740d39e16e 100644 +index 5376bcb569f..21ee91a8681 100644 --- a/flang/runtime/numeric.cpp +++ b/flang/runtime/numeric.cpp -@@ -305,7 +305,7 @@ CppTypeFor RTNAME(Ceiling4_8)( +@@ -306,7 +306,7 @@ CppTypeFor RTNAME(Ceiling4_8)( CppTypeFor x) { return Ceiling>(x); } @@ -59,7 +59,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Ceiling4_16)( CppTypeFor x) { return Ceiling>(x); -@@ -327,7 +327,7 @@ CppTypeFor RTNAME(Ceiling8_8)( +@@ -328,7 +328,7 @@ CppTypeFor RTNAME(Ceiling8_8)( CppTypeFor x) { return Ceiling>(x); } @@ -68,7 +68,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Ceiling8_16)( CppTypeFor x) { return Ceiling>(x); -@@ -350,7 +350,7 @@ CppTypeFor RTNAME(Ceiling10_8)( +@@ -351,7 +351,7 @@ CppTypeFor RTNAME(Ceiling10_8)( CppTypeFor x) { return Ceiling>(x); } @@ -77,7 +77,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Ceiling10_16)( CppTypeFor x) { return Ceiling>(x); -@@ -373,7 +373,7 @@ CppTypeFor RTNAME(Ceiling16_8)( +@@ -374,7 +374,7 @@ CppTypeFor RTNAME(Ceiling16_8)( CppTypeFor x) { return Ceiling>(x); } @@ -86,7 +86,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Ceiling16_16)( CppTypeFor x) { return Ceiling>(x); -@@ -433,7 +433,7 @@ CppTypeFor RTNAME(Floor4_8)( +@@ -434,7 +434,7 @@ CppTypeFor RTNAME(Floor4_8)( CppTypeFor x) { return Floor>(x); } @@ -95,7 +95,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Floor4_16)( CppTypeFor x) { return Floor>(x); -@@ -455,7 +455,7 @@ CppTypeFor RTNAME(Floor8_8)( +@@ -456,7 +456,7 @@ CppTypeFor RTNAME(Floor8_8)( CppTypeFor x) { return Floor>(x); } @@ -104,7 +104,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Floor8_16)( CppTypeFor x) { return Floor>(x); -@@ -478,7 +478,7 @@ CppTypeFor RTNAME(Floor10_8)( +@@ -479,7 +479,7 @@ CppTypeFor RTNAME(Floor10_8)( CppTypeFor x) { return Floor>(x); } @@ -113,7 +113,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Floor10_16)( CppTypeFor x) { return Floor>(x); -@@ -501,7 +501,7 @@ CppTypeFor RTNAME(Floor16_8)( +@@ -502,7 +502,7 @@ CppTypeFor RTNAME(Floor16_8)( CppTypeFor x) { return Floor>(x); } @@ -122,7 +122,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Floor16_16)( CppTypeFor x) { return Floor>(x); -@@ -709,7 +709,7 @@ CppTypeFor RTNAME(Nint4_8)( +@@ -710,7 +710,7 @@ CppTypeFor RTNAME(Nint4_8)( CppTypeFor x) { return Nint>(x); } @@ -131,7 +131,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Nint4_16)( CppTypeFor x) { return Nint>(x); -@@ -731,7 +731,7 @@ CppTypeFor RTNAME(Nint8_8)( +@@ -732,7 +732,7 @@ CppTypeFor RTNAME(Nint8_8)( CppTypeFor x) { return Nint>(x); } @@ -140,7 +140,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Nint8_16)( CppTypeFor x) { return Nint>(x); -@@ -754,7 +754,7 @@ CppTypeFor RTNAME(Nint10_8)( +@@ -755,7 +755,7 @@ CppTypeFor RTNAME(Nint10_8)( CppTypeFor x) { return Nint>(x); } @@ -149,7 +149,7 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor RTNAME(Nint10_16)( CppTypeFor x) { return Nint>(x); -@@ -777,7 +777,7 @@ CppTypeFor RTNAME(Nint16_8)( +@@ -778,7 +778,7 @@ CppTypeFor RTNAME(Nint16_8)( CppTypeFor x) { return Nint>(x); } @@ -159,10 +159,10 @@ index 7afa5802db0..e740d39e16e 100644 CppTypeFor x) { return Nint>(x); diff --git a/flang/runtime/tools.h b/flang/runtime/tools.h -index a9c942d53ee..fb3b56e4cb0 100644 +index d22093a2ada..72d14982ce4 100644 --- a/flang/runtime/tools.h +++ b/flang/runtime/tools.h -@@ -128,7 +128,7 @@ inline RESULT ApplyType( +@@ -131,7 +131,7 @@ inline RT_API_ATTRS RESULT ApplyType( return FUNC{}(std::forward(x)...); case 8: return FUNC{}(std::forward(x)...); @@ -171,7 +171,7 @@ index a9c942d53ee..fb3b56e4cb0 100644 case 16: return FUNC{}(std::forward(x)...); #endif -@@ -226,7 +226,7 @@ inline RESULT ApplyIntegerKind(int kind, Terminator &terminator, A &&...x) { +@@ -230,7 +230,7 @@ inline RT_API_ATTRS RESULT ApplyIntegerKind( return FUNC<4>{}(std::forward(x)...); case 8: return FUNC<8>{}(std::forward(x)...); @@ -180,7 +180,7 @@ index a9c942d53ee..fb3b56e4cb0 100644 case 16: return FUNC<16>{}(std::forward(x)...); #endif -@@ -304,6 +304,11 @@ std::optional> inline constexpr GetResultType( +@@ -310,6 +310,11 @@ std::optional> inline constexpr GetResultType( return std::make_pair(TypeCategory::Integer, maxKind); case TypeCategory::Real: case TypeCategory::Complex: @@ -192,7 +192,7 @@ index a9c942d53ee..fb3b56e4cb0 100644 return std::make_pair(yCat, yKind); default: break; -@@ -312,6 +317,11 @@ std::optional> inline constexpr GetResultType( +@@ -318,6 +323,11 @@ std::optional> inline constexpr GetResultType( case TypeCategory::Real: switch (yCat) { case TypeCategory::Integer: @@ -204,7 +204,7 @@ index a9c942d53ee..fb3b56e4cb0 100644 return std::make_pair(TypeCategory::Real, xKind); case TypeCategory::Real: case TypeCategory::Complex: -@@ -323,6 +333,11 @@ std::optional> inline constexpr GetResultType( +@@ -329,6 +339,11 @@ std::optional> inline constexpr GetResultType( case TypeCategory::Complex: switch (yCat) { case TypeCategory::Integer: From 25f58cbf88ab2b0b251f90f80ad0e0c0dba1ce28 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Jul 2023 07:50:43 +1100 Subject: [PATCH 21/32] skip osx --- recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 3d2681e..82e29f1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,6 +18,8 @@ source: build: number: 0 + # intentionally only windows (main target) & linux (debuggability) + skip: true # [osx] track_features: - flang From 4c3e4f09f53c40301f85061f9eef06e1ac554071 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Jul 2023 07:50:59 +1100 Subject: [PATCH 22/32] remove obsolete experimental flag --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 82e29f1..469bbe8 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -130,7 +130,7 @@ outputs: commands: # see naming discussion: https://discourse.llvm.org/t/reviving-rename-flang-new-to-flang/68130/2 # - flang hello_world.f90 - - flang-new -flang-experimental-exec hello_world.f90 + - flang-new hello_world.f90 - ./a.out # [unix] - a.exe # [win] From 48777a2f09da296eff0135085a3a6917739958be Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Jul 2023 07:57:20 +1100 Subject: [PATCH 23/32] set pagefile on windows to avoid running out of space --- conda-forge.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conda-forge.yml b/conda-forge.yml index 2f501ce..522a138 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,3 +1,7 @@ +azure: + settings_win: + variables: + SET_PAGEFILE: "True" conda_forge_output_validation: true github: branch_name: main From 6272906ad0effa5b289480d376ad6c41e1f8f3f7 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Jul 2023 09:47:54 +1100 Subject: [PATCH 24/32] MNT: Re-rendered with conda-build 3.26.0, conda-smithy 3.24.1, and conda-forge-pinning 2023.07.27.11.28.36 --- .azure-pipelines/azure-pipelines-osx.yml | 33 --------- .azure-pipelines/azure-pipelines-win.yml | 1 + .ci_support/osx_64_.yaml | 23 ------ .scripts/run_osx_build.sh | 90 ------------------------ README.md | 15 +--- azure-pipelines.yml | 3 +- 6 files changed, 5 insertions(+), 160 deletions(-) delete mode 100644 .azure-pipelines/azure-pipelines-osx.yml delete mode 100644 .ci_support/osx_64_.yaml delete mode 100755 .scripts/run_osx_build.sh diff --git a/.azure-pipelines/azure-pipelines-osx.yml b/.azure-pipelines/azure-pipelines-osx.yml deleted file mode 100644 index 9e4e167..0000000 --- a/.azure-pipelines/azure-pipelines-osx.yml +++ /dev/null @@ -1,33 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: osx - pool: - vmImage: macOS-11 - strategy: - matrix: - osx_64_: - CONFIG: osx_64_ - UPLOAD_PACKAGES: 'True' - timeoutInMinutes: 360 - - steps: - # TODO: Fast finish on azure pipelines? - - script: | - export CI=azure - export OSX_FORCE_SDK_DOWNLOAD="1" - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - ./.scripts/run_osx_build.sh - displayName: Run OSX build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml index 75da5df..4819fc2 100755 --- a/.azure-pipelines/azure-pipelines-win.yml +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -14,6 +14,7 @@ jobs: timeoutInMinutes: 360 variables: CONDA_BLD_PATH: D:\\bld\\ + SET_PAGEFILE: 'True' UPLOAD_TEMP: D:\\tmp steps: diff --git a/.ci_support/osx_64_.yaml b/.ci_support/osx_64_.yaml deleted file mode 100644 index 9760adb..0000000 --- a/.ci_support/osx_64_.yaml +++ /dev/null @@ -1,23 +0,0 @@ -MACOSX_DEPLOYMENT_TARGET: -- '10.9' -c_compiler: -- clang -c_compiler_version: -- '17' -channel_sources: -- conda-forge/label/llvm_rc,conda-forge -channel_targets: -- conda-forge llvm_rc -cxx_compiler: -- clangxx -cxx_compiler_version: -- '17' -macos_machine: -- x86_64-apple-darwin13.4.0 -target_platform: -- osx-64 -zip_keys: -- - c_compiler_version - - cxx_compiler_version -zlib: -- '1.2' diff --git a/.scripts/run_osx_build.sh b/.scripts/run_osx_build.sh deleted file mode 100755 index 5ef2a19..0000000 --- a/.scripts/run_osx_build.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env bash - -# -*- mode: jinja-shell -*- - -source .scripts/logging_utils.sh - -set -xe - -MINIFORGE_HOME=${MINIFORGE_HOME:-${HOME}/miniforge3} - -( startgroup "Installing a fresh version of Miniforge" ) 2> /dev/null - -MINIFORGE_URL="https://github.com/conda-forge/miniforge/releases/latest/download" -MINIFORGE_FILE="Mambaforge-MacOSX-$(uname -m).sh" -curl -L -O "${MINIFORGE_URL}/${MINIFORGE_FILE}" -rm -rf ${MINIFORGE_HOME} -bash $MINIFORGE_FILE -b -p ${MINIFORGE_HOME} - -( endgroup "Installing a fresh version of Miniforge" ) 2> /dev/null - -( startgroup "Configuring conda" ) 2> /dev/null - -source ${MINIFORGE_HOME}/etc/profile.d/conda.sh -conda activate base - -mamba install --update-specs --quiet --yes --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 -mamba update --update-specs --yes --quiet --channel conda-forge \ - conda-build pip boa conda-forge-ci-setup=3 - - - -echo -e "\n\nSetting up the condarc and mangling the compiler." -setup_conda_rc ./ ./recipe ./.ci_support/${CONFIG}.yaml - -if [[ "${CI:-}" != "" ]]; then - mangle_compiler ./ ./recipe .ci_support/${CONFIG}.yaml -fi - -if [[ "${CI:-}" != "" ]]; then - echo -e "\n\nMangling homebrew in the CI to avoid conflicts." - /usr/bin/sudo mangle_homebrew - /usr/bin/sudo -k -else - echo -e "\n\nNot mangling homebrew as we are not running in CI" -fi - -echo -e "\n\nRunning the build setup script." -source run_conda_forge_build_setup - - - -( endgroup "Configuring conda" ) 2> /dev/null - -echo -e "\n\nMaking the build clobber file" -make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml - -if [[ -f LICENSE.txt ]]; then - cp LICENSE.txt "recipe/recipe-scripts-license.txt" -fi - -if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then - if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" - fi - conda debug ./recipe -m ./.ci_support/${CONFIG}.yaml \ - ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml - - # Drop into an interactive shell - /bin/bash -else - - conda mambabuild ./recipe -m ./.ci_support/${CONFIG}.yaml \ - --suppress-variables ${EXTRA_CB_OPTIONS:-} \ - --clobber-file ./.ci_support/clobber_${CONFIG}.yaml - ( startgroup "Validating outputs" ) 2> /dev/null - - validate_recipe_outputs "${FEEDSTOCK_NAME}" - - ( endgroup "Validating outputs" ) 2> /dev/null - - ( startgroup "Uploading packages" ) 2> /dev/null - - if [[ "${UPLOAD_PACKAGES}" != "False" ]] && [[ "${IS_PR_BUILD}" == "False" ]]; then - upload_package --validate --feedstock-name="${FEEDSTOCK_NAME}" ./ ./recipe ./.ci_support/${CONFIG}.yaml - fi - - ( endgroup "Uploading packages" ) 2> /dev/null -fi \ No newline at end of file diff --git a/README.md b/README.md index b9d0d32..7dabe7a 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,6 @@ Current build status variant - - -
VariantStatus
linux_64 + + variant + +
osx_64 + + variant + +
win_64 - - variant + + variant
osx_64 - - variant - -
win_64 @@ -64,12 +57,10 @@ Current release info | --- | --- | --- | --- | | [![Conda Recipe](https://img.shields.io/badge/recipe-flang-green.svg)](https://anaconda.org/conda-forge/flang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang.svg)](https://anaconda.org/conda-forge/flang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang.svg)](https://anaconda.org/conda-forge/flang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang.svg)](https://anaconda.org/conda-forge/flang) | | [![Conda Recipe](https://img.shields.io/badge/recipe-flang_linux--64-green.svg)](https://anaconda.org/conda-forge/flang_linux-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_linux-64.svg)](https://anaconda.org/conda-forge/flang_linux-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_linux-64.svg)](https://anaconda.org/conda-forge/flang_linux-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_linux-64.svg)](https://anaconda.org/conda-forge/flang_linux-64) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-flang_osx--64-green.svg)](https://anaconda.org/conda-forge/flang_osx-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_osx-64.svg)](https://anaconda.org/conda-forge/flang_osx-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_osx-64.svg)](https://anaconda.org/conda-forge/flang_osx-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_osx-64.svg)](https://anaconda.org/conda-forge/flang_osx-64) | | [![Conda Recipe](https://img.shields.io/badge/recipe-flang_win--64-green.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libflang-green.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main-green.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_linux--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_osx--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_osx-64.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_osx-64.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_osx-64.svg)](https://anaconda.org/conda-forge/libfortran-main_osx-64) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_win--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | Installing flang @@ -82,16 +73,16 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `flang, flang_linux-64, flang_osx-64, flang_win-64, libflang, libfortran-main, libfortran-main_linux-64, libfortran-main_osx-64, libfortran-main_win-64` can be installed with `conda`: +Once the `conda-forge` channel has been enabled, `flang, flang_linux-64, flang_win-64, libflang, libfortran-main, libfortran-main_linux-64, libfortran-main_win-64` can be installed with `conda`: ``` -conda install flang flang_linux-64 flang_osx-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_osx-64 libfortran-main_win-64 +conda install flang flang_linux-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_win-64 ``` or with `mamba`: ``` -mamba install flang flang_linux-64 flang_osx-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_osx-64 libfortran-main_win-64 +mamba install flang flang_linux-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_win-64 ``` It is possible to list all of the versions of `flang` available on your platform with `conda`: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6b346f5..baa1c2b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,5 +4,4 @@ jobs: - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-win.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file From 2be106c1fa7d5b17995ef9ad78d1f7d3fcc97879 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Jul 2023 13:10:02 +1100 Subject: [PATCH 25/32] remove remnants of osx --- recipe/build.sh | 6 +----- recipe/conda_build_config.yaml | 5 ----- recipe/meta.yaml | 2 -- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index 92baebb..05de59c 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -8,13 +8,9 @@ if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then CMAKE_ARGS="$CMAKE_ARGS -DLLVM_CONFIG_PATH=$BUILD_PREFIX/bin/llvm-config -DMLIR_TABLEGEN_EXE=$BUILD_PREFIX/bin/mlir-tblgen" fi -if [[ "${target_platform}" == linux-* ]]; then - # unclear segfaults with shared builds on osx - CMAKE_ARGS="$CMAKE_ARGS -DBUILD_SHARED_LIBS=ON" -fi - cmake -G Ninja \ ${CMAKE_ARGS} \ + -DBUILD_SHARED_LIBS=ON \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_STANDARD=17 \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index 237bba4..b2aedab 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -1,8 +1,3 @@ -c_compiler_version: # [osx] - - 17 # [osx] -cxx_compiler_version: # [osx] - - 17 # [osx] - channel_targets: - conda-forge llvm_rc diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 469bbe8..8bb4985 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -66,8 +66,6 @@ outputs: commands: # shared lib on linux - test -f $PREFIX/lib/libFortranRuntime.so # [linux] - # static lib on osx (segfaults with shared ones) - - test -f $PREFIX/lib/libFortranRuntime.a # [osx] # static lib on win (fails to export symbols for shared build) - if not exist %LIBRARY_LIB%\FortranRuntime.lib exit 1 # [win] From f685a8677b29332a77caa5dffae108ad4d8bd07a Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Fri, 28 Jul 2023 13:27:08 +1100 Subject: [PATCH 26/32] remove `libfortran-main_{{ target_platform }}` we don't need cross-compilation capabilities for now, linux & osx have gfortran anyway, and win-arm64 is not ready yet. --- recipe/meta.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8bb4985..d98283a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -139,10 +139,6 @@ outputs: requirements: - {{ pin_subpackage('flang', exact=True) }} - - name: libfortran-main_{{ target_platform }} - requirements: - - {{ pin_subpackage('libfortran-main', exact=True) }} - about: home: https://flang.llvm.org From 4f6cc06bfd266cec8fdaf868fc2395fcf651fdd2 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 31 Jul 2023 10:09:26 +1100 Subject: [PATCH 27/32] flang 17.0.0.rc1 --- recipe/meta.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d98283a..cb13492 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,14 +1,12 @@ -{% set version = "17.0.0.dev0" %} +{% set version = "17.0.0.rc1" %} package: name: flang-split version: {{ version }} source: - git_url: https://github.com/llvm/llvm-project.git - git_rev: a4f4d82c35b80b681687b545200456e79a82d9c2 - # url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - # sha256: 37f540124b9cfd4680666e649f557077f9937c9178489cea285a672e714b2863 + url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz + sha256: 01b80625c131b8281dcf76a4e6395d10f45835c60e27357c92abf5a98c9a0337 patches: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 From a913048e452c9c7346382ab8858be05da8027ff1 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Wed, 30 Aug 2023 00:50:26 -0500 Subject: [PATCH 28/32] Fix avoiding uint128_t --- recipe/bld.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 7d95479..e435aed 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -5,6 +5,8 @@ cd build set "PROCESSOR_ARCHITECTURE=AMD64" +set "CXXFLAGS=%CXXFLAGS% -DAVOID_NATIVE_UINT128_T=1" + cmake -G "Ninja" ^ -DCMAKE_C_COMPILER=clang-cl ^ -DCMAKE_CXX_COMPILER=clang-cl ^ @@ -14,7 +16,6 @@ cmake -G "Ninja" ^ -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^ -DCMAKE_MODULE_PATH=../cmake/Modules ^ -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX%;%LIBRARY_LIB%/clang/%PKG_VERSION% ^ - -DAVOID_NATIVE_UINT128_T=1 ^ -DLLVM_BUILD_MAIN_SRC_DIR=.. ^ -DLLVM_EXTERNAL_LIT=%LIBRARY_BIN%/lit ^ -DLLVM_LIT_ARGS=-v ^ From 9596d0bca83f0251416b90c2e8d077b1a2209405 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 31 Aug 2023 02:48:32 +1100 Subject: [PATCH 29/32] MNT: Re-rendered with conda-build 3.26.1, conda-smithy 3.24.1, and conda-forge-pinning 2023.08.30.15.15.05 --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7dabe7a..16ba6db 100644 --- a/README.md +++ b/README.md @@ -60,8 +60,6 @@ Current release info | [![Conda Recipe](https://img.shields.io/badge/recipe-flang_win--64-green.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/flang_win-64.svg)](https://anaconda.org/conda-forge/flang_win-64) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libflang-green.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libflang.svg)](https://anaconda.org/conda-forge/libflang) | | [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main-green.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main.svg)](https://anaconda.org/conda-forge/libfortran-main) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_linux--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_linux-64.svg)](https://anaconda.org/conda-forge/libfortran-main_linux-64) | -| [![Conda Recipe](https://img.shields.io/badge/recipe-libfortran--main_win--64-green.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Version](https://img.shields.io/conda/vn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | [![Conda Platforms](https://img.shields.io/conda/pn/conda-forge/libfortran-main_win-64.svg)](https://anaconda.org/conda-forge/libfortran-main_win-64) | Installing flang ================ @@ -73,16 +71,16 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `flang, flang_linux-64, flang_win-64, libflang, libfortran-main, libfortran-main_linux-64, libfortran-main_win-64` can be installed with `conda`: +Once the `conda-forge` channel has been enabled, `flang, flang_linux-64, flang_win-64, libflang, libfortran-main` can be installed with `conda`: ``` -conda install flang flang_linux-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_win-64 +conda install flang flang_linux-64 flang_win-64 libflang libfortran-main ``` or with `mamba`: ``` -mamba install flang flang_linux-64 flang_win-64 libflang libfortran-main libfortran-main_linux-64 libfortran-main_win-64 +mamba install flang flang_linux-64 flang_win-64 libflang libfortran-main ``` It is possible to list all of the versions of `flang` available on your platform with `conda`: From e5812d5b1a7f9ed6f3d67681fcb012c0e635410a Mon Sep 17 00:00:00 2001 From: h-vetinari Date: Thu, 31 Aug 2023 00:16:17 +0200 Subject: [PATCH 30/32] Restrict extra compilers for test env to windows Co-authored-by: Isuru Fernando --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index cb13492..2ad9252 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -119,8 +119,8 @@ outputs: - {{ pin_subpackage('libfortran-main', exact=True) }} test: requires: - - {{ compiler('c') }} - - {{ compiler('cxx') }} + - {{ compiler('c') }} # [win] + - {{ compiler('cxx') }} # [win] files: - hello_world.f90 commands: From 165a2a1eab01fa1e81e67337206fec2232a2d2d4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 31 Aug 2023 12:16:58 +1100 Subject: [PATCH 31/32] flang 17.0.0.rc3 --- recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 2ad9252..bd9b9fe 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,4 +1,4 @@ -{% set version = "17.0.0.rc1" %} +{% set version = "17.0.0.rc3" %} package: name: flang-split @@ -6,7 +6,7 @@ package: source: url: https://github.com/llvm/llvm-project/releases/download/llvmorg-{{ version.replace(".rc", "-rc") }}/llvm-project-{{ version.replace(".rc", "rc") }}.src.tar.xz - sha256: 01b80625c131b8281dcf76a4e6395d10f45835c60e27357c92abf5a98c9a0337 + sha256: 60493f4e974fcca7b739aea4901af2d957b0eaea34b42815359be59cf6c88fa2 patches: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 From fc5ddd53e948f12e9ef1c3c6ceae1ce44bdf9b10 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Thu, 31 Aug 2023 12:17:33 +1100 Subject: [PATCH 32/32] try without patch for compiler-rt --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bd9b9fe..5a1f064 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,7 @@ source: patches: # link compiler-rt libs (upstream's find_compiler_rt_library doesn't work correctly); # probably related to https://github.com/llvm/llvm-project/issues/63286 - - patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch + # - patches/0001-always-link-in-compiler-rt-builtins-on-windows-apple.patch # backport https://reviews.llvm.org/D154660 - patches/0002-flang-Allow-runtime-build-with-AVOID_NATIVE_INT128_T.patch