Skip to content

Commit

Permalink
Fixed pybind11 compilation on Arch and eliminated all warning with gc…
Browse files Browse the repository at this point in the history
…c 6.4.1
  • Loading branch information
yuanming-hu committed Nov 13, 2017
1 parent 2d59dcd commit f2a1f41
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cmake/PythonNumpyPybind11.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ message(" numpy include: ${PYTHON_NUMPY_INCLUDE_DIR}")
include_directories(${PYTHON_NUMPY_INCLUDE_DIR})

execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
"import sys; import pybind11; sys.stdout.write(pybind11.get_include())"
"import sys; import pybind11; sys.stdout.write(pybind11.get_include(True))"
OUTPUT_VARIABLE PYBIND11_INCLUDE_DIR
RESULT_VARIABLE PYBIND11_IMPORT_RET)
if (NOT PYBIND11_IMPORT_RET)
Expand Down
3 changes: 3 additions & 0 deletions external/include/stb_image.h
Original file line number Diff line number Diff line change
Expand Up @@ -4677,6 +4677,8 @@ static void stbi__de_iphone(stbi__png *z)

#define STBI__PNG_TYPE(a,b,c,d) (((a) << 24) + ((b) << 16) + ((c) << 8) + (d))

int stb_trash_bin = -1;

static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
{
stbi_uc palette[1024], pal_img_n=0;
Expand Down Expand Up @@ -4834,6 +4836,7 @@ static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
#ifndef STBI_NO_FAILURE_STRINGS
// not threadsafe
static char invalid_chunk[] = "XXXX PNG chunk not known";
stb_trash_bin = (int)invalid_chunk[2];
invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
invalid_chunk[2] = STBI__BYTECAST(c.type >> 8);
Expand Down
7 changes: 7 additions & 0 deletions include/taichi/math/qr_svd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
the MIT license as written in the LICENSE file.
*******************************************************************************/

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
#include <implicit_qr_svd/Tools.h>
#include <implicit_qr_svd/ImplicitQRSVD.h>
#include <Eigen/Dense>
#pragma GCC diagnostic pop
#include "qr_svd.h"

//#define TC_USE_EIGEN_SVD
Expand Down Expand Up @@ -78,6 +81,9 @@ void ensure_non_negative_singular_values(Matrix3 &u, Matrix3 &s) {
}
}


#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
// m can not be const here, otherwise JIXIE::singularValueDecomposition will
// cause a error due to const_cast
void imp_svd(Matrix2 m, Matrix2 &u, Matrix2 &s, Matrix2 &v) {
Expand All @@ -93,6 +99,7 @@ void imp_svd(Matrix2 m, Matrix2 &u, Matrix2 &s, Matrix2 &v) {
s[1][1] = s_tmp[0];
}
}
#pragma GCC diagnostic pop

void imp_svd(Matrix3 m, Matrix3 &u, Matrix3 &s, Matrix3 &v) {
Eigen::Matrix<real, 3, 3> M, U, V;
Expand Down
6 changes: 1 addition & 5 deletions src/python/export.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
TC_NAMESPACE_BEGIN

PYBIND11_MODULE(taichi_core, m) {
m.doc() = "taichi_core", R"pbdoc(
Taichi Core Library
-----------------------
.. currentmodule:: taichi_core
)pbdoc";
m.doc() = "taichi_core";

for (auto &kv : InterfaceHolder::get_instance()->methods) {
kv.second(&m);
Expand Down

0 comments on commit f2a1f41

Please sign in to comment.