Cannot compile on Heimdall/Freia
Compilation fails at Heimdall, because the old gfortran compiler available there misses few Fortran 2003/2008 features:
- Deferred-length character component in derived types
-
findloc
intrisic function
Note: findloc
with an array of characters as input argument can be replaced by the F77 intrinsic index
.
Compilation errors
lfigini@heimdall113> make build/obj/gray_cli.o
gfortran -cpp -DREVISION=\"91fa6d8-dirty\" -DPREFIX=\"/usr\" -I/usr/local/depot/mdsplus-6.1/include -O3 -Jbuild/obj -Ibuild/inc -ffree-line-length-none -c 'src/gray_cli.f90' -o 'build/obj/gray_cli.o'
src/gray_cli.f90:16.47:
character(len=:), allocatable :: output_dir
1
Error: Deferred-length character component 'output_dir' at (1) is not yet supported
src/gray_cli.f90:16.47:
character(len=:), allocatable :: output_dir
1
Error: Deferred-length character component 'output_dir' at (1) is not yet supported
src/gray_cli.f90:240.16:
sep = findloc([(temp(i:i) == '=', i = 1, len(temp))], .true., 1)
1
Error: Function 'findloc' at (1) has no IMPLICIT type
make: *** [build/obj/gray_cli.o] Error 1
lfigini@heimdall113> make build/obj/ini_parser.o
gfortran -cpp -DREVISION=\"91fa6d8\" -DPREFIX=\"/usr\" -I/usr/local/depot/mdsplus-6.1/include -O3 -Jbuild/obj -Ibuild/inc -ffree-line-length-none -c 'src/ini_parser.f90' -o 'build/obj/ini_parser.o'
src/ini_parser.f90:190.8:
n = findloc([(str(i:i) == char, i = 1, len(str))], .true., 1)
1
Error: Function 'findloc' at (1) has no IMPLICIT type
src/ini_parser.f90:190.8:
n = findloc([(str(i:i) == char, i = 1, len(str))], .true., 1)
1
Error: Function reference to 'findloc' at (1) is to a non-PURE procedure within a PURE procedure
make: *** [build/obj/ini_parser.o] Error 1
Compiler version and configuration
lfigini@heimdall113> gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC)
ITER cluster has a more recent version and the binary compiles successfully from master branch.
figinil@sdcc-login02:~/gray.cnr.git> gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)
Keep in mind however that the default version must compile on both at ITER and CCFE. Features not implemented in any of the above compiler's version should not be used in the master branch.