Skip to content

Commit

Permalink
Fixed macos conda-build and pypi upload
Browse files Browse the repository at this point in the history
- update libigl to 2.3.0
- add skipdownload external igl
- update external.tar.gz
- update macosx_sdk to 10.15
  • Loading branch information
nodtem66 committed Mar 14, 2021
1 parent 355ac8d commit 20c4d60
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 39 deletions.
1 change: 0 additions & 1 deletion .azure-pipelines/azure-pipelines-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
export CI=azure
export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME
export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME})
brew install libomp
./.scripts/run_osx_build.sh
displayName: Run OSX build
env:
Expand Down
2 changes: 1 addition & 1 deletion .ci_support/osx_64.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MACOSX_DEPLOYMENT_TARGET:
- '10.9'
- '10.15'
channel_sources:
- conda-forge
- defaults
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
submodules: true

- name: Install libomp for macos
- name: Install libomp (macOS)
if: matrix.os == 'macos-latest'
run: brew install libomp

Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
out
out*
build*
.vs
CMakeSettings.json
diplib/lib
main_sources.cmake
python_sources.cmake
external/
external*/
scripts/external.tar.gz
*.pyc
build_artifacts
*.pyc
2 changes: 1 addition & 1 deletion .scripts/run_osx_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ make_build_number ./ ./recipe ./.ci_support/${CONFIG}.yaml

conda build ./recipe -m ./.ci_support/${CONFIG}.yaml --suppress-variables --clobber-file ./.ci_support/clobber_${CONFIG}.yaml ${EXTRA_CB_OPTIONS:-}

if [[ "${UPLOAD_PACKAGES}" != "False" ]]; then
if [[ "${UPLOAD_PACKAGES}" -ne 'False' ]]; then
echo -e "\n\nUploading the packages."
upload_package ./ ./recipe ./.ci_support/${CONFIG}.yaml
fi
92 changes: 85 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,20 @@ if(MSVC)
# Enable parallel compilation for Visual Studio
add_compile_options(/MP /bigobj /D_CRT_SECURE_NO_WARNINGS /Zc:__cplusplus)
add_definitions(-DNOMINMAX -D_USE_MATH_DEFINES -DWIN32_LEAN_AND_MEAN)
# Silencing some compile warnings
add_compile_options(
# Type conversion warnings. These can be fixed with some effort and possibly more verbose code.
/wd4267 # conversion from 'size_t' to 'type', possible loss of data
/wd4244 # conversion from 'type1' to 'type2', possible loss of data
/wd4018 # signed/unsigned mismatch
/wd4305 # truncation from 'double' to 'float'
# This one is from template instantiations generated by autoexplicit.sh:
/wd4667 # no function template defined that matches forced instantiation ()
# This one is easy to fix, just need to switch to safe version of C functions
/wd4996 # this function or variable may be unsafe
# This one is when using bools in adjacency matrices
/wd4804 #'+=': unsafe use of type 'bool' in operation
)
endif()

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
Expand All @@ -30,8 +44,35 @@ message(STATUS "CMAKE SYSTEM NAME: ${CMAKE_SYSTEM_NAME}")

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
message(STATUS "[OSX Detected]")
add_definitions(-D_DARWIN_C_SOURCE -D_GNU_SOURCE)
add_definitions(-D_DARWIN_C_SOURCE -D_GNU_SOURCE -D_XOPEN_SOURCE=600)
add_compile_options(-faligned-allocation)
#[[
find_program(brew brew)
if(brew)
execute_process(COMMAND "${brew}" --prefix
RESULT_VARIABLE brew_f
OUTPUT_VARIABLE brew_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(brew_f EQUAL 0)
list(APPEND CMAKE_MODULE_PATH ${brew_prefix}/share/cmake/Modules)
message(STATUS "Brew: ${brew} --prefix => ${brew_prefix}")
endif()
execute_process(COMMAND "${brew}" --prefix eigen
RESULT_VARIABLE brew_f
OUTPUT_VARIABLE brew_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
if(brew_f EQUAL 0)
message(STATUS "Brew: ${brew} --prefix eigen => ${brew_prefix}")
set(ENV{EIGEN3_ROOT_DIR} "${brew_prefix}")
set(ENV{Eigen3_ROOT} "${brew_prefix}")
endif()
endif()
]]
endif()

if(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
Expand All @@ -49,7 +90,7 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/libigl/CMakeLists.txt" OR
download_external_files(
https://github.com/nodtem66/Scaffolder/releases/download/v1.5.1/external.tar.gz
"${PROJECT_SOURCE_DIR}/scripts/external.tar.gz"
30b7a0a4ad0a0830bab3fe9fc8405eb0a6cd93efd38a3791e7182703590a102a
bdfbd6d7a5643fca1fe7ca1db24d1fa1e3971e0b1d18a7225db1fdd94859f05d
)
file(ARCHIVE_EXTRACT INPUT "${PROJECT_SOURCE_DIR}/scripts/external.tar.gz" DESTINATION ${PROJECT_SOURCE_DIR})
endif()
Expand Down Expand Up @@ -96,11 +137,32 @@ if(BUILD_SCAFFOLDER)

# Build binary
add_executable(${PROJECT_NAME} ${MAIN_SOURCES} ${PROJECT_SOURCE_DIR}/src/Main.cpp)
target_include_directories(${PROJECT_NAME} PRIVATE "${PROJECT_SOURCE_DIR}/include" ${TBB_INCLUDE_DIR} ${VCG_INCLUDE_DIR} ${EIGEN_INCLUDE_DIR} ${SOL2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${OpenCTM_INCLUDE_DIR} "${OpenCTM_INCLUDE_DIR}/liblzma/")
target_link_libraries(${PROJECT_NAME} PRIVATE igl::core tbb Threads::Threads OpenMP::OpenMP_CXX ${LUA_LIBRARIES})
target_include_directories(${PROJECT_NAME} PRIVATE
"${PROJECT_SOURCE_DIR}/include"
${TBB_INCLUDE_DIR}
${VCG_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${SOL2_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
${OpenCTM_INCLUDE_DIR}
"${OpenCTM_INCLUDE_DIR}/liblzma/"
)
target_link_libraries(${PROJECT_NAME} PRIVATE
igl::core
tbb
Threads::Threads
OpenMP::OpenMP_CXX
${LUA_LIBRARIES}
)

add_executable("${PROJECT_NAME}.SliceTest" ${MAIN_SOURCES} ${PROJECT_SOURCE_DIR}/src/SliceTest.cpp)
target_include_directories("${PROJECT_NAME}.SliceTest" PRIVATE "${PROJECT_SOURCE_DIR}/include" ${VCG_INCLUDE_DIR} ${EIGEN_INCLUDE_DIR} ${OpenCTM_INCLUDE_DIR} "${OpenCTM_INCLUDE_DIR}/liblzma/")
target_include_directories("${PROJECT_NAME}.SliceTest" PRIVATE
"${PROJECT_SOURCE_DIR}/include"
${VCG_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${OpenCTM_INCLUDE_DIR}
"${OpenCTM_INCLUDE_DIR}/liblzma/"
)
target_link_libraries("${PROJECT_NAME}.SliceTest" PRIVATE tbb OpenMP::OpenMP_CXX)

# Install binary
Expand All @@ -122,8 +184,24 @@ if(BUILD_PYSCAFFOLDER)
update_deps_file("python_sources" "${PYTHON_SOURCES}")

pybind11_add_module("Py${PROJECT_NAME}" ${PYTHON_SOURCES})
target_include_directories("Py${PROJECT_NAME}" PRIVATE "${PROJECT_SOURCE_DIR}/include" ${TBB_INCLUDE_DIR} ${VCG_INCLUDE_DIR} ${EIGEN_INCLUDE_DIR} ${SOL2_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${PyBind11_INCLUDE_DIR} ${OpenCTM_INCLUDE_DIR} "${OpenCTM_INCLUDE_DIR}/liblzma/")
target_link_libraries("Py${PROJECT_NAME}" PRIVATE igl::core tbb Threads::Threads OpenMP::OpenMP_CXX ${LUA_LIBRARIES})
target_include_directories("Py${PROJECT_NAME}" PRIVATE
"${PROJECT_SOURCE_DIR}/include"
${TBB_INCLUDE_DIR}
${VCG_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${SOL2_INCLUDE_DIR}
${LUA_INCLUDE_DIR}
${PyBind11_INCLUDE_DIR}
${OpenCTM_INCLUDE_DIR}
"${OpenCTM_INCLUDE_DIR}/liblzma/"
)
target_link_libraries("Py${PROJECT_NAME}" PRIVATE
igl::core
tbb
Threads::Threads
OpenMP::OpenMP_CXX
${LUA_LIBRARIES}
)
include(GNUInstallDirs)
install(TARGETS "Py${PROJECT_NAME}"
COMPONENT python
Expand Down
13 changes: 0 additions & 13 deletions LICENSE.txt

This file was deleted.

10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Scaffolder
![Build Status](https://github.com/nodtem66/Scaffolder/workflows/Build/badge.svg) [![Build Status](https://dev.azure.com/n66/Public%20CI/_apis/build/status/nodtem66.Scaffolder?branchName=conda-forge)](https://dev.azure.com/n66/Public%20CI/_build/latest?definitionId=1&branchName=conda-forge)
![Build Status](https://github.com/nodtem66/Scaffolder/workflows/Build/badge.svg) [![Build Status](https://dev.azure.com/n66/PublicCI/_apis/build/status/nodtem66.Scaffolder%20(Anaconda)?branchName=master)](https://dev.azure.com/n66/PublicCI/_build/latest?definitionId=6&branchName=master)

[![Anaconda](https://anaconda.org/nodtem66/scaffolder/badges/version.svg)](https://anaconda.org/nodtem66/scaffolder) ![Last update](https://anaconda.org/nodtem66/scaffolder/badges/latest_release_date.svg) ![Platform](https://anaconda.org/nodtem66/scaffolder/badges/platforms.svg) ![Install](https://anaconda.org/nodtem66/scaffolder/badges/installer/conda.svg)

Expand Down Expand Up @@ -116,16 +116,18 @@ pip install PyScaffolder
- **Window**: The addon zip can be downloaded at [Release](https://github.com/nodtem66/Scaffolder/releases/tag/v1.5.1)
- Otherwise, create a "Scaffolder" folder in blender scripts direction
- Copy all files in blender folder of this project to that path
- Since blender did not ship with pip, the [PyScaffolder wheel](https://pypi.org/manage/project/PyScaffolder/release/1.5.1/) must be downloaded and unpacked at that path
- Since blender did not ship with pip, the [PyScaffolder wheel](https://pypi.org/manage/project/PyScaffolder) must be downloaded and unpacked at that path

## Screenshots

- **Blender plugin with PyScaffolder**

![Blender plugin](https://github.com/nodtem66/Scaffolder/raw/master/images/blender-plugin.gif)

- **The figure of patterns implemented in this program**

![TPMS Patterns](https://github.com/nodtem66/Scaffolder/raw/master/images/patterns.jpg)

- Blender plugin with PyScaffolder
![Blender plugin](https://github.com/nodtem66/Scaffolder/raw/master/images/blender-plugin.gif)

- **The examples of generated porous scaffold**

Expand Down
11 changes: 8 additions & 3 deletions cmake/FindLIBIGL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ mark_as_advanced(LIBIGL_INCLUDE_DIR)
set(LIBIGL_WITH_OPENGL OFF CACHE INTERNAL "turn off OPENGL in LIBIGL")
set(LIBIGL_WITH_OPENGL_GLFW OFF CACHE INTERNAL "turn off OPENGL GLFW in LIBIGL")
set(LIBIGL_USE_STATIC_LIBRARY OFF CACHE INTERNAL "prefer STATIC build")
set(LIBIGL_SKIP_DOWNLOAD ON CACHE INTERNAL "Skip download libigl")
# set(HUNTER_ENABLED ON CACHE INTERNAL "Enable Hunter package manager support")

list(APPEND CMAKE_MODULE_PATH "${LIBIGL_INCLUDE_DIR}/../cmake")
message(STATUS "USE DIR: ${LIBIGL_INCLUDE_DIR}")
set(EIGEN_INCLUDE_DIR "${LIBIGL_INCLUDE_DIR}/../external/eigen")
include(libigl)
list(APPEND CMAKE_MODULE_PATH "${LIBIGL_INCLUDE_DIR}/../cmake")
if (NOT EIGEN3_INCLUDE_DIR)
set(EIGEN3_INCLUDE_DIR "${LIBIGL_INCLUDE_DIR}/../external/eigen")
endif()
include(libigl)
message(STATUS "Eigen DIR: ${EIGEN3_INCLUDE_DIR}")
2 changes: 1 addition & 1 deletion cmake/FindVCG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (VCG_INCLUDE_DIR AND LIBIGL_INCLUDE_DIR)
file(READ "${VCG_INCLUDE_DIR}/eigenlib/eigen_version.txt" eigen_version)
endif()
if (NOT eigen_version STREQUAL LIBIGL_EIGEN_VERSION)
file(COPY "${LIBIGL_EXTERNAL}/eigen/Eigen" "${LIBIGL_EXTERNAL}/eigen/unsupported" DESTINATION "${VCG_INCLUDE_DIR}/eigenlib/")
file(COPY "${EIGEN3_INCLUDE_DIR}/Eigen" "${EIGEN3_INCLUDE_DIR}/unsupported" DESTINATION "${VCG_INCLUDE_DIR}/eigenlib/")
file(WRITE "${VCG_INCLUDE_DIR}/eigenlib/eigen_version.txt" "${LIBIGL_EIGEN_VERSION}")
endif()
endif()
1 change: 1 addition & 0 deletions recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cmake -G Ninja ^
-DCMAKE_INSTALL_PREFIX:PATH="%PREFIX%" ^
-DCMAKE_BUILD_TYPE:STRING=Release ^
-DCMAKE_CXX_STANDARD=11 ^
-DBUILD_PYSCAFFOLDER:BOOL=OFF ^
-S . -B build
if errorlevel 1 goto DEBUG

Expand Down
17 changes: 16 additions & 1 deletion recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
#!/bin/bash
set -eu
set +e
set -u

### Create Makefiles
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=11 \
-DBUILD_PYSCAFFOLDER:BOOL=OFF \
-S . -B build
EXITCODE=$?
if [[ $EXITCODE -ne 0 ]]; then
[[ -f ${SRC_DIR}/build/CMakeFiles/CMakeOutput.log ]] && cat ${SRC_DIR}/build/CMakeFiles/CMakeOutput.log
[[ -f ${SRC_DIR}/build/CMakeFiles/CMakeError.log ]] && cat ${SRC_DIR}/build/CMakeFiles/CMakeError.log
exit $EXITCODE
fi

### Build
cmake --build build -- -j${CPU_COUNT}
EXITCODE=$?
if [[ $EXITCODE -ne 0 ]]; then
[[ -f ${SRC_DIR}/build/CMakeFiles/CMakeOutput.log ]] && cat ${SRC_DIR}/build/CMakeFiles/CMakeOutput.log
[[ -f ${SRC_DIR}/build/CMakeFiles/CMakeError.log ]] && cat ${SRC_DIR}/build/CMakeFiles/CMakeError.log
exit $EXITCODE
fi
set -e

### Install
cmake --install build --component scaffolder
Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ requirements:
- {{ compiler('cxx') }}
- cmake
- ninja
- llvm-openmp # [osx]
- pkg-config # [unix]
host:
- vc # [win]
Expand Down
2 changes: 1 addition & 1 deletion scripts/tar_external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ ! -e external.tar.gz ]; then
--exclude=external/vcglib/apps \
--exclude=external/libigl/tutorial \
--exclude=external/libigl/tests \
--exclude=external/libigl/external \
--exclude=external/libigl/external/.cache \
--exclude=external/pybind11/docs \
--exclude=external/OpenCTM-1.0.3/tools \
--exclude=external/OpenCTM-1.0.3/plugins \
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def build_extension(self, ext):
# logic and declaration, and simpler if you include description/version in a file.
setup(
name="PyScaffolder",
version="1.5.1",
version="1.5.1.dev1",
author="Jirawat Iamsamang",
author_email="nodtem66@gmail.com",
description="Python wrapper for scaffolder program",
Expand Down

0 comments on commit 20c4d60

Please sign in to comment.