bezier icon indicating copy to clipboard operation
bezier copied to clipboard

Add support in `CMakeLists.txt` for `flang`

Open dhermes opened this issue 6 years ago • 3 comments

An old version is available on conda-forge:

  • https://anaconda.org/conda-forge/flang (also https://anaconda.org/conda-forge/flang_win-64, but the other package supports win-64)

dhermes avatar Feb 11 '20 05:02 dhermes

To actually invoke these (as of e4aaec7db7b10d8412aad1901c7911c801a7d06f):

$ SRC_DIR=".../bezier/src/fortran"
$ BUILD_DIR="$(pwd)/build-flang/build"
$ INSTALL_PREFIX="$(pwd)/build-flang/usr"
$ FLANG_BIN="${HOME}/miniconda3/bin/flang"
$ mkdir -p "${BUILD_DIR}"
$ cmake \
>     -DCMAKE_Fortran_COMPILER="${FLANG_BIN}" \
>     -DCMAKE_BUILD_TYPE=Release \
>     -DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}" \
>     -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
>     -S "${SRC_DIR}" \
>     -B "${BUILD_DIR}"
-- The Fortran compiler identification is Flang 99.99.1
-- The C compiler identification is Clang 5.0.0
-- Check for working Fortran compiler: .../miniconda3/bin/flang
-- Check for working Fortran compiler: .../miniconda3/bin/flang  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether .../miniconda3/bin/flang supports Fortran 90
-- Checking whether .../miniconda3/bin/flang supports Fortran 90 -- yes
-- Check for working C compiler: .../miniconda3/bin/clang
-- Check for working C compiler: .../miniconda3/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at CMakeLists.txt:15 (message):
  gfortran and ifort are the only supported compilers


-- Configuring incomplete, errors occurred!
See also ".../build-flang/build/CMakeFiles/CMakeOutput.log".

dhermes avatar Feb 11 '20 07:02 dhermes

I started a branch for this (issue-202) but it may not go anywhere in the near term due to missing feature(s) in flang.

dhermes avatar Feb 11 '20 09:02 dhermes

I've been using https://github.com/flang-compiler/flang/wiki/Building-Flang to (try to) build flang from source. Currently (on macOS Catalina 10.15.3) hit a wall because the custom built clang++ can't find standard headers, e.g. <atomic> and <iostream>.

dhermes avatar Feb 13 '20 17:02 dhermes