next up previous contents
Next: Execution problems Up: Troubleshooting: ALIAS-Maple does not Previous: Troubleshooting: ALIAS-Maple does not   Contents


Compilation problems

In some cases for complex expressions the code produced by ALIAS-Maple cannot be compiled for lack of memory. C++ seems to be indeed quite sensitive to the size of the expressions.

A first possibility is to turn off the optimization flag that is used for the compilation by setting the flag `ALIAS/optimized` to 0.

If the compilation cannot still be completed you are confronted to a difficult problem: basically the only solution is to try to simplify the generated expression using auxiliary variables for terms that appear at least twice in the code. The mechanisms described in sections 2.1.2,2.3.2 may allow to perform part of this task automatically.

But many time it will be necessary to modify the C++ program that has been produced especially the procedure involving the expressions, their jacobian and Hessian. The name of this procedure are usually F, J and H respectively and are located usually in the files _F_.c, _J_.c, _H_.c.

Another possibility is to compile separately these files which are included in the main program (usually named _G.._.C). For that you will need to modify the code and makefile (which is usually named _makefile). For example for the _F_.c you will first rename this program _F_.C, add the following header:

 
#include <fstream>
#include "Functions.h"
#include "Vector.h"
#include "IntervalVector.h"
#include "IntervalMatrix.h"
#include "IntervalMatrix.h"
#include "IntegerVector.h"
#include "IntegerMatrix.h"
Then the makefile will be modified so that _F_.o will appear in the dependency. Hence the line:
 
_GS_:_GS_.C $(LIB_SOLVE)
will be changed to:
 
_GS_:_GS_.C _F_.o $(LIB_SOLVE)
Then indicate that _F_.o should be linked by adding this file name before the library flag LIB_SOLVE. Hence:
 
	$(CC) -I$(INCL) -I$(INCLI) _GS_.C -o _GS_ \
		$(LIB_SOLVE) -L$(LIB) $(LD) -lm
will be changed to:
 
	$(CC) -I$(INCL) -I$(INCLI) _GS_.C -o _GS_ \
		_F_.o $(LIB_SOLVE) -L$(LIB) $(LD) -lm

An alternative is to avoid generating C++ file for the interval evaluation of expression but rather use the ALIAS-C++ parser to get the interval evaluation of the expressions by an interpretation mechanism. This is possible for most of the ALIAS-Maple procedures by setting the variable `ALIAS/use_parser` to 1. To determine if a procedure offers this possibility check the on-line help and look if the variable `ALIAS/use_parser` is in the list of the global variables for the procedure.


next up previous contents
Next: Execution problems Up: Troubleshooting: ALIAS-Maple does not Previous: Troubleshooting: ALIAS-Maple does not   Contents
Jean-Pierre Merlet 2012-12-20