Skip to content

Commit

Permalink
Update dependencies (Yixin-Hu#25)
Browse files Browse the repository at this point in the history
* Update dependencies.

* Trying to update CI build.

* Download Boost via Hunter.

* Update README.

* update build.

* Fix build on Windows + use external CLI11.

* Fix stupid mistake.

* Indentation.
  • Loading branch information
jdumas authored and Yixin-Hu committed Sep 11, 2018
1 parent 9323d69 commit fede85f
Show file tree
Hide file tree
Showing 19 changed files with 669 additions and 3,016 deletions.
5 changes: 2 additions & 3 deletions .ci/conda/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ mkdir build
cd build

cmake -G "%GENERATOR%" ^
-DCMAKE_BUILD_TYPE="Release" ^
-DCMAKE_BUILD_TYPE="Release" ^
-DCMAKE_PREFIX_PATH:FILEPATH="%PREFIX%" ^
-DCMAKE_INSTALL_PREFIX:FILEPATH="%LIBRARY_PREFIX%" ^
-DBUILD_TESTING=OFF ^
-DUSE_ISPC=OFF ^
-DTETWILD_WITH_ISPC=OFF ^
..

msbuild /m /p:Configuration=Release INSTALL.vcxproj
5 changes: 2 additions & 3 deletions .ci/conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ mkdir build
cd build

cmake -G "Ninja" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_BUILD_TYPE="Release" \
-DCMAKE_INSTALL_PREFIX:FILEPATH=$HOME/.local/ \
-DBUILD_TESTING=OFF \
-DUSE_ISPC=OFF \
-DTETWILD_WITH_ISPC=OFF \
..

ninja install
6 changes: 3 additions & 3 deletions .ci/conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ requirements:
- vc 14 # [win]
- cmake
- ninja
- cgal
- boost-cpp

run:
- vc 14 # [win]
- cgal
- boost-cpp

about:
home: https://github.com/Yixin-Hu/TetWild
license: MPLv2.0
summary: Robust Tetrahedral Meshing in the Wild
summary: Robust Tetrahedral Meshing in the Wild
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Extern
/extern/.cache
/extern/spdlog
/extern/geogram
/extern/libigl
/extern/cli11

# Build
src/ispc/energy.h
Expand Down
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
[submodule "extern/libigl"]
path = extern/libigl
url = https://github.com/libigl/libigl
[submodule "extern/geogram"]
path = extern/geogram
url = https://github.com/alicevision/geogram
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ addons:
- ubuntu-toolchain-r-test
packages:
- g++-4.9
- libmpfr-dev
- libboost1.54-all-dev
- libxi-dev

Expand All @@ -22,7 +23,6 @@ matrix:
osx_image: xcode8.3

before_install:
- git submodule update --init --recursive
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
else
Expand Down
78 changes: 45 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
################################################################################
# TetWild CMake
################################################################################
cmake_minimum_required(VERSION 3.3)
project(TetWild)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

################################################################################
# Options
################################################################################
# tetwild
option(TETWILD_WITH_ISPC "Use ISPC" OFF)
option(TETWILD_WITH_HUNTER "Use Hunter to download and configure Boost" OFF)
option(TETWILD_WITH_ISPC "Use ISPC" OFF)
# libigl library
option(LIBIGL_USE_STATIC_LIBRARY "Use libigl as static library" OFF)
option(LIBIGL_WITH_ANTTWEAKBAR "Use AntTweakBar" OFF)
Expand All @@ -32,6 +30,21 @@ option(LIBIGL_WITH_VIEWER "Use OpenGL viewer" OFF)
#geogram
option(GEOGRAM_WITH_TRIANGLE "Use Triangle" OFF)

if(TETWILD_WITH_HUNTER)
# Needs to be set before the main project... argh =/
include(HunterGate)
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.25.tar.gz"
SHA1 "cb75cce9a3a8d552e70e7118f3203eb4ac05c201"
)
endif()

################################################################################
# Project name
################################################################################

project(TetWild)

################################################################################
# Settings
################################################################################
Expand All @@ -41,7 +54,6 @@ if(NOT CMAKE_BUILD_TYPE)
endif()

set(TETWILD_EXTERNAL "${CMAKE_CURRENT_SOURCE_DIR}/extern")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Color output
include(UseColors)
Expand All @@ -58,30 +70,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
################################################################################
# 3rd party libraries
################################################################################

# download external dependencies
include(TetWildDownloadExternal)

# spdlog
if(NOT TARGET spdlog::spdlog)
tetwild_download_spdlog()
add_subdirectory(${TETWILD_EXTERNAL}/spdlog)
endif()

# cgal
find_package(CGAL REQUIRED)

# libigl
find_package(LIBIGL REQUIRED)

# geogram
include(geogram)

# pymesh loaders
add_subdirectory(${TETWILD_EXTERNAL}/pymesh)

# CL11
add_subdirectory(${TETWILD_EXTERNAL}/CLI)
include(TetWildDependencies)

################################################################################
# TetWild
Expand Down Expand Up @@ -134,9 +123,10 @@ target_link_libraries(libTetWild
PUBLIC
geogram
igl::core
igl::cgal
pymesh::pymesh
spdlog::spdlog
PRIVATE
igl::cgal
)
set_target_properties(libTetWild PROPERTIES OUTPUT_NAME "tetwild")

Expand All @@ -150,10 +140,32 @@ endif()
# Building executable
add_executable(TetWild src/main.cpp)
target_link_libraries(TetWild
libTetWild
CLI11::CLI11
libTetWild
CLI11::CLI11
igl::cgal
)
target_include_directories(TetWild PRIVATE src)
igl_copy_cgal_dll(TetWild)

# Install
install(TARGETS TetWild RUNTIME DESTINATION bin)

################################################################################
# Folders for Visual Studio/XCode IDEs
################################################################################

# geogram
set_target_properties(geogram PROPERTIES FOLDER extern/geogram)
set_target_properties(geogram_third_party PROPERTIES FOLDER extern/geogram)
set_target_properties(uninstall PROPERTIES FOLDER extern/geogram)
# spdlog
set_target_properties(async_bench PROPERTIES FOLDER extern/spdlog)
set_target_properties(bench PROPERTIES FOLDER extern/spdlog)
set_target_properties(example PROPERTIES FOLDER extern/spdlog)
set_target_properties(latency PROPERTIES FOLDER extern/spdlog)
set_target_properties(multisink PROPERTIES FOLDER extern/spdlog)
set_target_properties(spdlog_headers_for_ide PROPERTIES FOLDER extern/spdlog)
set_target_properties(spdlog-utests PROPERTIES FOLDER extern/spdlog)
set_target_properties(multisink PROPERTIES FOLDER extern/spdlog)
# pymesh
set_target_properties(pymesh_tiny PROPERTIES FOLDER extern/pymesh)
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,15 @@ Here is pre-generated tetmeshes and the extracted surface meshes for research-pu

## Installation

Our code was originally developed on MacOS and has been tested on Lunix and Windows.
Our code was originally developed on MacOS and has been tested on Linux and Windows.

- Clone the repository into your local machine:

```bash
git clone https://github.com/Yixin-Hu/TetWild --recursive
git clone https://github.com/Yixin-Hu/TetWild
```

- For Windows users, a patch needs to be applied to the geogram library to avoid a link error:

```bash
git apply geogram_win.patch
```

- Compile the code using cmake (default in release mode):
- Compile the code using cmake (default in Release mode):

You need to install [CGAL](https://doc.cgal.org/latest/Manual/installation.html) before compiling the code.

Expand All @@ -53,6 +47,8 @@ cmake ..
make
```

💡 If you do not have Boost installed (which is need for CGAL), you can enable the cmake option `-DTETWILD_WITH_HUNTER=ON`. This will let CMake use [Hunter](https://github.com/ruslo/hunter) to download and configure Boost automatically. Other options include installing Boost via Conda, compile from source, etc.

💡 If you find `Could not find Matlab` or `Could not find Mosek` in the output of cmake, it does not matter since they are not used.

💡 We provide users an option to use [ISPC](https://ispc.github.io/index.html) for computing energy parallelly. It reduces the timimg for computing energy to 50% of the original, but it could result in more optimization iterations and more overall running time. According to our experiment on 1000 models, it reduces the overall running time by 4% in average. If you want to use ISPC, please [install it first](https://ispc.github.io/ispc.html#installing-ispc) and then turn on the flag `GTET_ISPC` in `CMakeLists.txt`.
Expand Down
2 changes: 0 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ install:
- cmd: conda.exe config --remove channels defaults
- cmd: conda.exe config --add channels defaults
- cmd: conda.exe config --add channels conda-forge
- cmd: git submodule update --init --recursive
- cmd: git apply geogram_win.patch

build: off

Expand Down
Loading

0 comments on commit fede85f

Please sign in to comment.