Commit 5013c382 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Je viens d'effectuer la migration prcs2git (prcs est mort, vive git).

Or j'étais en train de bidouiller plusieurs trucs sans avoir rien
commité...

Bon, plouf, plouf. Je synchronise et je repars sur des bases saines avec git.

source/luc4c_stubs.c:
        je sauve et je restaure les fegetexcept flags pour tourner autour d'un bug dans
        caml qui se manisfestait quand j'appelais du lucky depuis Alices.
        C'est vraisemblement la source de mes déboires avec Scade/VCS.EXE il fut un temps.
parent c9f9ddd4
[user]
name = Erwan Jahier
email = jahier@imag.fr
[core]
editor = emacsclient
excludesfile = /home/jahier/.gitignore
[alias]
amend = commit -a --amend
ci = commit
*~
*.cm[ixoa]
*.o
*.a
src/TAGS
*log
*.diff
src/._bcdi/*
src/._d/*
src/._ncdi/*
src/lus2lic
src/parser.ml
src/parser.mli
src/lexer.ml
src/lexer.mli
*.exe
*.dll
This diff is collapsed.
......@@ -5,7 +5,7 @@
# For updates see:
# http://www.oefai.at/~markus/ocaml_sources
#
# $Id: OCamlMakefile 1.1 Thu, 01 Feb 2007 10:32:02 +0100 jahier $
# $Id: OCamlMakefile,v 1.20 2002/08/29 11:26:39 markus Exp $
#
###########################################################################
......
# to run after a checkout in a fresh WS
# to run after a checkout in a fresh WS, or a change in the ocaml version
source: gen_version
./lnsw
cd polka; make clean; make all ; make install; cd ..
......@@ -16,7 +16,7 @@ clean:
VERSION:=$(shell prcs info --sort date ./lurette.prj | tail -n 1 | awk '{printf "%s\n", $$2}')
VERSION:=$(shell E=`git log --oneline | wc -l` ; echo "$$E-165" | bc )
gen_version:
rm -f source/version.ml
......@@ -29,8 +29,9 @@ gen_version:
ci:
prcs checkin -r 1 lurette.prj
git commit -a -F log
make gen_version
......@@ -42,14 +43,11 @@ ldiff:
pdiff -r unstable
diff:
pdiff -r 1
git diff > diff.diff
touch:
cd test && make touch
log:
prcs info -r unstable_1_43 -l lurette.prj
......@@ -5,7 +5,7 @@
# For updates see:
# http://www.oefai.at/~markus/ocaml_sources
#
# $Id: OcamlMakefile 1.56 Mon, 22 Sep 2008 18:20:01 +0200 jahier $
# $Id$
#
###########################################################################
......
V1.47 (19/03/2010)
* Correction d'un bug (dans caml en fait) qui apparaissait quand certains
"Floating-point environment flags" (cf fenv.h) étaient postionnés à vrai.
V1.46 (22/09/2009)
* Use polkag instead of polkai to build the binaries, as the latter raises
......
VERSION_DATE=15-04-09
VERSION=1.45
VERSION_DATE=19-03-10
VERSION=47
export VERSION
export VERSION_DATE
......@@ -6,5 +6,6 @@ outputs { x:int; y:bool; z:float }
states { 0:stable }
start_state { 0 }
transitions { 0 -> 0 ~cond b=>y and abs(x - a) < 5 and abs(z - c) < 5.0 }
transitions { 0 -> 0 ~cond
b=>y and abs(x - a) < 5 and abs(z - c) < 5.0 }
/*% $Id: cherni.c 1.5 Fri, 22 Jul 2005 17:06:41 +0200 jahier $ */
/*% $Id: cherni.c 1.4 Fri, 13 Feb 2004 16:03:37 +0100 jahier $ */
/*% Conversion from one representation to the dual one. */
......
/* $Id: polka_caml.c 1.3 Mon, 26 Sep 2005 13:51:19 +0200 jahier $ */
/* $Id: polka_caml.c 1.2 Fri, 19 Dec 2003 15:39:58 +0100 jahier $ */
#include <stddef.h>
#include <string.h>
......
(*i $Id: polka_lexer.mll 1.2.2.1 Fri, 08 Dec 2006 15:36:26 +0100 jahier $ i*)
(*i $Id: polka_lexer.mll 1.1 Fri, 07 Mar 2003 10:37:48 +0100 jahier $ i*)
(* Lexical analysis to convert strings to objects. *)
......
......@@ -43,7 +43,26 @@ liblucky_nc.a:
ar r liblucky_nc.a *.o && rm *.o &&\
ar x $(OCAMLLIB)/libnums.a &&\
ar q liblucky_nc.a *.o && rm *.o &&\
cp liblucky_nc.a ..
cp liblucky_nc.a ..
# un petit essai pour les gens de Corys
.PHONY:liblucky_nc.so
liblucky_nc.so:
[ -d lurette_util ] || mkdir lurette_util && \
cd lurette_util && rm -f * && \
cp ../Ezdl_c.o . &&\
cp ../liblutin_stubs.o . &&\
cp ../liblutin_c.o . &&\
ar x $(LURETTE_PATH)/$(HOST_TYPE)/lib/bdd.a &&\
ar x $(LURETTE_PATH)/$(HOST_TYPE)/lib/libbdd_stubs.a &&\
ar x $(LURETTE_PATH)/$(HOST_TYPE)/lib/libpolkag_caml.a &&\
ar x $(LURETTE_PATH)/$(HOST_TYPE)/lib/libpolkag.a &&\
ar x $(OCAMLLIB)/libcamlidl.a &&\
ar x $(OCAMLLIB)/libunix.a &&\
ar x $(OCAMLLIB)/libstr.a &&\
ar x $(OCAMLLIB)/libnums.a &&\
gcc -shared -o liblucky_nc.so *.o && rm *.o &&\
cp liblucky_nc.so ..
# On rajoute asmrun + les fichiers spcifiques lurette.
......@@ -66,6 +85,22 @@ libluc4c_nc.a: luc4c_lib.o luc4c_stubs.o luc4c.ml
cp libluc4c_nc.a ..
.PHONY:libluc4c_nc.so
libluc4c_nc.so: luc4c_lib.o luc4c_stubs.o luc4c.ml
[ -d lurette_util ] || mkdir lurette_util && \
cd lurette_util && rm -f * && \
cp ../luc4c_lib.o . && \
cp ../luc4c_stubs.o . && \
ar x $(OCAMLLIB)/libasmrun.a &&\
gcc -shared -o libluc4c_nc.so *.o && rm *.o &&\
cp libluc4c_nc.so ..
libluc4c_nc.so_bis:
make -f Makefile.luc4c dllluc4c_lib.o_stubs.so
mv dllluc4c_lib.o_stubs.so libluc4c_nc.so
# cudd_liblurette_nc.a:
# cd lurette_util && rm * && \
......@@ -533,6 +568,12 @@ luc4c:
make libluc4cnc
make -k ncl -f Makefile.luc4c OCAMLFLAGS="-noassert -unsafe"
# Pour Corys
luc4c_so:
make liblucky_nc.so
make libluc4c_nc.so
luc4c_clean:
make -k clean -f Makefile.luc4c
rm -f libluc4c_nc.a luc4c_lib.o luc4c_stubs.o
......@@ -705,6 +746,10 @@ cp:
make luc4ocaml-cp ;\
make draw-cp
# cp libluc4c_nc.so $(LIB_INSTALL_DIR) ;\
# cp liblucky_nc.so $(LIB_INSTALL_DIR) ;\
install_assert: all_assert cp
install: all cp
......
......@@ -3,7 +3,7 @@
ifeq ($(HOST_TYPE),win32)
VERSION = $(shell cat ../source/version.ml | sed 's/=/ /' | sed 's/\"//g' | awk '{printf "%s\n", $$3}')
else
VERSION = $(shell prcs info --sort=date ../lurette.prj | tail -n 1 | awk '{printf "%s\n", $$2}')
VERSION = $(shell git log --oneline -1 | awk '{printf "%s\n", $$3}' )
endif
#VERSION=1.43
......@@ -296,6 +296,45 @@ test-luc4ocaml-rel:
cd /tmp/$(LUC4OCAML_RELEASE_NAME)/examples/ocaml/crazy-rabbit && \
make test
#################################################################################################"
LUC4C_RELEASE_NAME=luc4c_$(VERSION)_$(HOSTTYPE32)
luc4c-rel:
rm -rf /tmp/$(LUC4C_RELEASE_NAME); mkdir /tmp/$(LUC4C_RELEASE_NAME)
mkdir /tmp/$(LUC4C_RELEASE_NAME)/lib
mkdir /tmp/$(LUC4C_RELEASE_NAME)/include
mkdir /tmp/$(LUC4C_RELEASE_NAME)/bin
mkdir /tmp/$(LUC4C_RELEASE_NAME)/examples
mkdir /tmp/$(LUC4C_RELEASE_NAME)/doc
\
ranlib ../$(HOSTTYPE)/lib/*.a
cp ../README-luc4c /tmp/$(LUC4C_RELEASE_NAME)/
cp ../$(HOSTTYPE)/bin/luc2c /tmp/$(LUC4C_RELEASE_NAME)/bin
cp ../$(HOSTTYPE)/bin/lucky_cpp /tmp/$(LUC4C_RELEASE_NAME)/bin
cp ../$(HOSTTYPE)/bin/gnuplot-rif /tmp/$(LUC4C_RELEASE_NAME)/bin
cp ../$(HOSTTYPE)/lib/liblucky_nc.a /tmp/$(LUC4C_RELEASE_NAME)/lib
cp ../$(HOSTTYPE)/lib/libluc4c_nc.a /tmp/$(LUC4C_RELEASE_NAME)/lib
cp ../$(HOSTTYPE)/lib/libgmp.a /tmp/$(LUC4C_RELEASE_NAME)/lib || true
cp ../$(HOSTTYPE)/lib/*luc4c*.* /tmp/$(LUC4C_RELEASE_NAME)/lib
\
cp ../$(HOSTTYPE)/include/luc4c_stubs.h /tmp/$(LUC4C_RELEASE_NAME)/include
\
cp -rf $(HOME)/SYNCHRON/lurette/doc/lucky-man.pdf \
/tmp/$(LUC4C_RELEASE_NAME)/doc || true
cp -rf ../examples/lucky/C /tmp/$(LUC4C_RELEASE_NAME)/examples/
\
rm -f /tmp/$(LUC4C_RELEASE_NAME)/lib/*~
cd /tmp && tar cvfz $(LUC4C_RELEASE_NAME).tgz $(LUC4C_RELEASE_NAME)
cp /tmp/$(LUC4C_RELEASE_NAME).tgz $(SYNCHRONE_DIR)/lurette/
test-luc4c-rel:
cp $(SYNCHRONE_DIR)/lurette/$(LUC4C_RELEASE_NAME).tgz /tmp && \
cd /tmp && \
tar xvfz $(LUC4C_RELEASE_NAME).tgz && \
cd /tmp/$(LUC4C_RELEASE_NAME)/examples/C && \
make test
#################################################################################################"
......
......@@ -11,7 +11,7 @@
(* *)
(***********************************************************************)
(* $Id: genlex.ml 1.1.1.1 Fri, 08 Dec 2006 15:36:26 +0100 jahier $ *)
(* $Id: genlex.ml,v 1.9 2002/04/18 07:27:42 garrigue Exp $ *)
(*
Modified by Erwan Jahier
......
......@@ -190,6 +190,8 @@ let (gen_h_file : string -> Exp.var list -> Exp.var list -> Exp.var list -> unit
putln (Util.entete "// ");
putln ("#ifndef _" ^ fn ^ "_H_INCLUDED \n");
putln ("#define _" ^ fn ^ "_H_INCLUDED \n");
putln "#include <luc4c_stubs.h> \n";
putln "//-------- Predefined types ---------";
......@@ -290,6 +292,7 @@ let (gen_h_file : string -> Exp.var list -> Exp.var list -> Exp.var list -> unit
)
in_vars;
putln "#endif \n";
flush oc;
close_out oc
......
......@@ -17,6 +17,7 @@
*)
open Value
let debug = false
(*********************************************************************)
(* Handling Lucky processes *)
......@@ -40,9 +41,11 @@ let (lucky_process_tbl:lp_tbl) = Hashtbl.create 1
let lucky_process_cpt = ref 0
let get_new_lucky_process_number () =
incr lucky_process_cpt;
(* print_string ( *)
(* "# CAML: get_new_lucky_process_number: create a new lucky process (" ^ *)
(* (string_of_int !lucky_process_cpt) ^ ")\n"); *)
if debug then (
print_string (
"# CAML: get_new_lucky_process_number: create a new lucky process (" ^
(string_of_int !lucky_process_cpt) ^ ")\n");
);
!lucky_process_cpt
let (add_lp: lucky_process -> Env_state.t -> unit) =
......@@ -157,7 +160,7 @@ let (kill_lucky_process : lucky_process -> unit) =
(* ********************************************************************** *)
let step_mode_to_lucky_step_mode = function
StepInside -> Lucky.StepInside
StepInside -> Lucky.StepInside
| StepEdges -> Lucky.StepEdges
| StepVertices -> Lucky.StepVertices
......@@ -173,9 +176,11 @@ let (list_to_tbl : Var.subst list -> subst_tbl) =
(* exported *)
let (step: lucky_process -> step_mode -> unit) =
fun lp step_mode ->
(* print_string ( *)
(* "# CAML: step lp= " ^ (string_of_int lp) ^ " \n" ); *)
(* flush stdout; *)
if debug then (
print_string (
"# CAML: step lp= " ^ (string_of_int lp) ^ " \n" );
flush stdout;
);
match state_of_lp lp with
| Some (st0,inp,_outp) ->
let ral = Run_aut.get inp st0 st0.d.current_nodes in
......@@ -324,15 +329,19 @@ let (get_output_int : lucky_process -> string -> int) =
let (get_output_float : lucky_process -> string -> float) =
fun lp name ->
(* print_string ( *)
(* "# CAML: get_output_float \"" ^ name ^ "\" (" ^ (string_of_int lp) ^ ") : " ); *)
flush stdout;
if debug then (
print_string (
"# CAML: get_output_float \"" ^ name ^ "\" (" ^ (string_of_int lp) ^ ") : " );
flush stdout;
);
match get_outval_val lp name with
| B(b) -> failwith ("luc4c: "^name^" is not a bool")
| N(F(f)) ->
(* print_float f; *)
(* print_string "\n"; *)
(* flush stdout; *)
if debug then (
print_float f;
print_string "\n";
flush stdout
);
f
| N(I(i)) -> failwith ("luc4c: "^name^" is not an int")
......
......@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <fenv.h>
#include <caml/mlvalues.h>
#include <caml/callback.h>
#include <caml/alloc.h>
......@@ -28,32 +29,14 @@ static int caml_started = 0;
void lucky_caml_init()
{
//char** argv;
// ooc = fopen("/home/jahier/tata.log", "a");
// fprintf(ooc,"XXX\n");
// fflush(ooc);
//printf(stdout,"# luc4c_stubc.c: lucky_caml_init\n");
if (!caml_started) {
/* Fake the command-line arguments: */
/*
argv = malloc(2*sizeof(char *));
argv[0] = malloc(sizeof(NOM_BIDON)+1);
strcpy(argv[0],NOM_BIDON);
argv[1] = (char*) 0 ;
*/
// fprintf(ooc," XXX lucky_caml_u_init: \n");
// fflush(ooc);
// cette instruction fait planter VCS.exe alors que simu2.exe marche !!!
int fe;
if (!caml_started) {
// Some fenv flags make caml_startup raise some flotting pointts execeptions.
fe=fegetexcept();
fedisableexcept(FE_ALL_EXCEPT);
caml_startup(&argv_bidon[0]);
// fprintf(ooc," XXX lucky_caml_u_init : ok...\n");
// fflush(ooc);
feenableexcept(fe);
caml_started = 1;
}
return;
......
let str="1.45"
let str="47"
Supports Markdown
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