This commit is contained in:
Vitor Santos Costa 2017-05-02 07:31:42 +01:00
parent 0320d8b49b
commit a21dce7801

View File

@ -10,6 +10,15 @@
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/**
* @file real.pl
* @brief Prolog component of r_interface
* @defgroup realpl Prolog component of r_interface
* @ingroup real
* @{
* Initialization code and key predicares for R-Prolog interface.
*
*/
:- module(real, [ :- module(real, [
start_r/0, start_r/0,
@ -51,7 +60,6 @@
]). ]).
:- use_module(library(shlib)).
:- use_module(library(lists)). :- use_module(library(lists)).
:- use_module(library(apply_macros)). :- use_module(library(apply_macros)).
:- use_module(library(charsio)). :- use_module(library(charsio)).
@ -125,8 +133,8 @@ init_r_env :-
install_in_osx. install_in_osx.
init_r_env :- init_r_env :-
absolute_file_name( path('R'), This, absolute_file_name( path('R'), This,
[ extensions(['',exe]), [ extensions(['',so,dll,dylib]),
access(execute) access(read)
] ), ] ),
dirpath_to_r_home( This, Rhome ), dirpath_to_r_home( This, Rhome ),
exists_directory( Rhome ), !, exists_directory( Rhome ), !,
@ -134,7 +142,8 @@ init_r_env :-
setenv('R_HOME',Rhome). setenv('R_HOME',Rhome).
init_r_env :- init_r_env :-
throw( real_error(r_root) ). throw(
error(r_root) ).
% track down binarythrough symbolic links... % track down binarythrough symbolic links...
dirpath_to_r_home( This0, Rhome ) :- dirpath_to_r_home( This0, Rhome ) :-
@ -212,7 +221,8 @@ start_r :-
!, !,
swipl_wins_warn, swipl_wins_warn,
init_r_env, init_r_env,
load_foreign_files([libreal], [], init_R), load_foreign_files([libreal], [], install_real),
init_R,
set_prolog_flag(double_quotes, string ), set_prolog_flag(double_quotes, string ),
set_prolog_flag( real, started ). set_prolog_flag( real, started ).
start_r. start_r.