freeseek / mocha

MOsaic CHromosomal Alterations (MoChA) caller
MIT License
81 stars 23 forks source link

Question compiling with Homebrew GCC 10.2.0_4 #11

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey Giulio, have you even seen this gcc compile issue before?

plugins/mocha.c:718:36: error: function definition is not allowed here
    double f(double x, void *data) { return -baf_phase_lod(baf, gt_phase, n, imap, path, err_log_prb, baf_sd, x); }
                                   ^
plugins/mocha.c:719:31: error: use of undeclared identifier 'f'
    double x, fx = kmin_brent(f, 0.1, 0.2, NULL, KMIN_EPS, &x);
freeseek commented 3 years ago

This is weird as gcc supports nested functions. My guess it that, as explained in this post, you are using clang rather than gcc.

ghost commented 3 years ago

Thanks Giulio, looks like anaconda3 uses clang and it was first in my path so that fixed it.