llnl / llnl/zfp

zfp Fortran compilation problem with flang (AMD aocc 2.2.0)

Open
#104 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
885
Forks
181
PR merge metrics
No merged PRs in 30d

Description

zfp.f contains code sequences like
integer, parameter :: const_zFORp_version_major = 0
integer, parameter :: const_zFORp_version_minor = 5
integer, parameter :: const_zFORp_version_patch = 5
integer, protected, bind(c, name="zFORp_version_major") :: zFORp_version_major
integer, protected, bind(c, name="zFORp_version_minor") :: zFORp_version_minor
integer, protected, bind(c, name="zFORp_version_patch") :: zFORp_version_patch
data zFORp_version_major/const_zFORp_version_major/, &
zFORp_version_minor/const_zFORp_version_minor/, &
zFORp_version_patch/const_zFORp_version_patch/

that create a compilation problem for the flang (aocc 2.2.0) compiler inducing messages like
F90-W-0164-Overlapping data initializations of zforp_version_minor ...

the appropriate symbols also seem to be misisng from zfp.o

this looks like a compiler problem,
as a workaround, i suppressed the bind(c, ....) clauses for initialized variables to be able to use zfp with that Fortran compiler
the zfp fortran test seems to work properly

i have sent email to AMD with a reduced version of the problem to show it in a simple case
module demo
integer, parameter :: const_zFORp_version_major = 0
integer, parameter :: const_zFORp_version_minor = 5
integer, parameter :: const_zFORp_version_patch = 5
integer, protected, bind(c, name="zFORp_version_major") :: zFORp_version_major = const_zFORp_version_major
integer, protected, bind(c, name="zFORp_version_minor") :: zFORp_version_minor = const_zFORp_version_minor
integer, protected, bind(c, name="zFORp_version_patch") :: zFORp_version_patch = const_zFORp_version_patch
end module
is enough to make flang protest

Contributor guide

Open the contributing guide

Research direction

Start by examining zfp.f and reproducing the reported build with flang from AMD AOCC 2.2.0. Compare the compiler diagnostics and generated symbols with the Fortran test, which the report says works after suppressing the bind(c) clauses. Done means establishing a supported compatibility change or documenting that the compiler issue remains external.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.