conduit
conduit copied to clipboard
flang compiler error (encountred in amd clang env)
...
753 F90-S-0450-Argument number 1 to assert_true: kind mismatch (/tmp/root/spack-stage/spack-stage-conduit-0.8.3-xopk6bhx4urgw6kox5dm6j32a2wmowv5/spack-src/src/tests/conduit/fortran/t_f_
conduit_node_obj.f90: 834)
754 F90-S-0450-Argument number 1 to assert_true: kind mismatch (/tmp/root/spack-stage/spack-stage-conduit-0.8.3-xopk6bhx4urgw6kox5dm6j32a2wmowv5/spack-src/src/tests/conduit/fortran/t_f_
conduit_node_obj.f90: 835)
755 F90-S-0450-Argument number 1 to assert_true: kind mismatch (/tmp/root/spack-stage/spack-stage-conduit-0.8.3-xopk6bhx4urgw6kox5dm6j32a2wmowv5/spack-src/src/tests/conduit/fortran/t_f_
conduit_node_obj.f90: 837)
756 F90-S-0450-Argument number 1 to assert_true: kind mismatch (/tmp/root/spack-stage/spack-stage-conduit-0.8.3-xopk6bhx4urgw6kox5dm6j32a2wmowv5/spack-src/src/tests/conduit/fortran/t_f_
conduit_node_obj.f90: 838)
757 F90-S-0450-Argument number 1 to assert_true: kind mismatch (/tmp/root/spack-stage/spack-stage-conduit-0.8.3-xopk6bhx4urgw6kox5dm6j32a2wmowv5/spack-src/src/tests/conduit/fortran/t_f_
conduit_node_obj.f90: 851)
758 0 inform, 0 warnings, 5 severes, 0 fatal for t_node_obj_names_embedded_slashes
``
flang doesn't like statements like this:
call assert_true( conduit_node_is_root(n) .eqv. .true.)
F90-S-0450-Argument number 1 to assert_true: kind mismatch
The return type of conduit_node_is_root
is logical(C_BOOL)
I also tried:
call assert_equals( conduit_node_is_root(n) , .true.)
@aaroncblack Wondering if you have seen anything like this with flang before?
It looks like flang is complaining that 'logical' ( the type of .TRUE. ) and logical(kind=c_bool) are different sizes. Maybe flang is picking a 1 or 2 byte representation for logical as its default, and c_bool is probably int size.
Easiest workaround is to make your own logical to compare against. Or add a flag to suppress the warning ( since the compiler can safely upcast or downcast to make the comparison )
logical(kind=c_bool), parameter :: my_true = .TRUE.
call assert_equals( conduit_node_is_root(n) , my_true)
thanks @aaroncblack !
still lost in the fortran jungle -- I think the issue is with what fruit expects for its functions params (assert_true
, etc)
logical(kind=c_bool), parameter :: t_true = .TRUE.
call assert_true(conduit_node_is_root(cnode) .eqv. t_true )
F90-S-0450-Argument number 1 to assert_true: kind mismatch (/conduit/src/tests/conduit/fortran/t_f_conduit_node.f90: 46)
0 inform, 0 warnings, 1 severes, 0 fatal for t_node_create
I also tried assert_equals
, but it can't resolve the proper type
logical(kind=c_bool), parameter :: t_true = .TRUE.
call assert_equals(conduit_node_is_root(cnode), t_true )
F90-S-0155-Could not resolve generic procedure assert_equals (/conduit/src/tests/conduit/fortran/t_f_conduit_node.f90: 46)
0 inform, 0 warnings, 1 severes, 0 fatal for t_node_create
Flags might help, but I expect some trouble with using them across compilers. It would be nice if we could find how we can construct the proper fruit asserts.
I think this is a path to victory:
call assert_true(LOGICAL(conduit_node_is_root(cnode) .eqv. .true.))
I'll use this approach for all of our tests.