renjin
renjin copied to clipboard
Missing fortran builtins
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
@thorstenwagner this will also affect the compiled code. Need to do some research on what these functions are meant to do!
Thank you for your efforts :-)
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/
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.
Any progress here? :-)
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:
- logical.f - Fortran test source
- Corresponding Java test case in GimpleCompilerTest
@psolaimani This is going to be an issue in glmnet as well.
@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