yizhang-yiz / fazang

Fazang is a Fortran library for reverse-mode automatic differentiation, inspired by Stan/Math library.
BSD 3-Clause "New" or "Revised" License
40 stars 3 forks source link

Fails to compile with GCC 10 #4

Closed awvwgk closed 2 years ago

awvwgk commented 2 years ago
❯ FC=gfortran-10 meson setup _build_gcc10
The Meson build system
Version: 0.61.1
Source dir: /home/awvwgk/projects/src/git/fazang
Build dir: /home/awvwgk/projects/src/git/fazang/_build_gcc10
Build type: native build
Project name: Fazang
Project version: 0.0.1
Fortran compiler for the host machine: gfortran-10 (gcc 10.3.0 "GNU Fortran (Arch Linux 10.3.0-2) 10.3.0")
Fortran linker for the host machine: gfortran-10 ld.bfd 2.36.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 29

Found ninja-1.10.2 at /usr/bin/ninja
❯ ninja -C _build_gcc10
ninja: Entering directory `_build_gcc10'
[68/119] Compiling Fortran object test/unit/atan_test.p/atan_test.F90.o
FAILED: test/unit/atan_test.p/atan_test.F90.o 
gfortran-10 -Itest/unit/atan_test.p -Itest/unit -I../test/unit -Isrc/libfazang.so.p -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -g -ffree-line-length-none -Jtest/unit/atan_test.p -o test/unit/atan_test.p/atan_test.F90.o -c ../test/unit/atan_test.F90
../test/unit/atan_test.F90:23:12:

   23 |   y1 = atan(x)
      |            1
Error: ‘x’ argument of ‘atan’ intrinsic at (1) must be REAL or COMPLEX
../test/unit/atan_test.F90:35:12:

   35 |   y2 = atan(y1)
      |            1
Error: ‘x’ argument of ‘atan’ intrinsic at (1) must be REAL or COMPLEX
[73/119] Generating symbol file src/libfazang.so.p/libfazang.so.symbols
ninja: build stopped: subcommand failed.
yizhang-yiz commented 2 years ago

Toolchain of gcc 11+ should be added to doc & readme. See #6

yizhang-yiz commented 2 years ago

In Chap. 2 of https://github.com/yizhang-yiz/fazang/blob/main/doc/fazang_user_guide.pdf the required gcc version is provided.