Jelajahi Sumber

updated readme to include build instructions for externals, bug fixed in embree lib paths

Former-commit-id: 8a5cf8640c498ab81df9af02867e5eaea97d2470
Alec Jacobson 11 tahun lalu
induk
melakukan
fe9e094c4f

+ 2 - 1
Makefile

@@ -100,10 +100,11 @@ INC+=$(ANTTWEAKBAR_INC)
 #LIB+=-framework GLUT
 #LIB+=-framework AppKit
 
+.PHONY: obj
 obj: 
 	mkdir -p obj
 
-lib/libigl.a: $(OBJ_FILES)
+lib/libigl.a: obj $(OBJ_FILES)
 	mkdir -p lib
 	rm -f $@
 	ar cqs $@ $(OBJ_FILES)

+ 0 - 1
Makefile.conf

@@ -21,7 +21,6 @@ else
 	AFLAGS+=-arch x86_64 -m64 -march=corei7-avx
 endif
 
-
 # Default parameters for the IGL group members based on there computer's
 # username
 ifndef IGL_USERNAME

+ 52 - 5
README.md

@@ -16,8 +16,8 @@ listed below.
 - Eigen3  Last tested with Eigen Version 3.2
 
 ### Optional ###
-- OpenGL (IGL_NO_OPENGL)
-- AntTweakBar  (IGL_NO_ANTTWEAKBAR) Last tested 1.16 (see
+- OpenGL (`IGL_NO_OPENGL`)
+- AntTweakBar  (`IGL_NO_ANTTWEAKBAR`) Last tested 1.16 (see
 -   libigl/external/AntTweakBar)
 - GLEW  Windows only
 - OpenMP  
@@ -34,7 +34,7 @@ listed below.
 ## Header only ##
 libigl is designed to work "out-of-the-box" as a headers only library. To
 include libigl in your project. You need only include the libigl/include/
-directory in your include path and define the IGL_HEADER_ONLY macro. To 
+directory in your include path and define the `IGL_HEADER_ONLY` macro. To 
 compile a hello-word example.cpp:
 
     #include <Eigen/Dense>
@@ -77,11 +77,11 @@ To build the entire libigl library producing lib/libigl.a, issue:
     make lib
   
 You may need to edit Makefile.conf accordingly. Best to give yourself an
-IGL_USERNAME and add a custom install suite for yourself. Then you can enable
+`IGL_USERNAME` and add a custom install suite for yourself. Then you can enable
 appropriate extras.
   
 #### Extras ####
-Once you've set up an IGL_USERNAME and enabled extras within Makefile.conf.
+Once you've set up an `IGL_USERNAME` and enabled extras within Makefile.conf.
 You can build the extra libraries (into lib/ligiglpng.a, lib/libiglmatlab.a,
 lib/libigltetgen.a, lib/libiglmosek.a, etc.) by issuing:
   
@@ -98,6 +98,53 @@ Finally there are a number of external libraries that we include in
 patched for easier use with libigl. Please see the respective readmes in
 those directories.
 
+
+##### Installing AntTweakBar #####
+To build the a static AntTweakBar library on Mac OS X issue:
+
+    cd external/AntTweakBar/src
+    make -f Makefile.osx.igl
+
+##### Installing Tetgen #####
+To build the tetgen library and executable on Mac OS X issue:
+
+    cd external/tetgen
+    make clean
+    rm -f obj/*.o
+    make -f Makefile.igl tetlib
+    rm -f obj/*.o
+    rm tetgen
+    make -f Makefile.igl tetgen
+
+##### Installing Embree 2.0 #####
+To build the embree library and executables on Mac OS X issue:
+
+    cd external/embree
+    mkdir build
+    cd build
+    cmake ..
+    # Or using a different compiler
+    #cmake .. -DCMAKE_C_COMPILER=/opt/local/bin/gcc -DCMAKE_CXX_COMPILER=/opt/local/bin/g++
+    make
+    # Could also install embree to your root, but libigl examples don't expect
+    # this
+    #sudo make install
+
+##### Installing tinyxml2 #####
+To build the a static tinyxml2 library on Mac OS X issue:
+
+    cd external/tinyxml2
+    cmake .
+    make
+
+
+##### Installing YImg #####
+To build the a static YImg library on Mac OS X issue:
+
+    cd external/yimg
+    make
+
+
 ## Windows (Experimental) ##
 To build a static library (.lib) on windows, open Visual Studio 2010.
 

+ 2 - 2
examples/ambient-occlusion/Makefile

@@ -16,10 +16,10 @@ EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
 
 #EMBREE=$(LIBIGL)/external/embree
 #EMBREE_INC=-I$(EMBREE)/rtcore -I$(EMBREE)/common
-#EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
+#EMBREE_LIB=-L$(EMBREE)/build -lrtcore -lsys
 EMBREE=$(LIBIGL)/external/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
-EMBREE_LIB=-L$(EMBREE)/bin -lembree -lsys
+EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 ANTTWEAKBAR_INC=-I$(LIBIGL)/external/AntTweakBar/include
 ANTTWEAKBAR_LIB=-L$(LIBIGL)/external/AntTweakBar/lib -lAntTweakBar -framework AppKit

+ 2 - 2
examples/arap/Makefile

@@ -16,10 +16,10 @@ EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
 
 #EMBREE=$(LIBIGL)/external/embree
 #EMBREE_INC=-I$(EMBREE)/rtcore -I$(EMBREE)/common
-#EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
+#EMBREE_LIB=-L$(EMBREE)/build -lrtcore -lsys
 EMBREE=$(LIBIGL)/external/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
-EMBREE_LIB=-L$(EMBREE)/bin -lembree -lsys
+EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 # YIMAGE Library
 YIMG=$(LIBIGL)/external/yimg/

+ 2 - 2
examples/colored-mesh/Makefile

@@ -16,10 +16,10 @@ EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
 
 #EMBREE=$(LIBIGL)/external/embree
 #EMBREE_INC=-I$(EMBREE)/rtcore -I$(EMBREE)/common
-#EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
+#EMBREE_LIB=-L$(EMBREE)/build -lrtcore -lsys
 EMBREE=$(LIBIGL)/external/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
-EMBREE_LIB=-L$(EMBREE)/bin -lembree -lsys
+EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 ANTTWEAKBAR_INC=-I$(LIBIGL)/external/AntTweakBar/include
 ANTTWEAKBAR_LIB=-L$(LIBIGL)/external/AntTweakBar/lib -lAntTweakBar -framework AppKit

+ 1 - 1
examples/embree/Makefile

@@ -18,7 +18,7 @@ EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
 
 EMBREE=$(LIBIGL)/external/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
-EMBREE_LIB=-L$(EMBREE)/bin -lembree -lsys
+EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 ANTTWEAKBAR_INC=-I$(LIBIGL)/external/AntTweakBar/include
 ANTTWEAKBAR_LIB=-L$(LIBIGL)/external/AntTweakBar/lib -lAntTweakBar -framework AppKit

+ 1 - 1
examples/patches/Makefile

@@ -21,7 +21,7 @@ ANTTWEAKBAR_LIB=-L$(LIBIGL)/external/AntTweakBar/lib -lAntTweakBar -framework Ap
 
 EMBREE=$(LIBIGL)/external/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
-EMBREE_LIB=-L$(EMBREE)/bin -lembree -lsys
+EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 MATLAB_INC=-I$(MATLAB)/extern/include/
 MATLAB_LIB=-L$(MATLAB)/bin/maci64 -lmx -lmat -lmex -lstdc++

+ 12 - 0
examples/scene-rotation/example.cpp

@@ -491,6 +491,18 @@ bool IS_KEYDOWN( uint16_t vKey )
   return keyStates[index].bigEndianValue & (1 << shift) ;
 }
 
+
+void undo()
+{
+  using namespace std;
+  if(!undo_stack.empty())
+  {
+    redo_stack.push(s);
+    s = undo_stack.top();
+    undo_stack.pop();
+  }
+}
+
 void redo()
 {
   using namespace std;

+ 2 - 2
examples/textured-mesh/Makefile

@@ -16,10 +16,10 @@ EIGEN3_INC=-I/opt/local/include/eigen3 -I/opt/local/include/eigen3/unsupported
 
 #EMBREE=$(LIBIGL)/external/embree
 #EMBREE_INC=-I$(EMBREE)/rtcore -I$(EMBREE)/common
-#EMBREE_LIB=-L$(EMBREE)/bin -lrtcore -lsys
+#EMBREE_LIB=-L$(EMBREE)/build -lrtcore -lsys
 EMBREE=$(LIBIGL)/external/embree
 EMBREE_INC=-I$(EMBREE)/ -I$(EMBREE)/embree
-EMBREE_LIB=-L$(EMBREE)/bin -lembree -lsys
+EMBREE_LIB=-L$(EMBREE)/build -lembree -lsys
 
 # YIMAGE Library
 YIMG=$(LIBIGL)/external/yimg/

+ 1 - 0
include/igl/writeSTL.cpp

@@ -1,4 +1,5 @@
 #include "writeSTL.h"
+#include <iostream>
 
 template <typename DerivedV, typename DerivedF, typename DerivedN>
 IGL_INLINE bool igl::writeSTL(

+ 3 - 0
todos.txt

@@ -1,3 +1,6 @@
+- clean up externals
+  - What's there for convenience?
+  - What's there because it's patched/
 - compile on Linux, Mac OS X, Windows
 - unit tests for all functions
 - standardize name of library "libigl", purge IGL LIB, igl_lib, igl lib, IGL