UKZN-Astronomy / corrcal

Python/C code for calibration of quasi-redundant arrays. Different (fixed) algorithm from original corrcal
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Compiling problem with the corrcal library corrcal_funs.c #11

Closed ronniyjoseph closed 4 years ago

ronniyjoseph commented 4 years ago

When compiling corrcal_funs.c:

gcc-4.8 -fopenmp -std=c99 -O3 -shared -fPIC -o libcorrcal_funs.so corrcal_funs.c -lm -lgomp

I get a compile error:

corrcal_funs.c: In function ‘apply_gains_to_mat’:
corrcal_funs.c:123:3: error: incompatible type for argument 1 of ‘creal’
   printf("%d", creal(gains));
   ^
In file included from corrcal_funs.c:7:0:
/usr/include/x86_64-linux-gnu/bits/cmathcalls.h:130:1: note: expected ‘complex double’ but argument is of type ‘_Complex double *’
 __MATHDECL (_Mdouble_,creal, (_Mdouble_complex_ __z));
 ^

Although, I didn't get this error earlier (having been successful at compiling) I can't figure why this error occurs.

ronniyjoseph commented 4 years ago

Alright, issue solved. Commented out the line, it's print statement that doesn't seem that necessary (at the moment)

We might want to get such print statements later for logging etc. But the code can compile again. I've merged that fix with the restructure_branch.