internal error: UTI-MIS-1041 chpl version 2.0.1
Internal errors indicate a bug in the Chapel compiler,
and we're sorry for the hassle. We would appreciate your reporting this bug --
please see https://chapel-lang.org/bugs.html for instructions.
Is this a blocking issue with no known work-arounds?
There is a work around. The work around is to replace the incorrectly typed extern
and then the example not only compiles, it also runs correctly. :)
Steps to Reproduce
Source Code:
// example.chpl
use CTypes;
// array example
var D = 0..9;
extern proc initArray(arr: c_ptr(c_double), size: c_int, val: c_double);
var arr : [D] c_double;
initArray(c_ptrTo(arr), arr.size:c_int, 42.0:c_double);
writeln("arr = ", arr);
! exampleLib.f90
module TestProcs
use iso_c_binding
implicit none
contains
! initializes the given 1D array of length size with val at each index
subroutine initArray(arr, size, val) bind(C,name='initArray')
use iso_c_binding, only: c_int, c_double
implicit none
integer(c_int), intent(in) :: size
real(c_double), intent(out) :: arr(size)
real(c_double), intent(in) :: val
integer :: i
do i = 1, size
arr(i) = val
end do
end subroutine initArray
end module TestProcs
gfortran --version
GNU Fortran (Homebrew GCC 14.1.0) 14.1.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Summary of Problem
Description:
Is this a blocking issue with no known work-arounds? There is a work around. The work around is to replace the incorrectly typed extern
with
and then the example not only compiles, it also runs correctly. :)
Steps to Reproduce
Source Code:
Compile command:
Configuration Information
Output of
chpl --version
:Output of
$CHPL_HOME/util/printchplenv --anonymize
: