how many to set value min and max in library LSM303 before calbrate.

LSM303::LSM303(void)
{
// These are just some values for a particular unit; it is recommended that
// a calibration be done for your particular unit.
m_max.x = +540; m_max.y = +500; m_max.z = 180;
m_min.x = -520; m_min.y = -570; m_min.z = -770;

You do not have to set the m_max and m_min values before you run the Calibrate example. The m_max and m_min vectors in the code you are referring to are only used in the heading calculation, which is not used in the Calibrate example. The correct way to do the calibration is to run the Calibrate example, move the board in all directions, get the values from it, and use them in your program.

If you want to use the LSM303 library by itself, instead of the AHRS program, you would do something like the Heading example:

compass.init();
compass.enableDefault();
// Calibration values. Use the Calibrate example program to get the values for
// your compass.
compass.m_min.x = -520; compass.m_min.y = -570; compass.m_min.z = -770;
compass.m_max.x = +540; compass.m_max.y = +500; compass.m_max.z = 180;

For the AHRS, you change the M_X_MIN through M_Z_MAX calibration constants to appropriate values.