Hi,
Thanks for the current dev of @vtraag integrating Leiden and R. Win10 being my workhorse, I am using the latest MSYS2, not the one of Rtools. Here is the error I am facing. Any idea is welcome. No problem to compile cigraph which is needed, but I got this error when executing “make” in the rigraph folder.
Best.
$ cigraph/tools/stimulus.py \
> -f cigraph/interfaces/functions.def \
> -i tools/stimulus/auto.R.in \
> -o R/auto.R \
> -t tools/stimulus/types-R.def \
> -l RR
Traceback (most recent call last):
File "cigraph/tools/stimulus.py", line 1487, in <module>
main()
File "cigraph/tools/stimulus.py", line 201, in main
cg=cl(functions, types)
File "cigraph/tools/stimulus.py", line 335, in __init__
CodeGenerator.__init__(self, func, types)
File "cigraph/tools/stimulus.py", line 223, in __init__
newtypes=parser.parse(ff)
File "cigraph/tools/stimulus.py", line 118, in parse
tok=lex.token()
File "cigraph/tools/stimulus.py", line 77, in token
while line[-1]=="\\":
IndexError: string index out of range
Could provide somewhat more details about how you downloaded/cloned the repository? There are some instructions in CONTRIBUTING.md you could follow.
One potential problem might be the line endings, I think it should all have only Linux style line endings (i.e. only \n) but it might be that you have all Windows line endings (i.e. \r\n). Could you perhaps check that?
This message comes from the Python-based interface generator that generates some parts of the source code of the R interface based on a function definiton file (functions.def). My guess would be that there is a syntax error somewhere in functions.def. @vtraag, you have recently added the definitions of the Leiden algorithm in functions.def - maybe something is wrong there?
This commit fixes the problem for me on my machine. (macOS, but with Windows line ending). The “universal newline mode” in Python basically converts all newlines to the Unix format on-the-fly, this is what we trigger in this commit with "rU".
Thanks for “rU”, it solves the issue. Next one is:
Traceback (most recent call last):
File "cigraph/tools/stimulus.py", line 1488, in <module>
main()
File "cigraph/tools/stimulus.py", line 203, in main
cg.generate(inputs, outputs[l])
File "cigraph/tools/stimulus.py", line 234, in generate
out=open(output, "w")
IOError: [Errno 2] No such file or directory: 'src/rinterface.c'
make: *** [Makefile:108 : src/rinterface.c] Erreur 1
I did mkdir src on command line. It seems that there is a “mkdir -p src” command missing in the Makefile for the target src/interface.c before the running the stimulus command.
Finally, I am ending up with the following error. I don’t if I should remove the code of R_igraph_getsphere from rinterface.c or do some other trick. Any help appreciated.
R_igraph_getsphere is in the optional/simpleraytracer folder in the repo of igraph (the C version). I think that’s only used for 3D graph plotting (not sure how), so if you don’t need this, you can comment it out for the time being to make things compile.
It is used in 2D graph plotting, to generate a certain vertex shape (which looks like shaded 3D spheres). Basically it generates a 3D sphere image at any resolution you want.
Thanks for the feedback. I investigated a little bit.
Although getsphere C code is an optional directory, this code is really used in a R function of plot.shapes.R file.
IMHO, there should be not optional stuff. I feel compilation already difficult enough for noob. like me
Reading the Rigraph Makefile, I think the content of the optional directory is copied to the src directory. In my case, it seems not to be done… But I don’t know how to debug this part of the Makefile. Currently, I commented the definition in the init.c file.
If I were you, I would clean the entire repository (using git clean -fdx and run make afresh. The Makefile might be a bit fragile, and if you encountered errors earlier, some to the commands might not have executed properly. The creation of the src directory should have also been done in the Makefile.