build instructions for Linux, tested on Ubuntu 24.04:

sudo apt install libglfw3 libglew-dev libxxf86vm-dev libxinerama-dev libxcursor-dev libxi-dev libxrandr-dev libglm-dev libeigen3-dev

git clone https://github.com/PixarAnimationStudios/OpenSubdiv.git
cp *cpp *h CMakeLists.txt OpenSubdiv/tutorials/bfr/tutorial_1_2/

cd OpenSubdiv/
mkdir build
cd build
cmake -DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=/usr/include/eigen3 ..

make -j loopEpsilonSampling

run: ./bin/loopEpsilonSampling

----------------------------------------------------------
Preliminary instruction for Windows 11 Visual Studio 2026
1. Create new Visual Studio Project and add headers and c++ files to visual studio project.

2. Install vcpkg package manager and install opensubdiv, CGAL, glm, Eigen, see CGAL Website for instructions

3. Add vcpkg folders as vc++ include and library directories of the visual studio project 
- repos/vcpkg/installed/x64-windows/include, 
- repos/vcpkg/installed/x64-windows/lib
- repos/vcpkg/installed/x64-windows/include/eigen3 (so that "#include <Eigen/dense>" works in windows)

2.  Avoid error message  "fopen" is unsafe"
- Right‑click your project → Properties
- Go to C/C++ → Preprocessor
- Add _CRT_SECURE_NO_WARNINGS to Preprocessor Definitions

3. Enable /bigobj in Visual Studio for opensubdiv
- Right‑click your project → Properties
- Go to Configuration Properties → C/C++ → Command Line
- Add /bigobj to Additional Options

----------------------------------------------------------
for colorSubdiv.cpp on Linux:
build with
g++ -O3 -std=c++17 colorSubdiv.cpp shape_utils.cpp -o colorSubdiv -losdCPU -ltbb -pthread
run with
./colorSubdiv inputMeshes/bunny.obj 64

