From edc466920bce79c244aeb14b32200d3a64d665c3 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Mon, 7 Apr 2014 14:22:45 +0000
Subject: [PATCH] use SCIP for mixed integer programming

---
 CMakeLists.txt          | 13 +++++++++++++
 Common/GmshConfig.h.in  |  1 +
 Numeric/MetricBasis.cpp | 13 ++++++++++++-
 3 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f50b14233..1a88737ac2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,6 +77,7 @@ opt(POPPLER "Enable Poppler for displaying PDF documents (experimental)" OFF)
 opt(QT "Enable dummy QT graphical interface proof-of-concept (experimental)" OFF)
 opt(RTREE "Enable RTREE (used for quad/hex mesh generation)" ${DEFAULT})
 opt(SALOME "Enable Salome routines for CAD healing" ${DEFAULT})
+opt(SCIP "Enable SCIP optimization suite" OFF)
 opt(SGEOM "Enable SGEOM interface to OCC (experimental)" OFF)
 opt(SLEPC "Enable SLEPc eigensolvers (required for conformal compounds)" ${DEFAULT})
 opt(SOLVER "Enable built-in finite element solvers (required for compounds)" ${DEFAULT})
@@ -1065,6 +1066,18 @@ if(ENABLE_ACIS)
   endif(ACIS_LIB)
 endif(ENABLE_ACIS)
 
+if(ENABLE_SCIP)
+  find_library(SCIP_LIB scipopt PATH_SUFFIXES lib)
+  if(SCIP_LIB)
+    find_path(SCIP_INC "scip-3.1.0/src/scip/scip.h")
+    if(SCIP_INC)
+      set_config_option(HAVE_SCIP "SCIP")
+      list(APPEND EXTERNAL_LIBRARIES ${SCIP_LIB})
+      list(APPEND EXTERNAL_INCLUDES "${SCIP_INC}/scip-3.1.0/src;${SCIP_INC}/soplex-2.0.0/src")
+    endif(SCIP_INC)
+  endif(SCIP_LIB)
+endif(ENABLE_SCIP)
+
 if(ENABLE_WRAP_PYTHON)
   find_package(SWIG)
   find_package(PythonLibs)
diff --git a/Common/GmshConfig.h.in b/Common/GmshConfig.h.in
index 5695622fd9..cfd854f929 100644
--- a/Common/GmshConfig.h.in
+++ b/Common/GmshConfig.h.in
@@ -58,6 +58,7 @@
 #cmakedefine HAVE_QT
 #cmakedefine HAVE_RTREE
 #cmakedefine HAVE_SALOME
+#cmakedefine HAVE_SCIP
 #cmakedefine HAVE_SGEOM
 #cmakedefine HAVE_SLEPC
 #cmakedefine HAVE_SOLVER
diff --git a/Numeric/MetricBasis.cpp b/Numeric/MetricBasis.cpp
index 68c6f1a801..3e4ae55d3b 100644
--- a/Numeric/MetricBasis.cpp
+++ b/Numeric/MetricBasis.cpp
@@ -3,12 +3,23 @@
 // See the LICENSE.txt file for license information. Please report all
 // bugs and problems to the public mailing list <gmsh@geuz.org>.
 
+#include "GmshConfig.h"
 #include "MetricBasis.h"
-//#include "GmshDefines.h"
 #include "BasisFactory.h"
 #include "pointsGenerators.h"
 #include <cmath>
 
+#if defined(HAVE_SCIP)
+#include <scip/scip.h>
+#include <soplex.h>
+
+void MaFonctionScip()
+{
+  SCIP *scip;
+  SCIPcreate(&scip);
+}
+#endif
+
 MetricCoefficient::MetricCoefficient(MElement *el) : _element(el)
 {
   const int tag = el->getTypeForMSH();
-- 
GitLab