ChileanVirtualObservatory / acalib

Advanced Computing for Astronomy Library
http://acalib.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 13 forks source link

acalib devel for dummies #63

Closed madiazp closed 7 years ago

madiazp commented 7 years ago

Need the commands and procedures to install acalib devel in a conda enviroment. The idea is that a script can do everything so it must be clear and automatic.

madiazp commented 7 years ago

So far I tried with: git clone https://github.com/ChileanVirtualObservatory/acalib.git pip install -e acalib

But, when I try to import acalib its fail with this output: ImportError: No module named 'acalib.core._morph.morph'

I searched the module and is not compiled, tryed to compile it but it has this output: morph.c:47:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for(int i = 1; i < n-1; i++) ^ morph.c: In function ‘differenceImpl’: morph.c:7:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for(int i = 1; i < n; i++) ^ morph.c:7:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code morph.c: In function ‘segmentationImpl’: morph.c:15:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for(int i = 1; i < n-1; i++) ^ morph.c: In function ‘erosionImpl’: morph.c:31:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for(int i = 0; i < n; i++) ^ morph.c:35:13: error: redefinition of ‘i’ for(int i = 1; i < n-1; i++) ^ morph.c:31:13: note: previous definition of ‘i’ was here for(int i = 0; i < n; i++) ^ morph.c:35:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for(int i = 1; i < n-1; i++) ^ morph.c:47:13: error: redefinition of ‘i’ for(int i = 1; i < n-1; i++) ^ morph.c:35:13: note: previous definition of ‘i’ was here for(int i = 1; i < n-1; i++) ^ morph.c:47:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode for(int i = 1; i < n-1; i++)

With those random portuguesse-like characters.

madiazp commented 7 years ago

I fixed it by adding in the setup.py a flag for gcc "-std=c11" and then compile all again (morph and acalib), I will do a pull request.