Skip to content

Commit e3dd4e1

Browse files
committed
Fix compile error on Clang 18, tweak for better type generation
1 parent 30c789d commit e3dd4e1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

gtsam/inference/Factor.h

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <boost/serialization/nvp.hpp>
2626
#endif
2727
#include <memory>
28+
#include <algorithm>
2829

2930
#include <gtsam/base/types.h>
3031
#include <gtsam/base/FastVector.h>

python/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ if(GTSAM_UNSTABLE_BUILD_PYTHON)
257257
COMMAND
258258
${CMAKE_COMMAND} -E env
259259
"PYTHONPATH=${GTSAM_PYTHON_BUILD_DIRECTORY}/$ENV{PYTHONPATH}"
260-
pybind11-stubgen -o . --enum-class-locations \"KernelFunctionType|NoiseFormat:gtsam.gtsam\" --enum-class-locations \"OrderingType:gtsam.gtsam.Ordering\" gtsam_unstable
260+
pybind11-stubgen -o . --enum-class-locations \"KernelFunctionType|NoiseFormat:gtsam.gtsam\" --enum-class-locations \"OrderingType:gtsam.gtsam.Ordering\" --numpy-array-use-type-var gtsam_unstable
261261
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES} ${GTSAM_PYTHON_TEST_FILES} ${GTSAM_PYTHON_UNSTABLE_TARGET}
262262
WORKING_DIRECTORY "${GTSAM_PYTHON_BUILD_DIRECTORY}/"
263263
)
@@ -284,7 +284,7 @@ add_custom_target(
284284
COMMAND
285285
${CMAKE_COMMAND} -E env
286286
"PYTHONPATH=${GTSAM_PYTHON_BUILD_DIRECTORY}/$ENV{PYTHONPATH}"
287-
pybind11-stubgen -o . --enum-class-locations \"KernelFunctionType|NoiseFormat:gtsam.gtsam\" --enum-class-locations \"OrderingType:gtsam.gtsam.Ordering\" gtsam
287+
pybind11-stubgen -o . --enum-class-locations \"KernelFunctionType|NoiseFormat:gtsam.gtsam\" --enum-class-locations \"OrderingType:gtsam.gtsam.Ordering\" --numpy-array-use-type-var gtsam
288288
DEPENDS ${GTSAM_PYTHON_DEPENDENCIES} ${GTSAM_PYTHON_TEST_FILES} ${GTSAM_PYTHON_TARGET}
289289
WORKING_DIRECTORY "${GTSAM_PYTHON_BUILD_DIRECTORY}/"
290290
)

python/gtsam/gtsam.tpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ namespace py = pybind11;
3939
{module_def} {{
4040
m_.doc() = "pybind11 wrapper of {module_name}";
4141
42+
// Specializations for STL classes
43+
#include "python/gtsam/specializations/{module_name}.h"
44+
4245
{submodules_init}
4346

4447
{wrapped_namespace}
4548

46-
// Specializations for STL classes
47-
#include "python/gtsam/specializations/{module_name}.h"
48-
4949
}}
5050

0 commit comments

Comments
 (0)