Commit cd22ba33 authored by Thierry Martinez's avatar Thierry Martinez

Library path

parent b26c067a
......@@ -4,9 +4,14 @@
start/0,
initialize/0,
biocham_command/0,
biocham_command/1
biocham_command/1,
library_path/1
]).
:- doc('
The Biochemical Abstract Machine (Biocham) is a software environment for
modeling and analyzing biochemical systems.
').
start :-
about,
......@@ -15,11 +20,32 @@ start :-
initialize :-
initialize_library_path,
prolog_history(enable),
set_counter(item_id, 0),
new_model.
:- dynamic(library_path/1).
initialize_library_path :-
(
getenv('BIOCHAMLIB', LibraryPath)
->
true
;
executable_filename(ExecutableFilename),
absolute_file_name(
'library/gsl_solver.c',
LibraryFile,
[relative_to(ExecutableFilename)]
),
file_directory_name(LibraryFile, LibraryPath)
),
assertz(library_path(LibraryPath)).
biocham_command.
......
......@@ -2,6 +2,7 @@
doc,
[
doc/1,
devdoc/1,
grammar/1,
generate_doc/0
]
......@@ -11,6 +12,9 @@
doc(_).
devdoc(_).
grammar(_).
......@@ -355,6 +359,15 @@ generate_body_item_stream(Stream, Doc, Type) :-
->
close_grammar(Doc),
!
;
(
Clause = (:- doc(Contents))
;
Clause = (:- devdoc(Contents)),
Type = devdoc
)
->
write_doc(Doc, Contents)
;
Clause = (:- grammar(Grammar))
->
......
......@@ -257,9 +257,11 @@ print(FILE *csv, double t, double x[])
compile_c_program(ExecutableFilename) :-
library_path(LibraryPath),
absolute_file_name('gsl_solver.c', GslSolverC, [relative_to(LibraryPath)]),
call_subprocess(
path(gcc),
['-o', ExecutableFilename, 'gsl_solver.c',
['-o', ExecutableFilename, '-I', '.', GslSolverC,
'-lgsl', '-lgslcblas', '-lm']).
......
* Getting Started
** Overview
- doc.pl
- biocham.pl
- biocham.plt
- about.pl
......@@ -13,7 +14,6 @@
- gsl.plt
- counters.pl
** About this manual
- doc.pl
- filename.pl
* Syntax of Biocham Reaction Systems
** Biochemical objects
......
......@@ -8,7 +8,8 @@
equals_to_list/2,
list_to_equals/2,
list/1,
nth0_eqq/3
nth0_eqq/3,
executable_filename/1
]).
name_variables(L) :-
......@@ -101,3 +102,7 @@ nth0_eqq(0, [Head | _Tail], Result) :-
nth0_eqq(N, [_Head | Tail], Result) :-
nth0_eqq(M, Tail, Result),
N is M + 1.
executable_filename(Filename) :-
current_prolog_flag(os_argv, [_Swipl, _X, Filename | _]).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment