fix build warnings (#2355)
* fix build warnings * cython fixes * cleanup transformations build * little morealbatross
parent
6b020241c9
commit
96b637737b
|
@ -202,6 +202,7 @@ if arch in ["x86_64", "Darwin", "larch64"]:
|
|||
]
|
||||
qt_env["LINKFLAGS"] += ["-F" + QT_BASE + "lib"]
|
||||
else:
|
||||
qt_env['QTDIR'] = "/usr"
|
||||
qt_dirs = [
|
||||
f"/usr/include/{real_arch}-linux-gnu/qt5",
|
||||
f"/usr/include/{real_arch}-linux-gnu/qt5/QtWidgets",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# cython: language_level = 3
|
||||
from posix.time cimport clock_gettime, timespec, CLOCK_MONOTONIC_RAW, clockid_t
|
||||
|
||||
IF UNAME_SYSNAME == "Darwin":
|
||||
|
|
|
@ -4,9 +4,9 @@ from Cython.Build import cythonize
|
|||
from common.cython_hacks import BuildExtWithoutPlatformSuffix
|
||||
|
||||
sourcefiles = ['clock.pyx']
|
||||
extra_compile_args = ["-std=c++11", "-Wno-nullability-completeness"]
|
||||
extra_compile_args = ["-std=c++14"]
|
||||
|
||||
setup(name='Common',
|
||||
setup(name='common',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(
|
||||
Extension(
|
||||
|
@ -14,7 +14,7 @@ setup(name='Common',
|
|||
language="c++",
|
||||
sources=sourcefiles,
|
||||
extra_compile_args=extra_compile_args,
|
||||
)
|
||||
),
|
||||
nthreads=4,
|
||||
),
|
||||
nthreads=4,
|
||||
)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# cython: language_level = 3
|
||||
|
||||
cdef class KF1D:
|
||||
cdef public:
|
||||
double x0_0
|
||||
|
@ -13,4 +15,4 @@ cdef class KF1D:
|
|||
double A_K_0
|
||||
double A_K_1
|
||||
double A_K_2
|
||||
double A_K_3
|
||||
double A_K_3
|
||||
|
|
|
@ -7,5 +7,4 @@ from common.cython_hacks import BuildExtWithoutPlatformSuffix
|
|||
setup(name='Simple Kalman Implementation',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(Extension("simple_kalman_impl",
|
||||
["simple_kalman_impl.pyx"],
|
||||
extra_compile_args=["-Wno-nullability-completeness"])))
|
||||
["simple_kalman_impl.pyx"])))
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# distutils: langauge = c++
|
||||
# distutils: language = c++
|
||||
# cython: language_level = 3
|
||||
from libcpp cimport bool
|
||||
from libcpp.string cimport string
|
||||
|
|
|
@ -1,42 +1,20 @@
|
|||
import os
|
||||
import numpy
|
||||
import sysconfig
|
||||
|
||||
from Cython.Build import cythonize
|
||||
from Cython.Distutils import build_ext
|
||||
from distutils.core import Extension, setup # pylint: disable=import-error,no-name-in-module
|
||||
|
||||
def get_ext_filename_without_platform_suffix(filename):
|
||||
name, ext = os.path.splitext(filename)
|
||||
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
|
||||
|
||||
if ext_suffix == ext:
|
||||
return filename
|
||||
|
||||
ext_suffix = ext_suffix.replace(ext, '')
|
||||
idx = name.find(ext_suffix)
|
||||
|
||||
if idx == -1:
|
||||
return filename
|
||||
else:
|
||||
return name[:idx] + ext
|
||||
|
||||
|
||||
class BuildExtWithoutPlatformSuffix(build_ext):
|
||||
def get_ext_filename(self, ext_name):
|
||||
filename = super().get_ext_filename(ext_name)
|
||||
return get_ext_filename_without_platform_suffix(filename)
|
||||
|
||||
from common.cython_hacks import BuildExtWithoutPlatformSuffix
|
||||
|
||||
setup(
|
||||
name='Cython transformations wrapper',
|
||||
cmdclass={'build_ext': BuildExtWithoutPlatformSuffix},
|
||||
ext_modules=cythonize(
|
||||
Extension(
|
||||
"transformations",
|
||||
sources=["transformations.pyx"],
|
||||
language="c++",
|
||||
extra_compile_args=["-std=c++14", "-Wno-nullability-completeness"],
|
||||
include_dirs=[numpy.get_include()],
|
||||
Extension(
|
||||
"transformations",
|
||||
sources=["transformations.pyx"],
|
||||
language="c++",
|
||||
extra_compile_args=["-std=c++14", "-Wno-cpp"],
|
||||
include_dirs=[numpy.get_include()],
|
||||
),
|
||||
nthreads=4,
|
||||
)
|
||||
))
|
||||
)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#cython: language_level=3
|
||||
from libcpp cimport bool
|
||||
|
||||
cdef extern from "orientation.cc":
|
||||
|
|
|
@ -26,7 +26,7 @@ cdef np.ndarray[double, ndim=2] matrix2numpy(Matrix3 m):
|
|||
[m(2, 0), m(2, 1), m(2, 2)],
|
||||
])
|
||||
|
||||
cdef Matrix3 numpy2matrix (np.ndarray[double, ndim=2, mode="fortran"] m):
|
||||
cdef Matrix3 numpy2matrix(np.ndarray[double, ndim=2, mode="fortran"] m):
|
||||
assert m.shape[0] == 3
|
||||
assert m.shape[1] == 3
|
||||
return Matrix3(<double*>m.data)
|
||||
|
|
|
@ -173,7 +173,7 @@ int Params::write_db_value(const char* key, const char* value, size_t value_size
|
|||
tmp_path = params_path + "/.tmp_value_XXXXXX";
|
||||
tmp_fd = mkstemp((char*)tmp_path.c_str());
|
||||
bytes_written = write(tmp_fd, value, value_size);
|
||||
if (bytes_written != value_size) {
|
||||
if (bytes_written < 0 || (size_t)bytes_written != value_size) {
|
||||
result = -20;
|
||||
goto cleanup;
|
||||
}
|
||||
|
|
|
@ -4,13 +4,16 @@
|
|||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/syscall.h>
|
||||
#ifndef __USE_GNU
|
||||
#define __USE_GNU
|
||||
#include <sched.h>
|
||||
#endif
|
||||
#include <sched.h>
|
||||
#endif // __linux__
|
||||
|
||||
void* read_file(const char* path, size_t* out_len) {
|
||||
FILE* f = fopen(path, "r");
|
||||
|
|
Loading…
Reference in New Issue