https://kotlinlang.org logo
#kotlin-native
Title
# kotlin-native
p

Pavel Gorgulov

07/11/2022, 10:43 AM
Hi folks! Maybe someone can help me. I try to building lib through cinterop and there are complex numbers. On macosX64, macosArm64, mingwX64 everything is well, but on linuxX64 I get follow exception:
Copy code
16:22:47   Exception in thread "main" org.jetbrains.kotlin.konan.KonanExternalToolFailure: The /mnt/agent/system/.persistent_cache/konan/dependencies/llvm-11.1.0-linux-x64-essentials/bin/clang++ command returned non-zero exit code: 1.
16:22:47   output:
16:22:47   /mnt/agent/work/40296c97b9f61601/multik-native/multik_jni/src/main/cpp/mk_linalg.cpp:22:27: error: use of undeclared identifier 'creal'
16:22:47     return mk_complex_float{openblas_complex_float_real(ret), openblas_complex_float_imag(ret)};
16:22:47                             ^
16:22:47   /mnt/agent/work/40296c97b9f61601/multik-native/build/cmake-build/openblas-install/include/openblas_config.h:128:55: note: expanded from macro 'openblas_complex_float_real'
16:22:47     #define openblas_complex_float_real(z)             (creal(z))
At the same time, openblas has processing for different standards:
Copy code
#if ((defined(__STDC_IEC_559_COMPLEX__) || __STDC_VERSION__ >= 199901L || \
      (__GNUC__ >= 3 && !defined(__cplusplus))) && !(defined(FORCE_OPENBLAS_COMPLEX_STRUCT))) && !defined(_MSC_VER)
  #define OPENBLAS_COMPLEX_C99
#ifndef __cplusplus
  #include <complex.h>
#endif
  typedef float _Complex openblas_complex_float;
  typedef double _Complex openblas_complex_double;
  typedef xdouble _Complex openblas_complex_xdouble;
...
#else
  #define OPENBLAS_COMPLEX_STRUCT
  typedef struct { float real, imag; } openblas_complex_float;
  typedef struct { double real, imag; } openblas_complex_double;
  ...
#endif
3 Views