You will need a working objective caml installation and 
the FaCiLe library properly configured and installed
to compile eqchem.

In practice, one would only run make in this directory (src/solver)
"make"
"make clean", etc

To assemble with a c++ or a kde program, the object files 
solver.o and modwrap.o must be added and linked with :
-L/usr/lib/ocaml -L/usr/lib/ocaml/facile -lasmrun -lstr -lnums -lm -ldl solver.o modwrap.o

The program built can then be run without the objective caml tools.

Console examples can also be generated (try "make test")


== Comments for usage ==

The goal is to solve simple chemical equations of the form :
a formula1 + b formula2 ... -> c formula3 + d formula4 ..
like in : aCH3CH2OH + bO2 -> cH2O + dCO2
(1 CH3CH2OH + 3 O2 -> 3 H2O + 2 CO2  is suggested as a solution)

The solver finds integer values for the quantities a, b, c, d
and can be used to point out mistakes in formula or for searching new ones.

It is also possible to give initial values for the quantities a, b, c ..
for instance 3 CH3CH2OH + bO2 -> cH2O + dCO2
(a possible solution is : 3 CH3CH2OH + 9 O2 -> 9 H2O + 6 CO2)

Using the solver
----------------

*** Parenthesis are allowed, provided that
a value is present after the closing parenthesis

aCH3(CH2)3COOH + bO2 -> cH2O + dCO2
aCH3(CH2)2CH3 + bCH3CH2CH3+bO2 -> cH2O + dCO2

*** It is possible to insert a value instead of a symbol
on the left of a molecule, as in the following examples :
xCH4 + yC2H6 + zO2 + uHNO3 -> cH2O + dCO2 + eNO2
3CH4 + 2C2H6 + zO2 + uHNO3 -> cH2O + dCO2 + eNO2
1CH4 + 5C2H6 + zO2 + 10HNO3 -> cH2O + dCO2 + eNO2

*** If the equation in input does not match the syntax
the solver will answer "Parse error"
* missing number after parenthesis
* missing arrow in the middle
* missing number on the left of a molecule
* ambiguous characters : 0/O, l/L/1

*** When the solver will answer "Not found" when it
encounters an infeasible equationlike the following :
1CH4 + 1O2 + 1HNO3 -> cH2O + fCH2ONO2 + eNO2

**** electric charges are allowed using the following syntax
4H2O -> aH3O[+]+bOH[-]
aFe[2+]+bMnO4[-]+cH3O[+]->dMn[2+]+eH2O+fFe[3+]

WARNING:
since eqchem computes integers, equations like this :
xCH4+3C2H6+zO2->cH2O+dCO2
do not always have a solution (in this case, z would be 29/2)
