renjin icon indicating copy to clipboard operation
renjin copied to clipboard

Missing fortran builtins

Open akbertram opened this issue 8 years ago • 8 comments

Package mclust is missing the following Fortran builtins:

Warning: undefined function _gfortran_sum_r8; may throw exception at runtime
Warning: undefined function _gfortran_internal_pack; may throw exception at runtime
Warning: undefined function _gfortran_internal_unpack; may throw exception at runtime
Warning: undefined function intpr_; may throw exception at runtime
Warning: undefined function d1mach_; may throw exception at runtime
Warning: undefined function i1mach_; may throw exception at runtime

akbertram avatar Jul 04 '16 14:07 akbertram

@thorstenwagner this will also affect the compiled code. Need to do some research on what these functions are meant to do!

akbertram avatar Jul 04 '16 14:07 akbertram

Thank you for your efforts :-)

thorstenwagner avatar Jul 04 '16 18:07 thorstenwagner

I'm willing to help. I've done some research: This is an c implementation of sum_r8: https://searchcode.com/codesearch/view/63387344/ Here is the documentation of this function: https://gcc.gnu.org/onlinedocs/gfortran/SUM.html c implementation internal_pack: https://searchcode.com/codesearch/view/63387190/ c implementation internal_unpack: https://searchcode.com/codesearch/view/63387189/

thorstenwagner avatar Jul 04 '16 18:07 thorstenwagner

I tried to create a simple test case for these array descriptors and functions, but it seems that GCC basically compiled away my toy test case into a simple loop.

akbertram avatar Jul 11 '16 14:07 akbertram

Any progress here? :-)

thorstenwagner avatar Nov 01 '16 14:11 thorstenwagner

Sadly not! I wasn't able to create a minimal test case, so it's still not super clear in which contexts these functions are used. For variable length arrays? If you can craft a failing test case I can definitely take another stab at it. Here is an example of a Fortran test case:

akbertram avatar Nov 01 '16 15:11 akbertram

@psolaimani This is going to be an issue in glmnet as well.

akbertram avatar Nov 20 '16 19:11 akbertram

@psolaimani internal_pack is here: https://github.com/gcc-mirror/gcc/blob/gcc-4_7_4-release/libgfortran/runtime/in_pack_generic.c. This function dispatches to generated implementations here https://github.com/gcc-mirror/gcc/blob/gcc-4_7_4-release/libgfortran/generated/in_pack_i16.c

akbertram avatar Jan 16 '18 15:01 akbertram