Merge branch 'pybind11_upgrade' into 'master'

Pybind11 upgrade - needs fsized-deallocation flag for clang

See merge request jschoeberl/netgen!209
This commit is contained in:
Christopher Lackner 2019-08-23 11:26:14 +00:00
commit 002d620b94
8 changed files with 13 additions and 11 deletions

View File

@ -198,7 +198,7 @@ build_mac:
-DUSE_NATIVE_ARCH=OFF -DUSE_NATIVE_ARCH=OFF
-DUSE_CCACHE=ON -DUSE_CCACHE=ON
-DENABLE_UNIT_TESTS=ON -DENABLE_UNIT_TESTS=ON
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.12
-DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
- make -j5 install - make -j5 install

@ -1 +1 @@
Subproject commit 2a150736601bb3113877bb673fb934bb60d46ec5 Subproject commit b9387195ef024f4b96f1cba68d30b0d5539e6bf9

View File

@ -10,6 +10,11 @@ add_library(ngcore SHARED
utils.cpp utils.cpp
) )
# Pybind11 2.3 Issue https://github.com/pybind/pybind11/issues/1604
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
target_compile_options(ngcore PUBLIC -fsized-deallocation -faligned-allocation)
endif()
if(USE_PYTHON) if(USE_PYTHON)
target_sources(ngcore PRIVATE python_ngcore.cpp) target_sources(ngcore PRIVATE python_ngcore.cpp)
endif(USE_PYTHON) endif(USE_PYTHON)

View File

@ -73,6 +73,7 @@ inline void operator delete[]( void* ptr, std::align_val_t al ) noexcept
else else
delete[] (char*)ptr; delete[] (char*)ptr;
} }
#endif // __MAC_OS_X_VERSION_MIN_REQUIRED #endif // __MAC_OS_X_VERSION_MIN_REQUIRED
#endif // __MAC_OS_X_VERSION_MIN_REQUIRED < 101300 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED < 101300

View File

@ -1,10 +1,6 @@
#include <pybind11/pybind11.h>
#include "python_ngcore.hpp"
#include "array.hpp"
#include "flags.hpp"
#include "logging.hpp" #include "logging.hpp"
#include "python_ngcore.hpp"
namespace py = pybind11; namespace py = pybind11;
using std::string; using std::string;

View File

@ -1,6 +1,7 @@
#ifndef NETGEN_CORE_PYTHON_NGCORE_HPP #ifndef NETGEN_CORE_PYTHON_NGCORE_HPP
#define NETGEN_CORE_PYTHON_NGCORE_HPP #define NETGEN_CORE_PYTHON_NGCORE_HPP
#include "ngcore_api.hpp" // for operator new
#include <pybind11/pybind11.h> #include <pybind11/pybind11.h>
#include "array.hpp" #include "array.hpp"

View File

@ -1,13 +1,13 @@
#ifdef NG_PYTHON #ifdef NG_PYTHON
#include <pybind11/pybind11.h> #include <core/python_ngcore.hpp>
#include <pybind11/operators.h> #include <pybind11/operators.h>
#include <pybind11/numpy.h> #include <pybind11/numpy.h>
#include <pybind11/stl.h> #include <pybind11/stl.h>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <core/python_ngcore.hpp>
using namespace ngcore; using namespace ngcore;
template <typename T> template <typename T>

View File

@ -1,9 +1,8 @@
#ifndef NETGEN_MESHING_PYTHON_MESH_HPP #ifndef NETGEN_MESHING_PYTHON_MESH_HPP
#define NETGEN_MESHING_PYTHON_MESH_HPP #define NETGEN_MESHING_PYTHON_MESH_HPP
#include <pybind11/pybind11.h>
#include <core/python_ngcore.hpp> #include <core/python_ngcore.hpp>
#include "meshing.hpp" #include "meshing.hpp"
namespace netgen namespace netgen