Skip to content

fgsl_matrix_complex_init() has no intrinsic type, not declared PUBLIC in module ? #41

@JoachimRose

Description

@JoachimRose

Calculation of eigenvalues and eigenvectors for a double complex number Hermitian matrix.

Code shown below fails to compile using gcc15, because "fgsl_matrix_complex_init() has no intrinsic type".

Excerpt from code

  integer(fgsl_size_t), parameter :: n = 3_fgsl_size_t    
  integer(fgsl_int) :: status, i
  type(fgsl_matrix_complex) :: a, evec
  type(fgsl_vector)         :: eval
  complex(fgsl_double_complex), target :: af(n, n), evecf(n, n)
  real(fgsl_double), target :: evalf(n)
  type(fgsl_eigen_hermv_workspace)  :: w
  a    = fgsl_matrix_complex_init(af)      
  evec = fgsl_matrix_complex_init(evecf)
  eval = fgsl_vector_init(evalf)
  af = H                                                      ! copy input Hermitian matrix ( need to transpose first? )  
  w = fgsl_eigen_hermv_alloc(n)            ! allocate workspace 
  status = fgsl_eigen_hermv(a, eval, evec, w)
  status = fgsl_eigen_hermv_sort (eval, evec, FGSL_EIGEN_SORT_ABS_ASC)

When declaring fgsl_matrix_complex_init() as type(fgsl_matrix_complex), EXTERNAL as a temporary fix, the code compiles ok, but then the references to fgsl_matrix_complex_init and fgsl_matrix_complex_free are not resolved when linking (clang++, arm64, macOS 26.0.1).

Also, related question, does type(fgsl_matrix_complex) have type(fgsl_double_complex) components?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions