fix build warnings (#2355)

* fix build warnings

* cython fixes

* cleanup transformations build

* little more
pull/2356/head
Adeeb Shihadeh 5 years ago committed by GitHub
parent 6b020241c9
commit 96b637737b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      SConstruct
  2. 1
      common/clock.pyx
  3. 6
      common/common_pyx_setup.py
  4. 2
      common/kalman/simple_kalman_impl.pxd
  5. 3
      common/kalman/simple_kalman_setup.py
  6. 2
      common/params_pyx.pyx
  7. 32
      common/transformations/setup.py
  8. 1
      common/transformations/transformations.pxd
  9. 2
      selfdrive/common/params.cc
  10. 5
      selfdrive/common/util.c

@ -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,
),
)

@ -1,3 +1,5 @@
# cython: language_level = 3
cdef class KF1D:
cdef public:
double x0_0

@ -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,32 +1,8 @@
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',
@ -36,7 +12,9 @@ setup(
"transformations",
sources=["transformations.pyx"],
language="c++",
extra_compile_args=["-std=c++14", "-Wno-nullability-completeness"],
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":

@ -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;
}

@ -5,12 +5,15 @@
#include <unistd.h>
#include <fcntl.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…
Cancel
Save