Hello from Valencia :)
I have just installed accull-0.4alpha.tar.gz on a Fedora 22 box (gcc 5.1.1 ; CUDA V7.0.27 ; kernel 4.0.4-303.fc22.x86_64), using a NVIDIA GTX 750 Ti 2GB graphic card (cm=5.0)
When I try to 'make' the pi example supplied in the installation package, the following errors stop the compilation process (attached full output in compilationError.log file):
<stdin>:4:9: error: los comentarios de estilo C++ no se permiten en ISO C90
<stdin>:4:9: error: (esto se reportará solamente una vez por cada fichero de entrada)
translated to english:
<stdin>:4:9: error: C++ style comments are not allowed in ISO C90
<stdin>:4:9: error: (this will be reported only once per input file)
I have been unable to instruct the accull compiler to pass --std=C99 to the (I guess) called gcc compiler.
Tracing the error, I found it is generated inside the comment_includes(source_code) function located in ./yacf/Frontend/C99/c99_prepro.py source file. The offending source string (source_yacf_comment variable) looks like this:
/*
* PI Computation in OpenACC
*/
/* ##### YACF /* ##### YACF #include <stdio.h> YACF ##### */ YACF ##### */
/* ##### YACF /* ##### YACF #include <sys/time.h> YACF ##### */ YACF ##### */
#define N_ELEM (512000*4)
typedef struct timeval CLOCK_TYPE;
int main (int argc, char * argv[]) {
int i;
...
Note the inclusion of some nested C++ comments on lines 5 and 6. When processing these nested (and standard illegal) C++ comments, the comment_includes(source_code) function gives:
YACF ##### */
YACF ##### */
#define N_ELEM (512000*4)
typedef struct timeval CLOCK_TYPE;
int main (int argc, char * argv[]) {
int i;
...
It effectively removes the legal C and C++ comments, but not the nested (and standard illegal) C++ comments, leaving some syntax errors (end comment symbols '*/' without the initial '/*' ones). So the process breaks in the next steps.
I have been able to make a workaround to solve this problem, patching the comment_includes(source_code) function in the ./yacf/Frontend/C99/c99_prepro.py source file in the following way:
$> diff c99_prepro.py_original c99_prepro.py
118c118,127
<
---
> # START patch:
> # First remove C comments '// comment'
> source_yacf_comment = re.sub(re.compile("//.*?\n" ) ," " ,source_yacf_comment) # remove all occurance singleline comments (//COMMENT\n ) from string
> # Then remove **nested C++ comments '/* /* nested comment1 */ comment2*/'
> auxString = ' '
> while source_yacf_comment != auxString:
> auxString = source_yacf_comment
> source_yacf_comment = re.sub(re.compile("/\*((?!/\*).)*?\*/",re.DOTALL ) ," " ,auxString)
> # END patch
This patch (also attached to the post, c99_prepro.patch) removes first the C comments, and then the C++ comments (even if they are, illegally, nested).
So my questions are:
1) How could I skip this error and allow a direct compilation without this problem.
2) Do you have any idea why I have those nested C++ comments? where does they come from? some mistake done for me when compiling the project?
By the way, I am running the code on a 5.0 cuda compatible card.
Thanks for your work on this interesting project,
Tomás.