Hacker News new | past | comments | ask | show | jobs | submit login
Supporting BFLOAT16 in ISO_Fortran_env: not recommended (j3-fortran.org)
1 point by zaikunzhang 6 months ago | hide | past | favorite | 7 comments




It’s in LLVM Flang as real(kind=3).


It is great to know that LLVM Flang supports BFLOAT16!

I look forward to trying it in my project ( http://www.libprima.net ), although LLVM Flang is not ready to use last time I tried.

As a side note, the Classic Flang ( https://github.com/flang-compiler/flang ) does not support kind = 3.


Your package builds fine for me with flang-new. How does one run its tests?


Hi, @pklausler, here is an example with gcc+gfortran. Thank you.

```

export CC=gcc

CFLAGS="-Wall -Wextra -Wpedantic -Werror"

export FC=gfortran

export FFLAGS='-Wall -Wextra -Wpedantic -Werror -fimplicit-none -frecursive -fcheck=all -fstack-check -Wno-function-elimination'

# Build

cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=. -LAH -DCMAKE_C_FLAGS="${CFLAGS}" -DCMAKE_Fortran_FLAGS="${FFLAGS}" .

cmake --build . --target install

cmake --build . --target tests

# Test

ctest --output-on-failure -V -E stress

```


> 100% tests passed, 0 tests failed out of 20

The flang-new driver doesn't support all of the options that you specified; I used "-pedantic -Werror -fimplicit-none", and observed no warnings.


Great! Thank you for trying! I will definitely explore flang-new in PRIMA.

I am particularly glad to hear that no flang-new raised no warning when compiling PRIMA. That is exactly what I wanted to achieve. PRIMA does not tolerate any warning. Each warning is regarded as a bug and gets fixed.

How should I install flang-new? Isn't compiling from the source the only way? I remember doing it once a few months ago, but the binary I got did not succeed in compiling PRIMA. Not sure what I missed. Maybe I should give it another go, especially for trying BFLOAT16!

Many thanks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: