From fd0c6ac8d022aa9d660601ed10d0bf54ecae2648 Mon Sep 17 00:00:00 2001 From: Zhongshi Jiang Date: Fri, 3 Aug 2018 15:43:17 -0700 Subject: [PATCH 01/11] :snake: introduce setup.py and update .travis.yml Former-commit-id: 5eada092e54f7ca2c932656642af1c8f75eaef33 --- .gitignore | 1 + .travis.yml | 14 +++----- python/setup.py | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 python/setup.py diff --git a/.gitignore b/.gitignore index 6eaa0c512..425b38e00 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,4 @@ tutorial/cmake-build-debug .vscode/ .idea/ site/ +*.egg-info/ diff --git a/.travis.yml b/.travis.yml index 4be93d046..072e8bffc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,11 +10,8 @@ matrix: - mkdir external/glfw/include/GL - wget --no-check-certificate -P external/glfw/include/GL http://www.opengl.org/registry/api/GL/glcorearb.h - cd python - - mkdir build - - cd build - - cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON ../ - - make -j 2 - - cd ../tutorial + - python3 setup.py develop + - cd tutorial - python3 101_FileIO.py || { cd ../; mkdir build2; cd build2; cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON - DCHECK_UNDEFINED=ON ../; make -j 2; } - cd ../../ - cd tutorial @@ -53,11 +50,8 @@ matrix: # - brew upgrade cgal - git submodule update --init --recursive - cd python - - mkdir build - - cd build - - cmake ../ - - make -j 2 - - cd ../tutorial + - python setup.py develop + - cd tutorial - python 101_FileIO.py - cd ../../ - cd tutorial diff --git a/python/setup.py b/python/setup.py new file mode 100644 index 000000000..62d84eb46 --- /dev/null +++ b/python/setup.py @@ -0,0 +1,85 @@ +import os +import re +import sys +import platform +import subprocess + +from setuptools import setup, Extension +from setuptools.command.build_ext import build_ext +from distutils.version import LooseVersion +from distutils.sysconfig import get_config_var +from distutils.sysconfig import get_python_inc + + +class CMakeExtension(Extension): + + def __init__(self, name, sourcedir=''): + Extension.__init__(self, name, sources=[]) + self.sourcedir = os.path.abspath(sourcedir) + + +class CMakeBuild(build_ext): + + def run(self): + try: + out = subprocess.check_output(['cmake', '--version']) + except OSError: + raise RuntimeError("CMake must be installed to build the following extensions: " + + ", ".join(e.name for e in self.extensions)) + + if platform.system() == "Windows": + cmake_version = LooseVersion( + re.search(r'version\s*([\d.]+)', out.decode()).group(1)) + if cmake_version < '3.1.0': + raise RuntimeError("CMake >= 3.1.0 is required on Windows") + + for ext in self.extensions: + self.build_extension(ext) + + def build_extension(self, ext): + extdir = os.path.abspath(os.path.dirname( + self.get_ext_fullpath(ext.name))) + + python_library = str(get_config_var('LIBDIR')) + python_include_directory = str(get_python_inc()) + + cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, + '-DPYTHON_EXECUTABLE=' + sys.executable, + '-DPYTHON_LIBRARY=' + python_library, + '-DPYTHON_INCLUDE_DIR=' + python_include_directory, ] + + cfg = 'Debug' if self.debug else 'Release' + build_args = ['--config', cfg] + + if platform.system() == "Windows": + cmake_args += [ + '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format(cfg.upper(), extdir)] + if sys.maxsize > 2**32: + cmake_args += ['-A', 'x64'] + build_args += ['--', '/m'] + else: + cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg] + build_args += ['--', '-j2'] + + env = os.environ.copy() + env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''), + self.distribution.get_version()) + if not os.path.exists(self.build_temp): + os.makedirs(self.build_temp) + + subprocess.check_call(['cmake', ext.sourcedir] + + cmake_args, cwd=self.build_temp, env=env) + subprocess.check_call(['cmake', '--build', '.'] + + build_args, cwd=self.build_temp) + +setup( + name='pyigl', + version='0.0.1', + author='Geometric Computing Lab @ NYU', + author_email='info@geometriccomputing.org', + description='', + long_description='', + ext_modules=[CMakeExtension('pyigl')], + cmdclass=dict(build_ext=CMakeBuild), + zip_safe=False, +) From 480cd4f123eb2e45f1d4435d0586044c9fb40d90 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Fri, 3 Aug 2018 16:07:02 -0700 Subject: [PATCH 02/11] :penguin: :snake: :green_heart: Cl w/ setup.py .travis from #832 Former-commit-id: f4d367af9d5cc09c0c5c937dd5f02ea7385006ef --- .travis.yml | 126 ++++++++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 58 deletions(-) diff --git a/.travis.yml b/.travis.yml index 072e8bffc..3d573356e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,61 +1,71 @@ +dist: trusty +sudo: true language: cpp -sudo: false -dist: precise +cache: ccache matrix: include: - - os: linux - compiler: gcc-4.8.1 - script: - - git submodule update --init --recursive - - mkdir external/glfw/include/GL - - wget --no-check-certificate -P external/glfw/include/GL http://www.opengl.org/registry/api/GL/glcorearb.h - - cd python - - python3 setup.py develop - - cd tutorial - - python3 101_FileIO.py || { cd ../; mkdir build2; cd build2; cmake -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON - DCHECK_UNDEFINED=ON ../; make -j 2; } - - cd ../../ - - cd tutorial - - mkdir build - - cd build - - cmake -DLIBIGL_USE_STATIC_LIBRARY=ON -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 -DLIBIGL_WITH_EMBREE=OFF ../ - - make -j 2 - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - george-edison55-precise-backports - packages: - - xorg-dev - - libglu1-mesa-dev - - g++-4.8 - - cmake - - cmake-data - - libblas-dev - - liblapack-dev - # - binutils - # - libx11-dev - # - mesa-common-dev - # - libgl1-mesa-dev - # - libglu1-mesa-dev - # - libxrandr-dev - # - libxi-dev - # - libxmu-dev - # - libblas-dev - # - xorg-dev - - os: osx - compiler: clang - script: - # - brew update - # - brew upgrade cmake - # - brew upgrade cgal - - git submodule update --init --recursive - - cd python - - python setup.py develop - - cd tutorial - - python 101_FileIO.py - - cd ../../ - - cd tutorial - - mkdir build - - cd build - - cmake -DLIBIGL_USE_STATIC_LIBRARY=ON ../ - - make -j 2 + - os: linux + compiler: gcc # 4.8.4 by default on Trusty + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - libmpfr-dev + - libboost-filesystem-dev + - libboost-system-dev + - libboost-thread-dev + - libblas-dev + - liblapack-dev + - xorg-dev + - libglu1-mesa-dev + - python3-setuptools + env: + - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python3" + - os: linux + compiler: gcc-7 + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-7 + - g++-7 + - libmpfr-dev + - libboost-filesystem-dev + - libboost-system-dev + - libboost-thread-dev + - libblas-dev + - liblapack-dev + - xorg-dev + - libglu1-mesa-dev + - python3-setuptools + env: + - MATRIX_EVAL="export CC=gcc-7 && CXX=g++-7 && CONFIG=Debug && CHECK_UNDEFINED=OFF && PYTHON=python3" + - os: osx + compiler: clang + env: + - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=OFF && PYTHON=python" + +install: +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi +- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export PATH="/usr/local/opt/ccache/libexec:$PATH"; fi +- eval "${MATRIX_EVAL}" +- ccache --max-size=5.0G +- ccache -V && ccache --show-stats && ccache --zero-stats + +script: +# Python bindings +- cd python +- ${PYTHON} setup.py develop --user +- cd tutorial +- ${PYTHON} 101_FileIO.py +- cd ../../ +- rm -rf python/build +# Tutorials +- cd tutorial +- mkdir build +- cd build +- cmake -DCMAKE_BUILD_TYPE=$CONFIG -DLIBIGL_USE_STATIC_LIBRARY=ON ../ +- make -j 2 +- ccache --show-stats From b5495219402149be1869c0ac042b41de6dac8478 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 15:50:43 -0700 Subject: [PATCH 03/11] :snake: pass additional arguments to setup.py Former-commit-id: 78e15a30f342ec0e1994e4c323af5b4a8672faa4 --- python/setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/setup.py b/python/setup.py index 62d84eb46..7e145fb80 100644 --- a/python/setup.py +++ b/python/setup.py @@ -10,6 +10,11 @@ from distutils.version import LooseVersion from distutils.sysconfig import get_config_var from distutils.sysconfig import get_python_inc +CMAKE_ADDITIONAL_OPT = [] +if '--' in sys.argv: + i = sys.argv.index('--') + CMAKE_ADDITIONAL_OPT = sys.argv[i+1:] + sys.argv = sys.argv[:i] class CMakeExtension(Extension): @@ -60,6 +65,7 @@ class CMakeBuild(build_ext): else: cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg] build_args += ['--', '-j2'] + cmake_args += CMAKE_ADDITIONAL_OPT env = os.environ.copy() env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format(env.get('CXXFLAGS', ''), From d7517e2359db344549845324bfbb160068d1ce88 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 16:28:08 -0700 Subject: [PATCH 04/11] :green_heart: :snake: Add template instantiations for python Former-commit-id: 958c735f5fed7307c473d404315f7d1129b5346a --- include/igl/AABB.cpp | 1 + include/igl/copyleft/tetgen/tetrahedralize.cpp | 1 + include/igl/exact_geodesic.cpp.REMOVED.git-id | 2 +- include/igl/matrix_to_list.cpp | 1 + include/igl/ray_box_intersect.cpp | 4 ++++ include/igl/ray_mesh_intersect.cpp | 2 ++ 6 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/igl/AABB.cpp b/include/igl/AABB.cpp index aa9e9231b..095373354 100644 --- a/include/igl/AABB.cpp +++ b/include/igl/AABB.cpp @@ -1071,4 +1071,5 @@ template void igl::AABB, 3>::init, 2>::init >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); template double igl::AABB, 3>::squared_distance >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, double, int&, Eigen::PlainObjectBase >&) const; +template bool igl::AABB, 3>::intersect_ray >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::Matrix const&, Eigen::Matrix const&, igl::Hit&) const; #endif diff --git a/include/igl/copyleft/tetgen/tetrahedralize.cpp b/include/igl/copyleft/tetgen/tetrahedralize.cpp index 8ef851b66..ef24a7bb4 100644 --- a/include/igl/copyleft/tetgen/tetrahedralize.cpp +++ b/include/igl/copyleft/tetgen/tetrahedralize.cpp @@ -216,4 +216,5 @@ IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( // Explicit template instantiation template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template int igl::copyleft::tetgen::tetrahedralize,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(const Eigen::PlainObjectBase > &,const Eigen::PlainObjectBase > &,const Eigen::PlainObjectBase > &,const Eigen::PlainObjectBase > &,const std::basic_string, std::allocator >,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &); +template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::__cxx11::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif diff --git a/include/igl/exact_geodesic.cpp.REMOVED.git-id b/include/igl/exact_geodesic.cpp.REMOVED.git-id index 8391e3a64..91072d0dd 100644 --- a/include/igl/exact_geodesic.cpp.REMOVED.git-id +++ b/include/igl/exact_geodesic.cpp.REMOVED.git-id @@ -1 +1 @@ -0ffa8b0392da9471a2fd26ec71effd909d4a75f3 \ No newline at end of file +e20783b88c3cc89c874b97023ebfa0fc3ceb0377 \ No newline at end of file diff --git a/include/igl/matrix_to_list.cpp b/include/igl/matrix_to_list.cpp index c3a74144d..1c30dff91 100644 --- a/include/igl/matrix_to_list.cpp +++ b/include/igl/matrix_to_list.cpp @@ -75,4 +75,5 @@ template void igl::matrix_to_list >(Eigen::D template void igl::matrix_to_list >(Eigen::DenseBase > const&, std::vector::Scalar, std::allocator::Scalar> >, std::allocator::Scalar, std::allocator::Scalar> > > >&); template void igl::matrix_to_list >(Eigen::DenseBase > const&, std::vector::Scalar, std::allocator::Scalar> >&); template void igl::matrix_to_list >(Eigen::DenseBase > const&, std::vector::Scalar, std::allocator::Scalar> >&); +template std::vector::Scalar, std::allocator::Scalar> > igl::matrix_to_list >(Eigen::DenseBase > const&); #endif diff --git a/include/igl/ray_box_intersect.cpp b/include/igl/ray_box_intersect.cpp index e7ca33ae2..8c6346d86 100644 --- a/include/igl/ray_box_intersect.cpp +++ b/include/igl/ray_box_intersect.cpp @@ -143,3 +143,7 @@ IGL_INLINE bool igl::ray_box_intersect( return true; #endif } + +#ifdef IGL_STATIC_LIBRARY +template bool igl::ray_box_intersect, Eigen::Matrix, double>(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::AlignedBox const&, double const&, double const&, double&, double&); +#endif \ No newline at end of file diff --git a/include/igl/ray_mesh_intersect.cpp b/include/igl/ray_mesh_intersect.cpp index f2b917774..512a35c46 100644 --- a/include/igl/ray_mesh_intersect.cpp +++ b/include/igl/ray_mesh_intersect.cpp @@ -81,4 +81,6 @@ IGL_INLINE bool igl::ray_mesh_intersect( #ifdef IGL_STATIC_LIBRARY // Explicit template instantiation template bool igl::ray_mesh_intersect, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, std::vector >&); +template bool igl::ray_mesh_intersect, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, igl::Hit&); +template bool igl::ray_mesh_intersect, Eigen::Matrix, Eigen::Matrix, Eigen::Block const, 1, -1, false> >(Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase const, 1, -1, false> > const&, igl::Hit&); #endif From 324ebdf91e42238b389d7605d28eaa78e203cd82 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 16:29:45 -0700 Subject: [PATCH 05/11] :green_heart: add cmake option to cl Former-commit-id: c098d6dc8990220082d30490137ee09139a5fe22 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3d573356e..44e886a22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,7 +57,7 @@ install: script: # Python bindings - cd python -- ${PYTHON} setup.py develop --user +- ${PYTHON} setup.py develop --user -- -DCMAKE_BUILD_TYPE=${CONFIG} -DLIBIGL_WITH_EMBREE=OFF -DLIBIGL_USE_STATIC_LIBRARY=ON -DCHECK_UNDEFINED=${CHECK_UNDEFINED} - cd tutorial - ${PYTHON} 101_FileIO.py - cd ../../ From e598f8041f9c9c250d60c48428a2ad42deb10c76 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 17:01:49 -0700 Subject: [PATCH 06/11] :green_heart: remove std:: __cxx11 Former-commit-id: 9dd0b0b263402aaa9fda00c8e2c4ffc9dcf837db --- include/igl/copyleft/tetgen/tetrahedralize.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/igl/copyleft/tetgen/tetrahedralize.cpp b/include/igl/copyleft/tetgen/tetrahedralize.cpp index ef24a7bb4..fa6111410 100644 --- a/include/igl/copyleft/tetgen/tetrahedralize.cpp +++ b/include/igl/copyleft/tetgen/tetrahedralize.cpp @@ -216,5 +216,5 @@ IGL_INLINE int igl::copyleft::tetgen::tetrahedralize( // Explicit template instantiation template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); template int igl::copyleft::tetgen::tetrahedralize,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix,Eigen::Matrix >(const Eigen::PlainObjectBase > &,const Eigen::PlainObjectBase > &,const Eigen::PlainObjectBase > &,const Eigen::PlainObjectBase > &,const std::basic_string, std::allocator >,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &,Eigen::PlainObjectBase > &, Eigen::PlainObjectBase > &); -template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::__cxx11::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); +template int igl::copyleft::tetgen::tetrahedralize, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix, Eigen::Matrix >(Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, Eigen::PlainObjectBase > const&, std::basic_string, std::allocator >, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&, Eigen::PlainObjectBase >&); #endif From ee962d3ad529117afedc9e9327d2fcaf20d731fa Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 17:18:35 -0700 Subject: [PATCH 07/11] :penguin: :green_heart: check_undefined=OFF Former-commit-id: d41edfa0c8c924b957797884e2fdbdf7137a015b --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 44e886a22..6e46872ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,7 +21,7 @@ matrix: - libglu1-mesa-dev - python3-setuptools env: - - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python3" + - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=OFF && PYTHON=python3" - os: linux compiler: gcc-7 addons: From 16eec254e00d2edb38a34ed94a35ef106337438f Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 18:30:18 -0700 Subject: [PATCH 08/11] :green_heart: toggle check_undefined ON Former-commit-id: 6f160c66ef393874da68c3d38a306ec1e7434711 --- .travis.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e46872ef..b74862785 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,9 @@ matrix: - xorg-dev - libglu1-mesa-dev - python3-setuptools + - libpython3-dev env: - - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=OFF && PYTHON=python3" + - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python3" - os: linux compiler: gcc-7 addons: @@ -40,12 +41,13 @@ matrix: - xorg-dev - libglu1-mesa-dev - python3-setuptools + - libpython3-dev env: - - MATRIX_EVAL="export CC=gcc-7 && CXX=g++-7 && CONFIG=Debug && CHECK_UNDEFINED=OFF && PYTHON=python3" + - MATRIX_EVAL="export CC=gcc-7 && CXX=g++-7 && CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python3" - os: osx compiler: clang env: - - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=OFF && PYTHON=python" + - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python" install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi From b38b232b21629c36937c3ca7304cd64c14d0ab88 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 18:49:37 -0700 Subject: [PATCH 09/11] :green_heart: :snake: :apple: use python3 for osx Former-commit-id: 242f286b20a2b25c2a1be9267eb1aab7e3ea8e0d --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b74862785..aadb59cb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ matrix: - os: osx compiler: clang env: - - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python" + - MATRIX_EVAL="export CONFIG=Debug && CHECK_UNDEFINED=ON && PYTHON=python3" install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi From c5ce69a9e0d7dec90067be5ea28a170282d40696 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 18:51:08 -0700 Subject: [PATCH 10/11] :snake: switch find pythoninterp and pythonlibs https://cmake.org/cmake/help/latest/module/FindPythonLibs.html Former-commit-id: fe35eb05eead4f16cc5e0bdac6af96f89d736b69 --- python/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 31ef6058a..19ea3da1f 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -10,8 +10,9 @@ project(pyigl) # set(PYTHON_INCLUDE_DIR "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m") set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6) -find_package(PythonLibs REQUIRED) find_package(PythonInterp REQUIRED) +find_package(PythonLibs REQUIRED) + string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE) if(UNIX) From 241d83aa154c20474e6149defb7013c00e8ab4e6 Mon Sep 17 00:00:00 2001 From: Zhongshi Date: Sat, 4 Aug 2018 20:16:40 -0700 Subject: [PATCH 11/11] Remove manual set lib Former-commit-id: dd657f3cf0c216fc094219169bbdb9707b5b4e39 --- python/setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/setup.py b/python/setup.py index 7e145fb80..21ef19d4c 100644 --- a/python/setup.py +++ b/python/setup.py @@ -50,7 +50,6 @@ class CMakeBuild(build_ext): cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, '-DPYTHON_EXECUTABLE=' + sys.executable, - '-DPYTHON_LIBRARY=' + python_library, '-DPYTHON_INCLUDE_DIR=' + python_include_directory, ] cfg = 'Debug' if self.debug else 'Release'