Problems using pack real

I’m using: SWI-Prolog version SWI-Prolog (threaded, 64 bits, version 8.1.17) on Windows10

I want to use the pack real with part of code found in the ‘pagerank.pl’ example
?- use_module(library(real)).
?- <- library(igraph).
true.
?- g <- graph([1,2,3] ).

But what I’m getting is:
?- g <- graph([1,2,3] ).
ERROR: R was unable to digest your statement, either syntax or existance error.
?-

I found a work around like this :
?- x <- [1,2,3,4] .
true.

?- g <- graph(x).
true.

?- r <- page.rank(g).
true.

?- Scores <- r$vector.
Scores = [0.17543859649122806, 0.32456140350877194, 0.17543859649122806, 0.32456140350877194].

But I would like to use the original way contained in ‘PageRank.pl’

Btw on loading the real package I got the message :
% Found foreign libraries for target platform.
% Use ?- pack_rebuild(real). to rebuild from sources

But trying to rebuild from sources I got :
?- pack_rebuild(real).
ERROR: source_sink `path(bash)’ does not exist
ERROR: In:
ERROR: [22] throw(error(existence_error(source_sink,…),_7080))

Dear pjadata,

This is wrong R.

graph() expects edges. running your code in R:

g ← graph(c(1,2,3))
Error in (function (edges, n = max(edges), directed = TRUE) :
At structure_generators.c:83 : Invalid (odd) edges vector, Invalid edge vector

in Real (linux) :

?- g ← graph([1,2,3,4]).
true.

this just a warning that tells you pre-compiled version of the
pack is used. It is fine to use that. To rebuild your computer
must be able to compile c code from source.

if the message annoys you there must be a simple way to remove it.

Regards,

Nicos Angelopoulos

Dear Nicos,

Thank you for your message.

  1. Yes. I found out that graph(c(1,2,3)) was not giving an error message coming from real, but because thet is an invalid request.
    g <- graph([1,2,3,4]) is correct in R and in real…

  2. Go to kow about the message when installing real .

Thank you for our pack. My hopes are ther for heavy computations on Ts.

Best regards

Jacques

pja@a2m2.ch

Provenance : Courrier pour Windows 10