diff --git a/Geo/Curvature.cpp b/Geo/Curvature.cpp
index 11635073a26878a66544e1b31fce2cb2d2053a2b..3faff3c5d87d1942197f533ef5ae493a49b919aa 100644
--- a/Geo/Curvature.cpp
+++ b/Geo/Curvature.cpp
@@ -5,6 +5,7 @@
 
 #include "Curvature.h"
 #include "MElement.h"
+#include "MTriangle.h"
 #include "GEntity.h"
 #include "GFaceCompound.h"
 #include "MLine.h"
@@ -87,7 +88,7 @@ Curvature& Curvature::getInstance()
 
  //========================================================================================================
  void Curvature::retrieveCompounds()  {
-
+#if defined(HAVE_SOLVER)
    std::vector<GEntity*> entities;
    _model->getEntities(entities);
 
@@ -104,6 +105,7 @@ Curvature& Curvature::getInstance()
      }
 
    }
+#endif
  }
 
 //========================================================================================================
diff --git a/Geo/GFace.cpp b/Geo/GFace.cpp
index acfa8e3db37ed678c0be0f255d2229d973f161c2..50624eda7e15dbe2f83a0794bf501aae5d2e1e73 100644
--- a/Geo/GFace.cpp
+++ b/Geo/GFace.cpp
@@ -17,7 +17,6 @@
 #include "Numeric.h"
 #include "GaussLegendre1D.h"
 #include "Context.h"
-#include "meshGFaceLloyd.h"
 #include "meshGFaceOptimize.h"
 
 #define SQU(a)      ((a)*(a))
diff --git a/Geo/GFaceCompound.h b/Geo/GFaceCompound.h
index ca2de6243d56d518b29fb05c8a89c5a255d7b718..0ff98f451f28e8944f339bf4edcdef5ebeb63940 100644
--- a/Geo/GFaceCompound.h
+++ b/Geo/GFaceCompound.h
@@ -146,7 +146,9 @@ class GFaceCompound : public GFace {
 template<class scalar> class linearSystem;
 class GFaceCompound : public GFace {
  public:
-  typedef enum {HARMONIC=1,CONFORMAL=2, CONVEXCOMBINATION=3, MULTISCALE=4} typeOfMapping;
+  typedef enum {ITERU=0,ITERV=1,ITERD=2} iterationStep;
+  typedef enum {HARMONIC=1,CONFORMAL=2, CONVEXCOMBINATION=3, MULTISCALE=4, RBF=5} typeOfMapping;
+  typedef enum {UNITCIRCLE, SQUARE} typeOfIsomorphism;
  GFaceCompound(GModel *m, int tag, std::list<GFace*> &compound,
 	       std::list<GEdge*> &U0, linearSystem<double>* lsys =0,
                 typeOfMapping typ = HARMONIC, int allowPartition=1)
diff --git a/Mesh/BackgroundMesh.cpp b/Mesh/BackgroundMesh.cpp
index 1e5b90125df63ff8073f4f926d3d725b744c18bb..ad053eb098932eda57ef3ee80e6c75a2649dd62b 100644
--- a/Mesh/BackgroundMesh.cpp
+++ b/Mesh/BackgroundMesh.cpp
@@ -477,6 +477,7 @@ backgroundMesh::~backgroundMesh()
 static void propagateValuesOnFace (GFace *_gf, 				  
 				   std::map<MVertex*,double> &dirichlet)
 {
+#if defined(HAVE_SOLVER)
   linearSystem<double> *_lsys = 0;
 #if defined(HAVE_PETSC) && !defined(HAVE_TAUCS)
   _lsys = new linearSystemPETSc<double>;
@@ -526,10 +527,12 @@ static void propagateValuesOnFace (GFace *_gf,
   }
   
   delete _lsys;
+#endif
 }
 
 void replaceMeshCompound(GFace *gf, std::list<GEdge*> &edges)
 {
+#if defined(HAVE_SOLVER)
   std::list<GEdge*> e = gf->edges();
   //Replace edges by their compounds
   std::set<GEdge*> mySet;
@@ -545,6 +548,7 @@ void replaceMeshCompound(GFace *gf, std::list<GEdge*> &edges)
   }
   edges.clear();
   edges.insert(edges.begin(), mySet.begin(), mySet.end());
+#endif
 }
 
 void backgroundMesh::propagate1dMesh(GFace *_gf)
@@ -575,7 +579,7 @@ void backgroundMesh::propagate1dMesh(GFace *_gf)
     }
   }
 
-  propagateValuesOnFace(_gf,sizes);
+  propagateValuesOnFace(_gf, sizes);
 
   std::map<MVertex*,MVertex*>::iterator itv2 = _2Dto3D.begin();
   for ( ; itv2 != _2Dto3D.end(); ++itv2){
diff --git a/Mesh/Generator.cpp b/Mesh/Generator.cpp
index 0136357145e15b9618b5f0600569f66f112ad44f..a89fe66a2b5430c940c45111fec087f2dad6e1ee 100644
--- a/Mesh/Generator.cpp
+++ b/Mesh/Generator.cpp
@@ -21,13 +21,13 @@
 #include "meshGEdge.h"
 #include "meshGFace.h"
 #include "meshGFaceOptimize.h"
-#include "meshGFaceLloyd.h"
 #include "meshGFaceBDS.h"
 #include "meshGRegion.h"
 #include "BackgroundMesh.h"
 #include "BoundaryLayers.h"
 #include "HighOrder.h"
 #include "Generator.h"
+#include "meshGFaceLloyd.h"
 
 #if defined(HAVE_POST)
 #include "PView.h"
@@ -470,6 +470,7 @@ static void Mesh2D(GModel *m)
   }
 
 
+#if defined(HAVE_BFGS)
   // lloyd optimization
   if (CTX::instance()->mesh.optimizeLloyd){
     for(GModel::fiter it = m->firstFace(); it != m->lastFace(); ++it){
@@ -493,6 +494,7 @@ static void Mesh2D(GModel *m)
     }
     */
   }
+#endif
 
   // collapseSmallEdges(*m);
 
diff --git a/Mesh/QuadTriExtruded2D.cpp b/Mesh/QuadTriExtruded2D.cpp
index 5e485a533cdd5602dd25dc4d91144198a23e1d31..e2dddb828c4bf796b1f2b87c0aeb6330df080503 100644
--- a/Mesh/QuadTriExtruded2D.cpp
+++ b/Mesh/QuadTriExtruded2D.cpp
@@ -418,7 +418,7 @@ static int MeshQuadToTriTopUnstructured(GFace *from, GFace *to,
     double d1 = verts[0]->distance(verts[2]);
     double d2 = verts[1]->distance(verts[3]);
     
-    if( std::fabs(d1*d1-mag_sq_ave) <= std::fabs(d2*d2-mag_sq_ave) ){ 
+    if(fabs(d1*d1-mag_sq_ave) <= fabs(d2*d2-mag_sq_ave) ){ 
       addTriangle(verts[0],verts[1],verts[2],to,element);
       addTriangle(verts[0],verts[2],verts[3],to,element);
     }
diff --git a/Mesh/QuadTriUtils.cpp b/Mesh/QuadTriUtils.cpp
index cd88a7228e6914ed0fb170ea03d476bced7dace4..ea25202434df659c0c7f815f44f80932ff7cbc05 100644
--- a/Mesh/QuadTriUtils.cpp
+++ b/Mesh/QuadTriUtils.cpp
@@ -565,7 +565,7 @@ int IsSurfaceALateralForRegion(GRegion *region, GFace *face)
     source_v = reg_source->vertices();
     std::list<GVertex*>::iterator itvs;
     double tol = 1.00e-12; 
-    double eps = std::fabs( tol * CTX::instance()->lc ); 
+    double eps = fabs( tol * CTX::instance()->lc ); 
     unsigned int j_top, k_top;
     j_top = reg_ep->mesh.NbLayer-1;
     k_top = reg_ep->mesh.NbElmLayer[j_top];
@@ -577,7 +577,7 @@ int IsSurfaceALateralForRegion(GRegion *region, GFace *face)
       bool found_one = false;
       for( itvf = face_v.begin(); itvf != face_v.end(); itvf++ ){
         double x2 = (*itvf)->x(), y2 = (*itvf)->y(), z2 = (*itvf)->z();
-        if( std::fabs(x2-x1) <= eps && std::fabs(y2-y1) <= eps && std::fabs(z2-z1) <= eps ){
+        if( fabs(x2-x1) <= eps && fabs(y2-y1) <= eps && fabs(z2-z1) <= eps ){
           found_one = true;
           break;
         }
diff --git a/Mesh/highOrderTools.h b/Mesh/highOrderTools.h
index 75d7af6b5b02e69a6f42981e9be380eefd448123..3d6b6613519919dc93384bc65730b0184c40598b 100644
--- a/Mesh/highOrderTools.h
+++ b/Mesh/highOrderTools.h
@@ -10,6 +10,7 @@
 #include <vector>
 #include "GmshConfig.h"
 #include "GmshMessage.h"
+#include "GModel.h"
 
 #if defined(HAVE_SOLVER)
 
@@ -80,11 +81,12 @@ class highOrderTools
 class highOrderTools
 {
  public:
-  highOrderTools(GModel *gm);
+  highOrderTools(GModel *gm)
   {
     Msg::Error("Gmsh has to be compiled with solver support to use highOrderSmoother");
   }
   void applyGlobalSmoothing (){}
+  void ensureMinimumDistorsion (double threshold){}
 };
 
 #endif
diff --git a/Mesh/meshGFaceLloyd.cpp b/Mesh/meshGFaceLloyd.cpp
index bc889b52819b1073847b3ce6f8e0b6571e81fc9b..5ac9777aa9778a223c77c2906612e51db97d4cef 100644
--- a/Mesh/meshGFaceLloyd.cpp
+++ b/Mesh/meshGFaceLloyd.cpp
@@ -1,5 +1,8 @@
 #include <set>
 #include "meshGFaceLloyd.h"
+
+#if defined(HAVE_BFGS)
+
 #include "DivideAndConquer.h"
 #include "GFace.h"
 #include "MElement.h"
@@ -1911,3 +1914,5 @@ MElementOctree* wrapper::get_octree(){
 void wrapper::set_octree(MElementOctree* new_octree){
   octree = new_octree;
 }
+
+#endif
diff --git a/Mesh/meshGFaceLloyd.h b/Mesh/meshGFaceLloyd.h
index 2c8d6ee49b6308b0f7677f0cd8a51f26331c2091..544f4c475e4ace2bd615059edd60d32ad30251c2 100644
--- a/Mesh/meshGFaceLloyd.h
+++ b/Mesh/meshGFaceLloyd.h
@@ -5,6 +5,11 @@
 
 #ifndef _MESH_GFACE_LLOYD_H_
 #define _MESH_GFACE_LLOYD_H_
+
+#include "GmshConfig.h"
+
+#if defined(HAVE_BFGS)
+
 #include "fullMatrix.h"
 #include "DivideAndConquer.h"
 #include <queue>
@@ -243,3 +248,5 @@ class wrapper{
 };
 
 #endif
+
+#endif
diff --git a/Mesh/meshGRegionMMG3D.cpp b/Mesh/meshGRegionMMG3D.cpp
index 56fd75d03a09568205ab6917fddef0f6090c81e5..bcfc5e3759b61a83be4ed0049143113290760c55 100644
--- a/Mesh/meshGRegionMMG3D.cpp
+++ b/Mesh/meshGRegionMMG3D.cpp
@@ -1,6 +1,14 @@
+// Gmsh - Copyright (C) 1997-2011 C. Geuzaine, J.-F. Remacle
+//
+// See the LICENSE.txt file for license information. Please report all
+// bugs and problems to <gmsh@geuz.org>.
+
 #include "GmshConfig.h"
+#include "GmshMessage.h"
 #include "meshGRegionMMG3D.h"
-#ifdef HAVE_MMG3D
+
+#if defined(HAVE_MMG3D)
+
 #include <set>
 #include "GRegion.h"
 #include "GFace.h"
@@ -15,7 +23,8 @@ extern "C" {
 #define M_UNUSED    (1 << 0)
 }
 
-void MMG2gmsh (GRegion *gr, MMG_pMesh mmg, std::map<int,MVertex*> &mmg2gmsh){
+void MMG2gmsh (GRegion *gr, MMG_pMesh mmg, std::map<int,MVertex*> &mmg2gmsh)
+{
   std::map<int,MVertex*> kToMVertex;
   for (int k=1;k<= mmg->np ; k++){
     MMG_pPoint ppt = &mmg->point[k]; 
@@ -38,15 +47,16 @@ void MMG2gmsh (GRegion *gr, MMG_pMesh mmg, std::map<int,MVertex*> &mmg2gmsh){
       MVertex *v3 = kToMVertex[ptetra->v[2]];
       MVertex *v4 = kToMVertex[ptetra->v[3]];
       if (!v1 || !v2 || !v3 || !v4){
-	Msg::Error("Element %d Unknown Vertex in MMG2gmsh %d(%p) %d(%p) %d(%p) %d(%p)",k,ptetra->v[0],v1,ptetra->v[1],v2,ptetra->v[2],v3,ptetra->v[3],v4);
+	Msg::Error("Element %d Unknown Vertex in MMG2gmsh %d(%p) %d(%p) %d(%p) %d(%p)",
+                   k,ptetra->v[0],v1,ptetra->v[1],v2,ptetra->v[2],v3,ptetra->v[3],v4);
       }
       else gr->tetrahedra.push_back(new MTetrahedron(v1,v2,v3,v4));
     }
   }
 }
 
-void gmsh2MMG (GRegion *gr, MMG_pMesh mmg, MMG_pSol sol, std::map<int,MVertex*> &mmg2gmsh){
-
+void gmsh2MMG (GRegion *gr, MMG_pMesh mmg, MMG_pSol sol, std::map<int,MVertex*> &mmg2gmsh)
+{
   mmg->ne = gr->tetrahedra.size();
   std::set<MVertex*> allVertices;
   for (int i=0;i< gr->tetrahedra.size() ; i++){
@@ -174,7 +184,8 @@ void gmsh2MMG (GRegion *gr, MMG_pMesh mmg, MMG_pSol sol, std::map<int,MVertex*>
   
 }
 
-void updateSizes (GRegion *gr, MMG_pMesh mmg, MMG_pSol sol){
+void updateSizes (GRegion *gr, MMG_pMesh mmg, MMG_pSol sol)
+{
   std::list<GFace*> f = gr->faces();
   /*
   std::map<MVertex*,std::pair<double,int> > LCS;
@@ -228,7 +239,8 @@ void updateSizes (GRegion *gr, MMG_pMesh mmg, MMG_pSol sol){
 }
 
 
-void FREEMMG (MMG_pMesh mmgMesh, MMG_pSol mmgSol){
+void FREEMMG (MMG_pMesh mmgMesh, MMG_pSol mmgSol)
+{
   free(mmgMesh->point);
   //  free(mmgMesh->disp->alpha);
   //  free(mmgMesh->disp->mv);
@@ -243,7 +255,8 @@ void FREEMMG (MMG_pMesh mmgMesh, MMG_pSol mmgSol){
   free(mmgSol);
 }
 
-void refineMeshMMG(GRegion *gr){
+void refineMeshMMG(GRegion *gr)
+{
   MMG_pMesh mmg = (MMG_pMesh)calloc(1,sizeof(MMG_Mesh)); 
   MMG_pSol  sol = (MMG_pSol)calloc(1,sizeof(MMG_Sol)); 
   std::map<int,MVertex*> mmg2gmsh;
@@ -270,7 +283,10 @@ void refineMeshMMG(GRegion *gr){
 }
 
 #else
-void refineMeshMMG(GRegion *gr){
+
+void refineMeshMMG(GRegion *gr)
+{
   Msg::Error("You should compile your version of Gmsh with MMG3D, the Mobile Mesh Generator");
 }
+
 #endif
diff --git a/utils/misc/gmsh_app.plist b/utils/misc/gmsh_app.plist
index 6fa56b99ae5f178fb78a5af0ea4412263a9c645c..bd8c83e4903e7103b2744127f4994e610a592f15 100644
--- a/utils/misc/gmsh_app.plist
+++ b/utils/misc/gmsh_app.plist
@@ -9,7 +9,7 @@
     <key>CFBundleShortVersionString</key><string>GMSH_VERSION</string>
     <key>CFBundleIconFile</key><string>Gmsh.icns</string>
     <key>CFBundleSignature</key><string>GMSH</string>
-    <key>CFBundleGetInfoString</key><string>Gmsh GMSH_VERSION, Copyright 1997-2009 C. Geuzaine and J.-F. Remacle</string>
+    <key>CFBundleGetInfoString</key><string>Gmsh GMSH_VERSION, Copyright 1997-2011 C. Geuzaine and J.-F. Remacle</string>
     <key>CFBundleIdentifier</key><string>org.geuz.Gmsh</string>
     <key>CFBundleDocumentTypes</key>
     <array>