فهرست منبع

hacks to get tutorial to run with matlab2014b and gcc static lib

Former-commit-id: 39db3af0279cdd7971ea347dcc78f57642297242
Alec Jacobson 10 سال پیش
والد
کامیت
f693c29a91

+ 5 - 1
tutorial/403_BoundedBiharmonicWeights/CMakeLists.txt

@@ -3,9 +3,13 @@ project(403_BoundedBiharmonicWeights)
 
 include("../CMakeLists.shared")
 
+find_package(MOSEK REQUIRED)
+
+include_directories( ${MOSEK_INCLUDE_DIR} )
+
 set(SOURCES
 ${PROJECT_SOURCE_DIR}/main.cpp
 )
 
 add_executable(${PROJECT_NAME}_bin ${SOURCES} ${SHARED_SOURCES})
-target_link_libraries(${PROJECT_NAME}_bin ${SHARED_LIBRARIES})
+target_link_libraries(${PROJECT_NAME}_bin ${SHARED_LIBRARIES} ${MOSEK_LIBRARIES})

+ 2 - 0
tutorial/CMakeLists.shared

@@ -56,6 +56,8 @@ link_directories(
 
 # Disable deprecated opengl code from libigl
 add_definitions(-DIGL_OPENGL_4)
+add_definitions(-DNDEBUG)
+add_definitions(-O3)
 
 
 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

+ 14 - 0
tutorial/cmake/FindLIBIGL.cmake

@@ -12,6 +12,8 @@ find_package(Mosek QUIET)
 FIND_PATH(LIBIGL_INCLUDE_DIR igl/readOBJ.h
    /usr/include
    /usr/local/include
+   /usr/local/igl/libigl/include
+   $ENV{LIBIGL}/include
    $ENV{LIBIGLROOT}/include
    $ENV{LIBIGL_ROOT}/include
    $ENV{LIBIGL_DIR}/include
@@ -47,17 +49,20 @@ if(LIBIGL_USE_STATIC_LIBRARY)
   FIND_LIBRARY( LIBIGL_LIBRARY NAMES igl PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGL_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libigl")
   endif(NOT LIBIGL_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGL_LIBRARY})
 
   FIND_LIBRARY( LIBIGLBBW_LIBRARY NAMES iglbbw PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLBBW_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libiglbbw")
   endif(NOT LIBIGLBBW_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLBBW_LIBRARY})
   FIND_LIBRARY( LIBIGLMOSEK_LIBRARY NAMES iglmosek PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLMOSEK_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libiglmosek")
   endif(NOT LIBIGLMOSEK_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLMOSEK_LIBRARY})
   if(MOSEK_FOUND)
@@ -65,11 +70,13 @@ if(LIBIGL_USE_STATIC_LIBRARY)
     set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${MOSEK_LIBRARIES})
   else(MOSEK_FOUND)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find mosek")
   endif(MOSEK_FOUND)
 
   FIND_LIBRARY( LIBIGLEMBREE_LIBRARY NAMES iglembree PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLEMBREE_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libiglembree")
   endif(NOT LIBIGLEMBREE_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLEMBREE_LIBRARY})
   find_package(Embree REQUIRED)
@@ -77,12 +84,14 @@ if(LIBIGL_USE_STATIC_LIBRARY)
   FIND_LIBRARY( LIBIGLLIM_LIBRARY NAMES igllim PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLLIM_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libigllim")
   endif(NOT LIBIGLLIM_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLLIM_LIBRARY})
 
   FIND_LIBRARY( LIBIGLMATLAB_LIBRARY NAMES iglmatlab PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLMATLAB_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libiglmatlab")
   endif(NOT LIBIGLMATLAB_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLMATLAB_LIBRARY})
   find_package(Matlab REQUIRED)
@@ -91,29 +100,34 @@ if(LIBIGL_USE_STATIC_LIBRARY)
     set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${MATLAB_LIBRARIES})
   else(MATLAB_FOUND)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find matlab")
   endif(MATLAB_FOUND)
 
   FIND_LIBRARY( LIBIGLSVD3X3_LIBRARY NAMES iglsvd3x3 PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLSVD3X3_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libiglsvd3x3")
   endif(NOT LIBIGLSVD3X3_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLSVD3X3_LIBRARY})
 
   FIND_LIBRARY( LIBIGLTETGEN_LIBRARY NAMES igltetgen PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLTETGEN_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libigltetgen")
   endif(NOT LIBIGLTETGEN_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLTETGEN_LIBRARY})
 
   FIND_LIBRARY( LIBIGLTRIANGLE_LIBRARY NAMES igltriangle PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLTRIANGLE_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+    message(FATAL_ERROR "could NOT find libigltriangle")
   endif(NOT LIBIGLTRIANGLE_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLTRIANGLE_LIBRARY})
 
   FIND_LIBRARY( LIBIGLVIEWER_LIBRARY NAMES iglviewer PATHS ${LIBIGL_LIB_DIRS})
   if(NOT LIBIGLVIEWER_LIBRARY)
     set(LIBIGL_FOUND FALSE)
+      message(FATAL_ERROR "could NOT find libiglviewer")
   endif(NOT LIBIGLVIEWER_LIBRARY)
   set(LIBIGL_LIBRARIES ${LIBIGL_LIBRARIES}  ${LIBIGLVIEWER_LIBRARY})
 

+ 7 - 1
tutorial/cmake/FindMATLAB.cmake

@@ -137,7 +137,7 @@ ELSE(WIN32)
     IF((NOT DEFINED MATLAB_ROOT) OR ("${MATLAB_ROOT}" STREQUAL ""))
 
     # Search for a version of Matlab available, starting from the most modern one to older versions
-      FOREACH(MATVER "R2014a" "R2014a" "R2013b" "R2013a" "R2012b" "R2012a" "R2011b" "R2011a" "R2010b" "R2010a" "R2009b" "R2009a" "R2008b")
+      FOREACH(MATVER "R2015b" "R2015a" "R2014b" "R2014a" "R2014a" "R2013b" "R2013a" "R2012b" "R2012a" "R2011b" "R2011a" "R2010b" "R2010a" "R2009b" "R2009a" "R2008b")
         IF((NOT DEFINED MATLAB_ROOT) OR ("${MATLAB_ROOT}" STREQUAL ""))
           IF(EXISTS /Applications/MATLAB_${MATVER}.app)
             SET(MATLAB_ROOT /Applications/MATLAB_${MATVER}.app)
@@ -187,8 +187,14 @@ ELSE(WIN32)
 
 ENDIF(WIN32)
 
+if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+  set(MATLAB_LIBSTDCPP "-lstdc++")
+endif ()
+
+
 # This is common to UNIX and Win32:
 SET(MATLAB_LIBRARIES
+  ${MATLAB_LIBSTDCPP}
   ${MATLAB_MAT_LIBRARY}
   ${MATLAB_MEX_LIBRARY}
   ${MATLAB_MX_LIBRARY}