can successfully compile openmvg into project.

This commit is contained in:
Jordan 2024-03-11 07:36:09 -07:00
parent e3f9413566
commit b3cd0316b7
20 changed files with 5049 additions and 158 deletions

View File

@ -21,6 +21,9 @@ migration:
- platform: ios
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
- platform: linux
create_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
base_revision: 7482962148e8d758338d8a28f589f317e1e42ba4
# User provided section

View File

@ -90,3 +90,35 @@ For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
# Developer Notes
You'll get an error with Eiger, so watch out.
```
$ make
finition.hpp:17:10: fatal error: Eigen/Dense: No such file or directory
17 | #include <Eigen/Dense>
| ^~~~~~~~~~~~~
compilation terminated.
```
```shell
$ sudo at install -y libeigen3-dev
$ sudo ln -sf /usr/include/eigen3/Eigen /usr/include/Eigen
```
git clone --single-branch --branch n6.1 https://git.ffmpeg.org/ffmpeg.git
Can I expose `FILE` in dart?
Yea...no! https://github.com/dart-lang/sdk/issues/4160
Instead, I'll have to load the data in directly.
buliding open mvg needs to be done with the PIC flag
```shell
$ cmake ../src -DCMAKE_INSTALL_PREFIX="../../openMVG/build/_install" -DCMAKE_POSITION_INDEPENDENT_CODE=ON
```

4180
archimedes_mobile_lib.dart Normal file
View File

@ -0,0 +1,4180 @@
// AUTO GENERATED FILE, DO NOT EDIT.
//
// Generated by `package:ffigen`.
// ignore_for_file: type=lint
import 'dart:ffi' as ffi;
final class __mbstate_t extends ffi.Struct {
@ffi.Int()
external int __count;
external UnnamedUnion1 __value;
}
final class UnnamedUnion1 extends ffi.Union {
@ffi.UnsignedInt()
external int __wch;
@ffi.Array.multi([4])
external ffi.Array<ffi.Char> __wchb;
}
final class _IO_FILE extends ffi.Struct {
@ffi.Int()
external int _flags;
external ffi.Pointer<ffi.Char> _IO_read_ptr;
external ffi.Pointer<ffi.Char> _IO_read_end;
external ffi.Pointer<ffi.Char> _IO_read_base;
external ffi.Pointer<ffi.Char> _IO_write_base;
external ffi.Pointer<ffi.Char> _IO_write_ptr;
external ffi.Pointer<ffi.Char> _IO_write_end;
external ffi.Pointer<ffi.Char> _IO_buf_base;
external ffi.Pointer<ffi.Char> _IO_buf_end;
external ffi.Pointer<ffi.Char> _IO_save_base;
external ffi.Pointer<ffi.Char> _IO_backup_base;
external ffi.Pointer<ffi.Char> _IO_save_end;
external ffi.Pointer<_IO_marker> _markers;
external ffi.Pointer<_IO_FILE> _chain;
@ffi.Int()
external int _fileno;
@ffi.Int()
external int _flags2;
@__off_t()
external int _old_offset;
@ffi.UnsignedShort()
external int _cur_column;
@ffi.SignedChar()
external int _vtable_offset;
@ffi.Array.multi([1])
external ffi.Array<ffi.Char> _shortbuf;
external ffi.Pointer<_IO_lock_t> _lock;
@__off64_t()
external int _offset;
external ffi.Pointer<_IO_codecvt> _codecvt;
external ffi.Pointer<_IO_wide_data> _wide_data;
external ffi.Pointer<_IO_FILE> _freeres_list;
external ffi.Pointer<ffi.Void> _freeres_buf;
@ffi.Size()
external int __pad5;
@ffi.Int()
external int _mode;
@ffi.Array.multi([20])
external ffi.Array<ffi.Char> _unused2;
}
final class _IO_marker extends ffi.Opaque {}
typedef __off_t = ffi.Long;
typedef _IO_lock_t = ffi.Void;
typedef __off64_t = ffi.Long;
final class _IO_codecvt extends ffi.Opaque {}
final class _IO_wide_data extends ffi.Opaque {}
final class max_align_t extends ffi.Opaque {}
final class sched_param extends ffi.Struct {
@ffi.Int()
external int sched_priority;
}
final class cpu_set_t extends ffi.Struct {
@ffi.Array.multi([16])
external ffi.Array<__cpu_mask> __bits;
}
typedef __cpu_mask = ffi.UnsignedLong;
final class timex extends ffi.Opaque {}
final class tm extends ffi.Struct {
@ffi.Int()
external int tm_sec;
@ffi.Int()
external int tm_min;
@ffi.Int()
external int tm_hour;
@ffi.Int()
external int tm_mday;
@ffi.Int()
external int tm_mon;
@ffi.Int()
external int tm_year;
@ffi.Int()
external int tm_wday;
@ffi.Int()
external int tm_yday;
@ffi.Int()
external int tm_isdst;
@ffi.Long()
external int tm_gmtoff;
external ffi.Pointer<ffi.Char> tm_zone;
}
final class itimerspec extends ffi.Struct {
external timespec it_interval;
external timespec it_value;
}
final class timespec extends ffi.Struct {
@__time_t()
external int tv_sec;
@__syscall_slong_t()
external int tv_nsec;
}
typedef __time_t = ffi.Long;
typedef __syscall_slong_t = ffi.Long;
final class sigevent extends ffi.Opaque {}
final class __jmp_buf_tag extends ffi.Struct {
@ffi.Array.multi([8])
external ffi.Array<ffi.Long> __jmpbuf;
@ffi.Int()
external int __mask_was_saved;
external __sigset_t __saved_mask;
}
final class __sigset_t extends ffi.Struct {
@ffi.Array.multi([16])
external ffi.Array<ffi.UnsignedLong> __val;
}
final class _pthread_cleanup_buffer extends ffi.Struct {
external ffi
.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
__routine;
external ffi.Pointer<ffi.Void> __arg;
@ffi.Int()
external int __canceltype;
external ffi.Pointer<_pthread_cleanup_buffer> __prev;
}
final class _Frame extends ffi.Struct {
external ffi.Pointer<FILE> stream;
@ffi.Int()
external int w;
@ffi.Int()
external int h;
@ffi.Int()
external int depth;
}
typedef FILE = _IO_FILE;
const int PTHREAD_CREATE_JOINABLE = 0;
const int PTHREAD_CREATE_DETACHED = 1;
const int PTHREAD_MUTEX_TIMED_NP = 0;
const int PTHREAD_MUTEX_RECURSIVE_NP = 1;
const int PTHREAD_MUTEX_ERRORCHECK_NP = 2;
const int PTHREAD_MUTEX_ADAPTIVE_NP = 3;
const int PTHREAD_MUTEX_NORMAL = 0;
const int PTHREAD_MUTEX_RECURSIVE = 1;
const int PTHREAD_MUTEX_ERRORCHECK = 2;
const int PTHREAD_MUTEX_DEFAULT = 0;
const int PTHREAD_MUTEX_FAST_NP = 0;
const int PTHREAD_MUTEX_STALLED = 0;
const int PTHREAD_MUTEX_STALLED_NP = 0;
const int PTHREAD_MUTEX_ROBUST = 1;
const int PTHREAD_MUTEX_ROBUST_NP = 1;
const int PTHREAD_PRIO_NONE = 0;
const int PTHREAD_PRIO_INHERIT = 1;
const int PTHREAD_PRIO_PROTECT = 2;
const int PTHREAD_RWLOCK_PREFER_READER_NP = 0;
const int PTHREAD_RWLOCK_PREFER_WRITER_NP = 1;
const int PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP = 2;
const int PTHREAD_RWLOCK_DEFAULT_NP = 0;
const int PTHREAD_INHERIT_SCHED = 0;
const int PTHREAD_EXPLICIT_SCHED = 1;
const int PTHREAD_SCOPE_SYSTEM = 0;
const int PTHREAD_SCOPE_PROCESS = 1;
const int PTHREAD_PROCESS_PRIVATE = 0;
const int PTHREAD_PROCESS_SHARED = 1;
const int PTHREAD_CANCEL_ENABLE = 0;
const int PTHREAD_CANCEL_DISABLE = 1;
const int PTHREAD_CANCEL_DEFERRED = 0;
const int PTHREAD_CANCEL_ASYNCHRONOUS = 1;
const int __ISwupper = 0;
const int __ISwlower = 1;
const int __ISwalpha = 2;
const int __ISwdigit = 3;
const int __ISwxdigit = 4;
const int __ISwspace = 5;
const int __ISwprint = 6;
const int __ISwgraph = 7;
const int __ISwblank = 8;
const int __ISwcntrl = 9;
const int __ISwpunct = 10;
const int __ISwalnum = 11;
const int _ISwupper = 16777216;
const int _ISwlower = 33554432;
const int _ISwalpha = 67108864;
const int _ISwdigit = 134217728;
const int _ISwxdigit = 268435456;
const int _ISwspace = 536870912;
const int _ISwprint = 1073741824;
const int _ISwgraph = -2147483648;
const int _ISwblank = 65536;
const int _ISwcntrl = 131072;
const int _ISwpunct = 262144;
const int _ISwalnum = 524288;
const int EIGEN_WORLD_VERSION = 3;
const int EIGEN_MAJOR_VERSION = 4;
const int EIGEN_MINOR_VERSION = 0;
const int EIGEN_DEFAULT_MATRIX_STORAGE_ORDER_OPTION = 0;
const int EIGEN_MAX_CPP_VER = 99;
const int EIGEN_FAST_MATH = 1;
const int EIGEN_STACK_ALLOCATION_LIMIT = 131072;
const int EIGEN_COMP_GNUC = 42;
const int EIGEN_COMP_CLANG = 1600;
const int EIGEN_COMP_CASTXML = 0;
const int EIGEN_COMP_LLVM = 1;
const int EIGEN_COMP_ICC = 0;
const int EIGEN_COMP_MINGW = 0;
const int EIGEN_COMP_SUNCC = 0;
const int EIGEN_COMP_MSVC = 0;
const int EIGEN_COMP_NVCC = 0;
const int EIGEN_COMP_MSVC_LANG = 0;
const int EIGEN_COMP_MSVC_STRICT = 0;
const int EIGEN_COMP_IBM = 0;
const int EIGEN_COMP_PGI = 0;
const int EIGEN_COMP_ARM = 0;
const int EIGEN_COMP_EMSCRIPTEN = 0;
const int EIGEN_COMP_GNUC_STRICT = 0;
const int EIGEN_GCC3_OR_OLDER = 0;
const int EIGEN_ARCH_x86_64 = 1;
const int EIGEN_ARCH_i386 = 0;
const int EIGEN_ARCH_i386_OR_x86_64 = 1;
const int EIGEN_ARCH_ARM = 0;
const int EIGEN_ARCH_ARM64 = 0;
const int EIGEN_ARCH_ARM_OR_ARM64 = 0;
const int EIGEN_ARCH_ARMV8 = 0;
const int EIGEN_ARCH_MIPS = 0;
const int EIGEN_ARCH_SPARC = 0;
const int EIGEN_ARCH_IA64 = 0;
const int EIGEN_ARCH_PPC = 0;
const int EIGEN_OS_UNIX = 1;
const int EIGEN_OS_LINUX = 1;
const int EIGEN_OS_ANDROID = 0;
const int EIGEN_OS_GNULINUX = 1;
const int EIGEN_OS_BSD = 0;
const int EIGEN_OS_MAC = 0;
const int EIGEN_OS_QNX = 0;
const int EIGEN_OS_WIN = 0;
const int EIGEN_OS_WIN64 = 0;
const int EIGEN_OS_WINCE = 0;
const int EIGEN_OS_CYGWIN = 0;
const int EIGEN_OS_WIN_STRICT = 0;
const int EIGEN_OS_SUN = 0;
const int EIGEN_OS_SOLARIS = 0;
const int EIGEN_CUDA_SDK_VER = 0;
const int EIGEN_SAFE_TO_USE_STANDARD_ASSERT_MACRO = 1;
const int EIGEN_HAS_STATIC_ARRAY_TEMPLATE = 1;
const int EIGEN_CPLUSPLUS = 201703;
const int EIGEN_COMP_CXXVER = 17;
const int EIGEN_HAS_CXX14_VARIABLE_TEMPLATES = 1;
const int EIGEN_HAS_CXX11 = 1;
const int EIGEN_HAS_CXX14 = 1;
const int EIGEN_HAS_RVALUE_REFERENCES = 1;
const int _REQUIRES_FREESTANDING_H = 1;
const int _GLIBCXX_CXX_CONFIG_H = 1;
const int _GLIBCXX_RELEASE = 13;
const int __GLIBCXX__ = 20230913;
const int _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY = 1;
const int _GLIBCXX_USE_DEPRECATED = 1;
const int _GLIBCXX_NOEXCEPT_QUAL = 1;
const int _GLIBCXX_EXTERN_TEMPLATE = 1;
const int _GLIBCXX_USE_DUAL_ABI = 1;
const int _GLIBCXX_USE_CXX11_ABI = 1;
const int _GLIBCXX_INLINE_VERSION = 0;
const int _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED = 1;
const int _GLIBCXX_VERBOSE_ASSERT = 1;
const int _GLIBCXX_USE_ALLOCATOR_NEW = 1;
const int _GLIBCXX_OS_DEFINES = 1;
const int __NO_CTYPE = 1;
const int _FEATURES_H = 1;
const int _ISOC95_SOURCE = 1;
const int _ISOC99_SOURCE = 1;
const int _ISOC11_SOURCE = 1;
const int _ISOC2X_SOURCE = 1;
const int _POSIX_SOURCE = 1;
const int _POSIX_C_SOURCE = 200809;
const int _XOPEN_SOURCE = 700;
const int _XOPEN_SOURCE_EXTENDED = 1;
const int _LARGEFILE64_SOURCE = 1;
const int _DEFAULT_SOURCE = 1;
const int _ATFILE_SOURCE = 1;
const int _DYNAMIC_STACK_SIZE_SOURCE = 1;
const int __GLIBC_USE_ISOC2X = 1;
const int __USE_ISOC11 = 1;
const int __USE_ISOC99 = 1;
const int __USE_ISOC95 = 1;
const int __USE_ISOCXX11 = 1;
const int __USE_POSIX = 1;
const int __USE_POSIX2 = 1;
const int __USE_POSIX199309 = 1;
const int __USE_POSIX199506 = 1;
const int __USE_XOPEN2K = 1;
const int __USE_XOPEN2K8 = 1;
const int __USE_XOPEN = 1;
const int __USE_XOPEN_EXTENDED = 1;
const int __USE_UNIX98 = 1;
const int _LARGEFILE_SOURCE = 1;
const int __USE_XOPEN2K8XSI = 1;
const int __USE_XOPEN2KXSI = 1;
const int __USE_LARGEFILE = 1;
const int __USE_LARGEFILE64 = 1;
const int __WORDSIZE = 64;
const int __WORDSIZE_TIME64_COMPAT32 = 1;
const int __SYSCALL_WORDSIZE = 64;
const int __TIMESIZE = 64;
const int __USE_MISC = 1;
const int __USE_ATFILE = 1;
const int __USE_DYNAMIC_STACK_SIZE = 1;
const int __USE_GNU = 1;
const int __USE_FORTIFY_LEVEL = 0;
const int __GLIBC_USE_DEPRECATED_GETS = 0;
const int __GLIBC_USE_DEPRECATED_SCANF = 0;
const int __GLIBC_USE_C2X_STRTOL = 1;
const int _STDC_PREDEF_H = 1;
const int __STDC_IEC_559__ = 1;
const int __STDC_IEC_60559_BFP__ = 201404;
const int __STDC_IEC_559_COMPLEX__ = 1;
const int __STDC_IEC_60559_COMPLEX__ = 201404;
const int __STDC_ISO_10646__ = 201706;
const int __GNU_LIBRARY__ = 6;
const int __GLIBC__ = 2;
const int __GLIBC_MINOR__ = 38;
const int _SYS_CDEFS_H = 1;
const int __THROW = 1;
const int __THROWNL = 1;
const int __glibc_c99_flexarr_available = 1;
const int __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI = 0;
const int __HAVE_GENERIC_SELECTION = 0;
const int _GLIBCXX_NO_OBSOLETE_ISINF_ISNAN_DYNAMIC = 1;
const int _GLIBCXX_HAVE_FLOAT128_MATH = 1;
const int _GLIBCXX_GTHREAD_USE_WEAK = 0;
const int _GLIBCXX_CPU_DEFINES = 1;
const int _GLIBCXX_USE_WEAK_REF = 1;
const int _GLIBCXX_USE_STD_SPEC_FUNCS = 1;
const int _GLIBCXX_FAST_MATH = 0;
const int _GLIBCXX_USE_C99_MATH = 1;
const int _GLIBCXX_USE_C99_COMPLEX = 1;
const int _GLIBCXX_USE_C99_STDIO = 1;
const int _GLIBCXX_USE_C99_STDLIB = 1;
const int _GLIBCXX_USE_C99_WCHAR = 1;
const int _GLIBCXX_USE_FLOAT128 = 1;
const int _GLIBCXX_FLOAT_IS_IEEE_BINARY32 = 1;
const int _GLIBCXX_DOUBLE_IS_IEEE_BINARY64 = 1;
const int _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP = 1;
const int _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE = 1;
const int _GLIBCXX_HAVE_BUILTIN_IS_SAME = 1;
const int _GLIBCXX_HAVE_BUILTIN_LAUNDER = 1;
const int _PSTL_VERSION = 12000;
const int _PSTL_VERSION_MAJOR = 12;
const int _PSTL_VERSION_MINOR = 0;
const int _PSTL_VERSION_PATCH = 0;
const int _PSTL_USAGE_WARNINGS = 0;
const int _PSTL_GCC_VERSION = 40201;
const int _PSTL_CLANG_VERSION = 160006;
const int _PSTL_UDR_PRESENT = 0;
const String _PSTL_PRAGMA_LOCATION = ' [Parallel STL message]: ';
const int _GLIBCXX_HAVE_ACOSF = 1;
const int _GLIBCXX_HAVE_ACOSL = 1;
const int _GLIBCXX_HAVE_ALIGNED_ALLOC = 1;
const int _GLIBCXX_HAVE_ARC4RANDOM = 1;
const int _GLIBCXX_HAVE_ARPA_INET_H = 1;
const int _GLIBCXX_HAVE_ASINF = 1;
const int _GLIBCXX_HAVE_ASINL = 1;
const int _GLIBCXX_HAVE_AS_SYMVER_DIRECTIVE = 1;
const int _GLIBCXX_HAVE_ATAN2F = 1;
const int _GLIBCXX_HAVE_ATAN2L = 1;
const int _GLIBCXX_HAVE_ATANF = 1;
const int _GLIBCXX_HAVE_ATANL = 1;
const int _GLIBCXX_HAVE_ATOMIC_LOCK_POLICY = 1;
const int _GLIBCXX_HAVE_AT_QUICK_EXIT = 1;
const int _GLIBCXX_HAVE_CEILF = 1;
const int _GLIBCXX_HAVE_CEILL = 1;
const int _GLIBCXX_HAVE_COMPLEX_H = 1;
const int _GLIBCXX_HAVE_COSF = 1;
const int _GLIBCXX_HAVE_COSHF = 1;
const int _GLIBCXX_HAVE_COSHL = 1;
const int _GLIBCXX_HAVE_COSL = 1;
const int _GLIBCXX_HAVE_DECL_STRNLEN = 1;
const int _GLIBCXX_HAVE_DIRENT_H = 1;
const int _GLIBCXX_HAVE_DIRFD = 1;
const int _GLIBCXX_HAVE_DLFCN_H = 1;
const int _GLIBCXX_HAVE_ENDIAN_H = 1;
const int _GLIBCXX_HAVE_EXCEPTION_PTR_SINCE_GCC46 = 1;
const int _GLIBCXX_HAVE_EXECINFO_H = 1;
const int _GLIBCXX_HAVE_EXPF = 1;
const int _GLIBCXX_HAVE_EXPL = 1;
const int _GLIBCXX_HAVE_FABSF = 1;
const int _GLIBCXX_HAVE_FABSL = 1;
const int _GLIBCXX_HAVE_FCNTL_H = 1;
const int _GLIBCXX_HAVE_FDOPENDIR = 1;
const int _GLIBCXX_HAVE_FENV_H = 1;
const int _GLIBCXX_HAVE_FINITE = 1;
const int _GLIBCXX_HAVE_FINITEF = 1;
const int _GLIBCXX_HAVE_FINITEL = 1;
const int _GLIBCXX_HAVE_FLOAT_H = 1;
const int _GLIBCXX_HAVE_FLOORF = 1;
const int _GLIBCXX_HAVE_FLOORL = 1;
const int _GLIBCXX_HAVE_FMODF = 1;
const int _GLIBCXX_HAVE_FMODL = 1;
const int _GLIBCXX_HAVE_FREXPF = 1;
const int _GLIBCXX_HAVE_FREXPL = 1;
const int _GLIBCXX_HAVE_GETENTROPY = 1;
const int _GLIBCXX_HAVE_GETIPINFO = 1;
const int _GLIBCXX_HAVE_GETS = 1;
const int _GLIBCXX_HAVE_HYPOT = 1;
const int _GLIBCXX_HAVE_HYPOTF = 1;
const int _GLIBCXX_HAVE_HYPOTL = 1;
const int _GLIBCXX_HAVE_ICONV = 1;
const int _GLIBCXX_HAVE_INTTYPES_H = 1;
const int _GLIBCXX_HAVE_ISINFF = 1;
const int _GLIBCXX_HAVE_ISINFL = 1;
const int _GLIBCXX_HAVE_ISNANF = 1;
const int _GLIBCXX_HAVE_ISNANL = 1;
const int _GLIBCXX_HAVE_ISWBLANK = 1;
const int _GLIBCXX_HAVE_LC_MESSAGES = 1;
const int _GLIBCXX_HAVE_LDEXPF = 1;
const int _GLIBCXX_HAVE_LDEXPL = 1;
const int _GLIBCXX_HAVE_LIBINTL_H = 1;
const int _GLIBCXX_HAVE_LIMIT_AS = 1;
const int _GLIBCXX_HAVE_LIMIT_DATA = 1;
const int _GLIBCXX_HAVE_LIMIT_FSIZE = 1;
const int _GLIBCXX_HAVE_LIMIT_RSS = 1;
const int _GLIBCXX_HAVE_LIMIT_VMEM = 0;
const int _GLIBCXX_HAVE_LINK = 1;
const int _GLIBCXX_HAVE_LINK_H = 1;
const int _GLIBCXX_HAVE_LINUX_FUTEX = 1;
const int _GLIBCXX_HAVE_LINUX_RANDOM_H = 1;
const int _GLIBCXX_HAVE_LINUX_TYPES_H = 1;
const int _GLIBCXX_HAVE_LOCALE_H = 1;
const int _GLIBCXX_HAVE_LOG10F = 1;
const int _GLIBCXX_HAVE_LOG10L = 1;
const int _GLIBCXX_HAVE_LOGF = 1;
const int _GLIBCXX_HAVE_LOGL = 1;
const int _GLIBCXX_HAVE_MBSTATE_T = 1;
const int _GLIBCXX_HAVE_MEMALIGN = 1;
const int _GLIBCXX_HAVE_MEMORY_H = 1;
const int _GLIBCXX_HAVE_MODF = 1;
const int _GLIBCXX_HAVE_MODFF = 1;
const int _GLIBCXX_HAVE_MODFL = 1;
const int _GLIBCXX_HAVE_NETDB_H = 1;
const int _GLIBCXX_HAVE_NETINET_IN_H = 1;
const int _GLIBCXX_HAVE_NETINET_TCP_H = 1;
const int _GLIBCXX_HAVE_OPENAT = 1;
const int _GLIBCXX_HAVE_POLL = 1;
const int _GLIBCXX_HAVE_POLL_H = 1;
const int _GLIBCXX_HAVE_POSIX_MEMALIGN = 1;
const int _GLIBCXX_HAVE_POSIX_SEMAPHORE = 1;
const int _GLIBCXX_HAVE_POWF = 1;
const int _GLIBCXX_HAVE_POWL = 1;
const int _GLIBCXX_HAVE_QUICK_EXIT = 1;
const int _GLIBCXX_HAVE_READLINK = 1;
const int _GLIBCXX_HAVE_SECURE_GETENV = 1;
const int _GLIBCXX_HAVE_SETENV = 1;
const int _GLIBCXX_HAVE_SINCOS = 1;
const int _GLIBCXX_HAVE_SINCOSF = 1;
const int _GLIBCXX_HAVE_SINCOSL = 1;
const int _GLIBCXX_HAVE_SINF = 1;
const int _GLIBCXX_HAVE_SINHF = 1;
const int _GLIBCXX_HAVE_SINHL = 1;
const int _GLIBCXX_HAVE_SINL = 1;
const int _GLIBCXX_HAVE_SOCKATMARK = 1;
const int _GLIBCXX_HAVE_SQRTF = 1;
const int _GLIBCXX_HAVE_SQRTL = 1;
const int _GLIBCXX_HAVE_STDALIGN_H = 1;
const int _GLIBCXX_HAVE_STDBOOL_H = 1;
const int _GLIBCXX_HAVE_STDINT_H = 1;
const int _GLIBCXX_HAVE_STDLIB_H = 1;
const int _GLIBCXX_HAVE_STRERROR_L = 1;
const int _GLIBCXX_HAVE_STRERROR_R = 1;
const int _GLIBCXX_HAVE_STRINGS_H = 1;
const int _GLIBCXX_HAVE_STRING_H = 1;
const int _GLIBCXX_HAVE_STRTOF = 1;
const int _GLIBCXX_HAVE_STRTOLD = 1;
const int _GLIBCXX_HAVE_STRUCT_DIRENT_D_TYPE = 1;
const int _GLIBCXX_HAVE_STRXFRM_L = 1;
const int _GLIBCXX_HAVE_SYMLINK = 1;
const int _GLIBCXX_HAVE_SYMVER_SYMBOL_RENAMING_RUNTIME_SUPPORT = 1;
const int _GLIBCXX_HAVE_SYS_IOCTL_H = 1;
const int _GLIBCXX_HAVE_SYS_IPC_H = 1;
const int _GLIBCXX_HAVE_SYS_PARAM_H = 1;
const int _GLIBCXX_HAVE_SYS_RESOURCE_H = 1;
const int _GLIBCXX_HAVE_SYS_SDT_H = 1;
const int _GLIBCXX_HAVE_SYS_SEM_H = 1;
const int _GLIBCXX_HAVE_SYS_SOCKET_H = 1;
const int _GLIBCXX_HAVE_SYS_STATVFS_H = 1;
const int _GLIBCXX_HAVE_SYS_STAT_H = 1;
const int _GLIBCXX_HAVE_SYS_SYSINFO_H = 1;
const int _GLIBCXX_HAVE_SYS_TIME_H = 1;
const int _GLIBCXX_HAVE_SYS_TYPES_H = 1;
const int _GLIBCXX_HAVE_SYS_UIO_H = 1;
const int _GLIBCXX_HAVE_S_ISREG = 1;
const int _GLIBCXX_HAVE_TANF = 1;
const int _GLIBCXX_HAVE_TANHF = 1;
const int _GLIBCXX_HAVE_TANHL = 1;
const int _GLIBCXX_HAVE_TANL = 1;
const int _GLIBCXX_HAVE_TGMATH_H = 1;
const int _GLIBCXX_HAVE_TIMESPEC_GET = 1;
const int _GLIBCXX_HAVE_TLS = 1;
const int _GLIBCXX_HAVE_TRUNCATE = 1;
const int _GLIBCXX_HAVE_UCHAR_H = 1;
const int _GLIBCXX_HAVE_UNISTD_H = 1;
const int _GLIBCXX_HAVE_UNLINKAT = 1;
const int _GLIBCXX_HAVE_USELOCALE = 1;
const int _GLIBCXX_HAVE_UTIME_H = 1;
const int _GLIBCXX_HAVE_VFWSCANF = 1;
const int _GLIBCXX_HAVE_VSWSCANF = 1;
const int _GLIBCXX_HAVE_VWSCANF = 1;
const int _GLIBCXX_HAVE_WCHAR_H = 1;
const int _GLIBCXX_HAVE_WCSTOF = 1;
const int _GLIBCXX_HAVE_WCTYPE_H = 1;
const int _GLIBCXX_HAVE_WRITEV = 1;
const int _GLIBCXX_HAVE___CXA_THREAD_ATEXIT_IMPL = 1;
const String _GLIBCXX_LT_OBJDIR = '.libs/';
const String _GLIBCXX_PACKAGE_BUGREPORT = '';
const String _GLIBCXX_PACKAGE_NAME = 'package-unused';
const String _GLIBCXX_PACKAGE_STRING = 'package-unused version-unused';
const String _GLIBCXX_PACKAGE_TARNAME = 'libstdc++';
const String _GLIBCXX_PACKAGE_URL = '';
const String _GLIBCXX_PACKAGE__GLIBCXX_VERSION = 'version-unused';
const int _GLIBCXX_STDC_HEADERS = 1;
const int _GLIBCXX_DARWIN_USE_64_BIT_INODE = 1;
const int _GLIBCXX11_USE_C99_COMPLEX = 1;
const int _GLIBCXX11_USE_C99_MATH = 1;
const int _GLIBCXX11_USE_C99_STDIO = 1;
const int _GLIBCXX11_USE_C99_STDLIB = 1;
const int _GLIBCXX11_USE_C99_WCHAR = 1;
const int _GLIBCXX98_USE_C99_COMPLEX = 1;
const int _GLIBCXX98_USE_C99_MATH = 1;
const int _GLIBCXX98_USE_C99_STDIO = 1;
const int _GLIBCXX98_USE_C99_STDLIB = 1;
const int _GLIBCXX98_USE_C99_WCHAR = 1;
const int _GLIBCXX_ATOMIC_BUILTINS = 1;
const int _GLIBCXX_CAN_ALIGNAS_DESTRUCTIVE_SIZE = 1;
const int _GLIBCXX_FULLY_DYNAMIC_STRING = 0;
const int _GLIBCXX_HAS_GTHREADS = 1;
const int _GLIBCXX_HOSTED = 1;
const int _GLIBCXX_RES_LIMITS = 1;
const int _GLIBCXX_STATIC_TZDATA = 1;
const int _GLIBCXX_STDIO_EOF = -1;
const int _GLIBCXX_STDIO_SEEK_CUR = 1;
const int _GLIBCXX_STDIO_SEEK_END = 2;
const int _GLIBCXX_SYMVER = 1;
const int _GLIBCXX_SYMVER_GNU = 1;
const int _GLIBCXX_USE_C11_UCHAR_CXX11 = 1;
const int _GLIBCXX_USE_C99 = 1;
const int _GLIBCXX_USE_C99_COMPLEX_TR1 = 1;
const int _GLIBCXX_USE_C99_CTYPE_TR1 = 1;
const int _GLIBCXX_USE_C99_FENV_TR1 = 1;
const int _GLIBCXX_USE_C99_INTTYPES_TR1 = 1;
const int _GLIBCXX_USE_C99_INTTYPES_WCHAR_T_TR1 = 1;
const int _GLIBCXX_USE_C99_MATH_TR1 = 1;
const int _GLIBCXX_USE_C99_STDINT_TR1 = 1;
const int _GLIBCXX_USE_CLOCK_MONOTONIC = 1;
const int _GLIBCXX_USE_CLOCK_REALTIME = 1;
const int _GLIBCXX_USE_DECIMAL_FLOAT = 1;
const int _GLIBCXX_USE_DEV_RANDOM = 1;
const int _GLIBCXX_USE_FCHMOD = 1;
const int _GLIBCXX_USE_FCHMODAT = 1;
const int _GLIBCXX_USE_FSEEKO_FTELLO = 1;
const int _GLIBCXX_USE_GETTIMEOFDAY = 1;
const int _GLIBCXX_USE_GET_NPROCS = 1;
const int _GLIBCXX_USE_INIT_PRIORITY_ATTRIBUTE = 1;
const int _GLIBCXX_USE_LFS = 1;
const int _GLIBCXX_USE_LONG_LONG = 1;
const int _GLIBCXX_USE_LSTAT = 1;
const int _GLIBCXX_USE_NANOSLEEP = 1;
const int _GLIBCXX_USE_NLS = 1;
const int _GLIBCXX_USE_PTHREAD_COND_CLOCKWAIT = 1;
const int _GLIBCXX_USE_PTHREAD_MUTEX_CLOCKLOCK = 1;
const int _GLIBCXX_USE_PTHREAD_RWLOCK_CLOCKLOCK = 1;
const int _GLIBCXX_USE_PTHREAD_RWLOCK_T = 1;
const int _GLIBCXX_USE_RANDOM_TR1 = 1;
const int _GLIBCXX_USE_REALPATH = 1;
const int _GLIBCXX_USE_SCHED_YIELD = 1;
const int _GLIBCXX_USE_SC_NPROCESSORS_ONLN = 1;
const int _GLIBCXX_USE_SENDFILE = 1;
const int _GLIBCXX_USE_ST_MTIM = 1;
const int _GLIBCXX_USE_TMPNAM = 1;
const int _GLIBCXX_USE_UCHAR_C8RTOMB_MBRTOC8_CXX20 = 1;
const int _GLIBCXX_USE_UCHAR_C8RTOMB_MBRTOC8_FCHAR8_T = 1;
const int _GLIBCXX_USE_UTIME = 1;
const int _GLIBCXX_USE_UTIMENSAT = 1;
const int _GLIBCXX_USE_WCHAR_T = 1;
const int _GLIBCXX_VERBOSE = 1;
const int _GLIBCXX_X86_RDRAND = 1;
const int _GLIBCXX_X86_RDSEED = 1;
const String _GLIBCXX_ZONEINFO_DIR = '/usr/share/zoneinfo';
const int _GTHREAD_USE_MUTEX_TIMEDLOCK = 1;
const int _CPP_TYPE_TRAITS_H = 1;
const int _EXT_TYPE_TRAITS = 1;
const int _MATH_H = 1;
const int __GLIBC_USE_LIB_EXT2 = 1;
const int __GLIBC_USE_IEC_60559_BFP_EXT = 1;
const int __GLIBC_USE_IEC_60559_BFP_EXT_C2X = 1;
const int __GLIBC_USE_IEC_60559_EXT = 1;
const int __GLIBC_USE_IEC_60559_FUNCS_EXT = 1;
const int __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X = 1;
const int __GLIBC_USE_IEC_60559_TYPES_EXT = 1;
const int _BITS_TYPES_H = 1;
const int _BITS_TYPESIZES_H = 1;
const int __OFF_T_MATCHES_OFF64_T = 1;
const int __INO_T_MATCHES_INO64_T = 1;
const int __RLIM_T_MATCHES_RLIM64_T = 1;
const int __STATFS_MATCHES_STATFS64 = 1;
const int __KERNEL_OLD_TIMEVAL_MATCHES_TIMEVAL64 = 1;
const int __FD_SETSIZE = 1024;
const int _BITS_TIME64_H = 1;
const int _BITS_LIBM_SIMD_DECL_STUBS_H = 1;
const int __HAVE_FLOAT128 = 0;
const int __HAVE_DISTINCT_FLOAT128 = 0;
const int __HAVE_FLOAT64X = 1;
const int __HAVE_FLOAT64X_LONG_DOUBLE = 1;
const int __HAVE_FLOAT16 = 0;
const int __HAVE_FLOAT32 = 1;
const int __HAVE_FLOAT64 = 1;
const int __HAVE_FLOAT32X = 1;
const int __HAVE_FLOAT128X = 0;
const int __HAVE_DISTINCT_FLOAT16 = 0;
const int __HAVE_DISTINCT_FLOAT32 = 0;
const int __HAVE_DISTINCT_FLOAT64 = 0;
const int __HAVE_DISTINCT_FLOAT32X = 0;
const int __HAVE_DISTINCT_FLOAT64X = 0;
const int __HAVE_DISTINCT_FLOAT128X = 0;
const int __HAVE_FLOAT128_UNLIKE_LDBL = 0;
const int __HAVE_FLOATN_NOT_TYPEDEF = 0;
const double HUGE_VAL = double.infinity;
const double HUGE_VALF = double.infinity;
const double HUGE_VALL = double.infinity;
const double HUGE_VAL_F32 = double.infinity;
const double HUGE_VAL_F64 = double.infinity;
const double HUGE_VAL_F32X = double.infinity;
const double HUGE_VAL_F64X = double.infinity;
const double INFINITY = double.infinity;
const double NAN = double.nan;
const double SNANF = double.nan;
const double SNAN = double.nan;
const double SNANL = double.nan;
const double SNANF32 = double.nan;
const double SNANF64 = double.nan;
const double SNANF32X = double.nan;
const double SNANF64X = double.nan;
const int __GLIBC_FLT_EVAL_METHOD = 0;
const int __FP_LOGB0_IS_MIN = 1;
const int __FP_LOGBNAN_IS_MIN = 1;
const int FP_ILOGB0 = -2147483648;
const int FP_ILOGBNAN = -2147483648;
const int __FP_LONG_MAX = 9223372036854775807;
const int FP_LLOGB0 = -9223372036854775808;
const int FP_LLOGBNAN = -9223372036854775808;
const int FP_INT_UPWARD = 0;
const int FP_INT_DOWNWARD = 1;
const int FP_INT_TOWARDZERO = 2;
const int FP_INT_TONEARESTFROMZERO = 3;
const int FP_INT_TONEAREST = 4;
const int __MATH_DECLARE_LDOUBLE = 1;
const int FP_NAN = 0;
const int FP_INFINITE = 1;
const int FP_ZERO = 2;
const int FP_SUBNORMAL = 3;
const int FP_NORMAL = 4;
const int MATH_ERRNO = 1;
const int MATH_ERREXCEPT = 2;
const int math_errhandling = 3;
const double MAXFLOAT = 3.4028234663852886e+38;
const double M_E = 2.718281828459045;
const double M_LOG2E = 1.4426950408889634;
const double M_LOG10E = 0.4342944819032518;
const double M_LN2 = 0.6931471805599453;
const double M_LN10 = 2.302585092994046;
const double M_PI = 3.141592653589793;
const double M_PI_2 = 1.5707963267948966;
const double M_PI_4 = 0.7853981633974483;
const double M_1_PI = 0.3183098861837907;
const double M_2_PI = 0.6366197723675814;
const double M_2_SQRTPI = 1.1283791670955126;
const double M_SQRT2 = 1.4142135623730951;
const double M_SQRT1_2 = 0.7071067811865476;
const double M_Ef = 2.7182817459106445;
const double M_LOG2Ef = 1.4426950216293335;
const double M_LOG10Ef = 0.4342944920063019;
const double M_LN2f = 0.6931471824645996;
const double M_LN10f = 2.3025851249694824;
const double M_PIf = 3.1415927410125732;
const double M_PI_2f = 1.5707963705062866;
const double M_PI_4f = 0.7853981852531433;
const double M_1_PIf = 0.31830987334251404;
const double M_2_PIf = 0.6366197466850281;
const double M_2_SQRTPIf = 1.128379225730896;
const double M_SQRT2f = 1.4142135381698608;
const double M_SQRT1_2f = 0.7071067690849304;
const double M_El = 2.718281828459045;
const double M_LOG2El = 1.4426950408889634;
const double M_LOG10El = 0.4342944819032518;
const double M_LN2l = 0.6931471805599453;
const double M_LN10l = 2.302585092994046;
const double M_PIl = 3.141592653589793;
const double M_PI_2l = 1.5707963267948966;
const double M_PI_4l = 0.7853981633974483;
const double M_1_PIl = 0.3183098861837907;
const double M_2_PIl = 0.6366197723675814;
const double M_2_SQRTPIl = 1.1283791670955126;
const double M_SQRT2l = 1.4142135623730951;
const double M_SQRT1_2l = 0.7071067811865476;
const double M_Ef32 = 2.7182817459106445;
const double M_LOG2Ef32 = 1.4426950216293335;
const double M_LOG10Ef32 = 0.4342944920063019;
const double M_LN2f32 = 0.6931471824645996;
const double M_LN10f32 = 2.3025851249694824;
const double M_PIf32 = 3.1415927410125732;
const double M_PI_2f32 = 1.5707963705062866;
const double M_PI_4f32 = 0.7853981852531433;
const double M_1_PIf32 = 0.31830987334251404;
const double M_2_PIf32 = 0.6366197466850281;
const double M_2_SQRTPIf32 = 1.128379225730896;
const double M_SQRT2f32 = 1.4142135381698608;
const double M_SQRT1_2f32 = 0.7071067690849304;
const double M_Ef64 = 2.718281828459045;
const double M_LOG2Ef64 = 1.4426950408889634;
const double M_LOG10Ef64 = 0.4342944819032518;
const double M_LN2f64 = 0.6931471805599453;
const double M_LN10f64 = 2.302585092994046;
const double M_PIf64 = 3.141592653589793;
const double M_PI_2f64 = 1.5707963267948966;
const double M_PI_4f64 = 0.7853981633974483;
const double M_1_PIf64 = 0.3183098861837907;
const double M_2_PIf64 = 0.6366197723675814;
const double M_2_SQRTPIf64 = 1.1283791670955126;
const double M_SQRT2f64 = 1.4142135623730951;
const double M_SQRT1_2f64 = 0.7071067811865476;
const double M_Ef32x = 2.718281828459045;
const double M_LOG2Ef32x = 1.4426950408889634;
const double M_LOG10Ef32x = 0.4342944819032518;
const double M_LN2f32x = 0.6931471805599453;
const double M_LN10f32x = 2.302585092994046;
const double M_PIf32x = 3.141592653589793;
const double M_PI_2f32x = 1.5707963267948966;
const double M_PI_4f32x = 0.7853981633974483;
const double M_1_PIf32x = 0.3183098861837907;
const double M_2_PIf32x = 0.6366197723675814;
const double M_2_SQRTPIf32x = 1.1283791670955126;
const double M_SQRT2f32x = 1.4142135623730951;
const double M_SQRT1_2f32x = 0.7071067811865476;
const double M_Ef64x = 2.718281828459045;
const double M_LOG2Ef64x = 1.4426950408889634;
const double M_LOG10Ef64x = 0.4342944819032518;
const double M_LN2f64x = 0.6931471805599453;
const double M_LN10f64x = 2.302585092994046;
const double M_PIf64x = 3.141592653589793;
const double M_PI_2f64x = 1.5707963267948966;
const double M_PI_4f64x = 0.7853981633974483;
const double M_1_PIf64x = 0.3183098861837907;
const double M_2_PIf64x = 0.6366197723675814;
const double M_2_SQRTPIf64x = 1.1283791670955126;
const double M_SQRT2f64x = 1.4142135623730951;
const double M_SQRT1_2f64x = 0.7071067811865476;
const int NULL = 0;
const int _STDLIB_H = 1;
const int WNOHANG = 1;
const int WUNTRACED = 2;
const int WSTOPPED = 2;
const int WEXITED = 4;
const int WCONTINUED = 8;
const int WNOWAIT = 16777216;
const int __WNOTHREAD = 536870912;
const int __WALL = 1073741824;
const int __WCLONE = 2147483648;
const int __W_CONTINUED = 65535;
const int __WCOREFLAG = 128;
const int __ldiv_t_defined = 1;
const int __lldiv_t_defined = 1;
const int RAND_MAX = 2147483647;
const int EXIT_FAILURE = 1;
const int EXIT_SUCCESS = 0;
const int _BITS_TYPES_LOCALE_T_H = 1;
const int _BITS_TYPES___LOCALE_T_H = 1;
const int _SYS_TYPES_H = 1;
const int __clock_t_defined = 1;
const int __clockid_t_defined = 1;
const int __time_t_defined = 1;
const int __timer_t_defined = 1;
const int _BITS_STDINT_INTN_H = 1;
const int __BIT_TYPES_DEFINED__ = 1;
const int _ENDIAN_H = 1;
const int _BITS_ENDIAN_H = 1;
const int __LITTLE_ENDIAN = 1234;
const int __BIG_ENDIAN = 4321;
const int __PDP_ENDIAN = 3412;
const int _BITS_ENDIANNESS_H = 1;
const int __BYTE_ORDER = 1234;
const int __FLOAT_WORD_ORDER = 1234;
const int LITTLE_ENDIAN = 1234;
const int BIG_ENDIAN = 4321;
const int PDP_ENDIAN = 3412;
const int BYTE_ORDER = 1234;
const int _BITS_BYTESWAP_H = 1;
const int _BITS_UINTN_IDENTITY_H = 1;
const int _SYS_SELECT_H = 1;
const int __sigset_t_defined = 1;
const int _SIGSET_NWORDS = 16;
const int __timeval_defined = 1;
const int _STRUCT_TIMESPEC = 1;
const int __NFDBITS = 64;
const int FD_SETSIZE = 1024;
const int NFDBITS = 64;
const int _BITS_PTHREADTYPES_COMMON_H = 1;
const int _THREAD_SHARED_TYPES_H = 1;
const int _BITS_PTHREADTYPES_ARCH_H = 1;
const int __SIZEOF_PTHREAD_MUTEX_T = 40;
const int __SIZEOF_PTHREAD_ATTR_T = 56;
const int __SIZEOF_PTHREAD_RWLOCK_T = 56;
const int __SIZEOF_PTHREAD_BARRIER_T = 32;
const int __SIZEOF_PTHREAD_MUTEXATTR_T = 4;
const int __SIZEOF_PTHREAD_COND_T = 48;
const int __SIZEOF_PTHREAD_CONDATTR_T = 4;
const int __SIZEOF_PTHREAD_RWLOCKATTR_T = 8;
const int __SIZEOF_PTHREAD_BARRIERATTR_T = 4;
const int _THREAD_MUTEX_INTERNAL_H = 1;
const int __PTHREAD_MUTEX_HAVE_PREV = 1;
const int __PTHREAD_RWLOCK_ELISION_EXTRA = 0;
const int __have_pthread_attr_t = 1;
const int _ALLOCA_H = 1;
const int _GLIBCXX_CMATH = 1;
const int __cpp_lib_hypot = 201603;
const int _GLIBCXX_BITS_SPECFUN_H = 1;
const int __STDCPP_MATH_SPEC_FUNCS__ = 201003;
const int __cpp_lib_math_special_functions = 201603;
const int _STL_ALGOBASE_H = 1;
const int _FUNCTEXCEPT_H = 1;
const int _EXCEPTION_DEFINES_H = 1;
const int _EXT_NUMERIC_TRAITS = 1;
const int _STL_PAIR_H = 1;
const int _GLIBCXX_TYPE_TRAITS = 1;
const int __cpp_lib_integral_constant_callable = 201304;
const int __cpp_lib_bool_constant = 201505;
const int __cpp_lib_logical_traits = 201510;
const int __cpp_lib_is_null_pointer = 201309;
const int __cpp_lib_is_final = 201402;
const int __cpp_lib_transformation_trait_aliases = 201304;
const int __cpp_lib_result_of_sfinae = 201210;
const int __cpp_lib_void_t = 201411;
const int __cpp_lib_is_swappable = 201603;
const int __cpp_lib_is_invocable = 201703;
const int __cpp_lib_type_trait_variable_templates = 201510;
const int __cpp_lib_has_unique_object_representations = 201606;
const int __cpp_lib_is_aggregate = 201703;
const int _MOVE_H = 1;
const int __cpp_lib_addressof_constexpr = 201603;
const int _GLIBCXX_UTILITY_H = 1;
const int __cpp_lib_tuple_element_t = 201402;
const int __cpp_lib_integer_sequence = 201304;
const int __cpp_lib_tuples_by_type = 201304;
const int _STL_ITERATOR_BASE_TYPES_H = 1;
const int _STL_ITERATOR_BASE_FUNCS_H = 1;
const int _CONCEPT_CHECK_H = 1;
const int _GLIBCXX_DEBUG_ASSERTIONS_H = 1;
const int _STL_ITERATOR_H = 1;
const int _PTR_TRAITS_H = 1;
const int __cpp_lib_array_constexpr = 201803;
const int __cpp_lib_make_reverse_iterator = 201402;
const int _GLIBCXX_DEBUG_MACRO_SWITCH_H = 1;
const int _GLIBCXX_PREDEFINED_OPS_H = 1;
const int _GLIBCXX_BIT = 1;
const int __cpp_lib_robust_nonmodifying_seq_ops = 201304;
const int _GLIBCXX_NUMERIC_LIMITS = 1;
const int __glibcxx_integral_traps = 1;
const int _GLIBCXX_TR1_GAMMA_TCC = 1;
const int _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H = 1;
const int _GLIBCXX_TR1_BESSEL_FUNCTION_TCC = 1;
const int _GLIBCXX_TR1_BETA_FUNCTION_TCC = 1;
const int _GLIBCXX_TR1_ELL_INTEGRAL_TCC = 1;
const int _GLIBCXX_TR1_EXP_INTEGRAL_TCC = 1;
const int _GLIBCXX_TR1_HYPERGEOMETRIC_TCC = 1;
const int _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC = 1;
const int _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC = 1;
const int _GLIBCXX_TR1_POLY_HERMITE_TCC = 1;
const int _GLIBCXX_TR1_POLY_LAGUERRE_TCC = 1;
const int _GLIBCXX_TR1_RIEMANN_ZETA_TCC = 1;
const int EIGEN_HAS_C99_MATH = 1;
const int EIGEN_HAS_STD_RESULT_OF = 0;
const int EIGEN_HAS_STD_HASH = 1;
const int EIGEN_HAS_STD_INVOKE_RESULT = 1;
const int EIGEN_HAS_ALIGNAS = 1;
const int EIGEN_HAS_TYPE_TRAITS = 1;
const int EIGEN_HAS_VARIADIC_TEMPLATES = 1;
const int EIGEN_HAS_CONSTEXPR = 1;
const int EIGEN_HAS_CXX11_MATH = 1;
const int EIGEN_HAS_CXX11_CONTAINERS = 1;
const int EIGEN_HAS_CXX11_NOEXCEPT = 1;
const int EIGEN_HAS_CXX11_ATOMIC = 1;
const int EIGEN_HAS_CXX11_OVERRIDE_FINAL = 1;
const int EIGEN_HAS_CXX17_OVERALIGN = 1;
const int EIGEN_HAS_BUILTIN_INT128 = 1;
const int EIGEN_NO_THROW = 1;
const int EIGEN_IDEAL_MAX_ALIGN_BYTES = 16;
const int EIGEN_MIN_ALIGN_BYTES = 16;
const int EIGEN_GCC_AND_ARCH_DOESNT_WANT_STACK_ALIGNMENT = 0;
const int EIGEN_ARCH_WANTS_STACK_ALIGNMENT = 1;
const int EIGEN_MAX_STATIC_ALIGN_BYTES = 16;
const int EIGEN_MAX_ALIGN_BYTES = 16;
const int EIGEN_DEFAULT_ALIGN_BYTES = 16;
const int EIGEN_UNALIGNED_VECTORIZE = 1;
const int _GLIBCXX_STDLIB_H = 1;
const int _GLIBCXX_CSTDLIB = 1;
const int _MM_HINT_ET0 = 7;
const int _MM_HINT_ET1 = 6;
const int _MM_HINT_T0 = 3;
const int _MM_HINT_T1 = 2;
const int _MM_HINT_T2 = 1;
const int _MM_HINT_NTA = 0;
const int _MM_EXCEPT_INVALID = 1;
const int _MM_EXCEPT_DENORM = 2;
const int _MM_EXCEPT_DIV_ZERO = 4;
const int _MM_EXCEPT_OVERFLOW = 8;
const int _MM_EXCEPT_UNDERFLOW = 16;
const int _MM_EXCEPT_INEXACT = 32;
const int _MM_EXCEPT_MASK = 63;
const int _MM_MASK_INVALID = 128;
const int _MM_MASK_DENORM = 256;
const int _MM_MASK_DIV_ZERO = 512;
const int _MM_MASK_OVERFLOW = 1024;
const int _MM_MASK_UNDERFLOW = 2048;
const int _MM_MASK_INEXACT = 4096;
const int _MM_MASK_MASK = 8064;
const int _MM_ROUND_NEAREST = 0;
const int _MM_ROUND_DOWN = 8192;
const int _MM_ROUND_UP = 16384;
const int _MM_ROUND_TOWARD_ZERO = 24576;
const int _MM_ROUND_MASK = 24576;
const int _MM_FLUSH_ZERO_MASK = 32768;
const int _MM_FLUSH_ZERO_ON = 32768;
const int _MM_FLUSH_ZERO_OFF = 0;
const int _MM_DENORMALS_ZERO_ON = 64;
const int _MM_DENORMALS_ZERO_OFF = 0;
const int _MM_DENORMALS_ZERO_MASK = 64;
const int __EXCEPTION_H = 1;
const int __cpp_lib_launder = 201606;
const int _GLIBCXX_COMPLEX = 1;
const int _GLIBCXX_SSTREAM = 1;
const int _GLIBCXX_ISTREAM = 1;
const int _GLIBCXX_IOS = 1;
const int _GLIBCXX_IOSFWD = 1;
const int _STRINGFWD_H = 1;
const int _MEMORYFWD_H = 1;
const int _GLIBCXX_POSTYPES_H = 1;
const int _WCHAR_H = 1;
const int _BITS_WCHAR_H = 1;
const int __WCHAR_MAX = 2147483647;
const int __WCHAR_MIN = -2147483648;
const int __wint_t_defined = 1;
const int _WINT_T = 1;
const int __mbstate_t_defined = 1;
const int ____mbstate_t_defined = 1;
const int ____FILE_defined = 1;
const int __FILE_defined = 1;
const int WCHAR_MIN = -2147483648;
const int WCHAR_MAX = 2147483647;
const int WEOF = 4294967295;
const int _GLIBCXX_CWCHAR = 1;
const int __cpp_lib_uncaught_exceptions = 201411;
const int _CXXABI_INIT_EXCEPTION_H = 1;
const int _GLIBCXX_HAVE_CDTOR_CALLABI = 0;
const int _HASH_BYTES_H = 1;
const int __GXX_MERGED_TYPEINFO_NAMES = 0;
const int __GXX_TYPEINFO_EQUALITY_INLINE = 1;
const int _GLIBCXX_NESTED_EXCEPTION_H = 1;
const int _CHAR_TRAITS_H = 1;
const int __cpp_lib_constexpr_char_traits = 201611;
const int _LOCALE_FWD_H = 1;
const int _GLIBCXX_CXX_LOCALE_H = 1;
const int _LOCALE_H = 1;
const int _BITS_LOCALE_H = 1;
const int __LC_CTYPE = 0;
const int __LC_NUMERIC = 1;
const int __LC_TIME = 2;
const int __LC_COLLATE = 3;
const int __LC_MONETARY = 4;
const int __LC_MESSAGES = 5;
const int __LC_ALL = 6;
const int __LC_PAPER = 7;
const int __LC_NAME = 8;
const int __LC_ADDRESS = 9;
const int __LC_TELEPHONE = 10;
const int __LC_MEASUREMENT = 11;
const int __LC_IDENTIFICATION = 12;
const int LC_CTYPE = 0;
const int LC_NUMERIC = 1;
const int LC_TIME = 2;
const int LC_COLLATE = 3;
const int LC_MONETARY = 4;
const int LC_MESSAGES = 5;
const int LC_ALL = 6;
const int LC_PAPER = 7;
const int LC_NAME = 8;
const int LC_ADDRESS = 9;
const int LC_TELEPHONE = 10;
const int LC_MEASUREMENT = 11;
const int LC_IDENTIFICATION = 12;
const int LC_CTYPE_MASK = 1;
const int LC_NUMERIC_MASK = 2;
const int LC_TIME_MASK = 4;
const int LC_COLLATE_MASK = 8;
const int LC_MONETARY_MASK = 16;
const int LC_MESSAGES_MASK = 32;
const int LC_PAPER_MASK = 128;
const int LC_NAME_MASK = 256;
const int LC_ADDRESS_MASK = 512;
const int LC_TELEPHONE_MASK = 1024;
const int LC_MEASUREMENT_MASK = 2048;
const int LC_IDENTIFICATION_MASK = 4096;
const int LC_ALL_MASK = 8127;
const int _GLIBCXX_CLOCALE = 1;
const int _GLIBCXX_C_LOCALE_GNU = 1;
const int _GLIBCXX_NUM_CATEGORIES = 6;
const int _CTYPE_H = 1;
const int _GLIBCXX_CCTYPE = 1;
const int _IOS_BASE_H = 1;
const int _GLIBCXX_ATOMICITY_H = 1;
const int __GTHREADS = 1;
const int __GTHREADS_CXX0X = 1;
const int _PTHREAD_H = 1;
const int _SCHED_H = 1;
const int _BITS_SCHED_H = 1;
const int SCHED_OTHER = 0;
const int SCHED_FIFO = 1;
const int SCHED_RR = 2;
const int SCHED_BATCH = 3;
const int SCHED_ISO = 4;
const int SCHED_IDLE = 5;
const int SCHED_DEADLINE = 6;
const int SCHED_RESET_ON_FORK = 1073741824;
const int CSIGNAL = 255;
const int CLONE_VM = 256;
const int CLONE_FS = 512;
const int CLONE_FILES = 1024;
const int CLONE_SIGHAND = 2048;
const int CLONE_PIDFD = 4096;
const int CLONE_PTRACE = 8192;
const int CLONE_VFORK = 16384;
const int CLONE_PARENT = 32768;
const int CLONE_THREAD = 65536;
const int CLONE_NEWNS = 131072;
const int CLONE_SYSVSEM = 262144;
const int CLONE_SETTLS = 524288;
const int CLONE_PARENT_SETTID = 1048576;
const int CLONE_CHILD_CLEARTID = 2097152;
const int CLONE_DETACHED = 4194304;
const int CLONE_UNTRACED = 8388608;
const int CLONE_CHILD_SETTID = 16777216;
const int CLONE_NEWCGROUP = 33554432;
const int CLONE_NEWUTS = 67108864;
const int CLONE_NEWIPC = 134217728;
const int CLONE_NEWUSER = 268435456;
const int CLONE_NEWPID = 536870912;
const int CLONE_NEWNET = 1073741824;
const int CLONE_IO = 2147483648;
const int CLONE_NEWTIME = 128;
const int _BITS_TYPES_STRUCT_SCHED_PARAM = 1;
const int _BITS_CPU_SET_H = 1;
const int __CPU_SETSIZE = 1024;
const int __NCPUBITS = 64;
const int CPU_SETSIZE = 1024;
const int _TIME_H = 1;
const int _BITS_TIME_H = 1;
const int CLOCKS_PER_SEC = 1000000;
const int CLOCK_REALTIME = 0;
const int CLOCK_MONOTONIC = 1;
const int CLOCK_PROCESS_CPUTIME_ID = 2;
const int CLOCK_THREAD_CPUTIME_ID = 3;
const int CLOCK_MONOTONIC_RAW = 4;
const int CLOCK_REALTIME_COARSE = 5;
const int CLOCK_MONOTONIC_COARSE = 6;
const int CLOCK_BOOTTIME = 7;
const int CLOCK_REALTIME_ALARM = 8;
const int CLOCK_BOOTTIME_ALARM = 9;
const int CLOCK_TAI = 11;
const int TIMER_ABSTIME = 1;
const int _BITS_TIMEX_H = 1;
const int ADJ_OFFSET = 1;
const int ADJ_FREQUENCY = 2;
const int ADJ_MAXERROR = 4;
const int ADJ_ESTERROR = 8;
const int ADJ_STATUS = 16;
const int ADJ_TIMECONST = 32;
const int ADJ_TAI = 128;
const int ADJ_SETOFFSET = 256;
const int ADJ_MICRO = 4096;
const int ADJ_NANO = 8192;
const int ADJ_TICK = 16384;
const int ADJ_OFFSET_SINGLESHOT = 32769;
const int ADJ_OFFSET_SS_READ = 40961;
const int MOD_OFFSET = 1;
const int MOD_FREQUENCY = 2;
const int MOD_MAXERROR = 4;
const int MOD_ESTERROR = 8;
const int MOD_STATUS = 16;
const int MOD_TIMECONST = 32;
const int MOD_CLKB = 16384;
const int MOD_CLKA = 32769;
const int MOD_TAI = 128;
const int MOD_MICRO = 4096;
const int MOD_NANO = 8192;
const int STA_PLL = 1;
const int STA_PPSFREQ = 2;
const int STA_PPSTIME = 4;
const int STA_FLL = 8;
const int STA_INS = 16;
const int STA_DEL = 32;
const int STA_UNSYNC = 64;
const int STA_FREQHOLD = 128;
const int STA_PPSSIGNAL = 256;
const int STA_PPSJITTER = 512;
const int STA_PPSWANDER = 1024;
const int STA_PPSERROR = 2048;
const int STA_CLOCKERR = 4096;
const int STA_NANO = 8192;
const int STA_MODE = 16384;
const int STA_CLK = 32768;
const int STA_RONLY = 65280;
const int __struct_tm_defined = 1;
const int __itimerspec_defined = 1;
const int TIME_UTC = 1;
const int _BITS_SETJMP_H = 1;
const int __jmp_buf_tag_defined = 1;
const int __SC_THREAD_STACK_MIN_VALUE = 75;
const int PTHREAD_CREATE_JOINABLE1 = 0;
const int PTHREAD_CREATE_DETACHED1 = 1;
const int PTHREAD_INHERIT_SCHED1 = 0;
const int PTHREAD_EXPLICIT_SCHED1 = 1;
const int PTHREAD_SCOPE_SYSTEM1 = 0;
const int PTHREAD_SCOPE_PROCESS1 = 1;
const int PTHREAD_PROCESS_PRIVATE1 = 0;
const int PTHREAD_PROCESS_SHARED1 = 1;
const int PTHREAD_CANCEL_ENABLE1 = 0;
const int PTHREAD_CANCEL_DISABLE1 = 1;
const int PTHREAD_CANCEL_DEFERRED1 = 0;
const int PTHREAD_CANCEL_ASYNCHRONOUS1 = 1;
const int PTHREAD_ONCE_INIT = 0;
const int PTHREAD_BARRIER_SERIAL_THREAD = -1;
const int PTHREAD_ATTR_NO_SIGMASK_NP = -1;
const int __GTHREAD_HAS_COND = 1;
const int __GTHREAD_ONCE_INIT = 0;
const int _GLIBCXX_ATOMIC_WORD_H = 1;
const int _LOCALE_CLASSES_H = 1;
const int _GLIBCXX_STRING = 1;
const int _ALLOCATOR_H = 1;
const int _GLIBCXX_CXX_ALLOCATOR_H = 1;
const int _STD_NEW_ALLOCATOR_H = 1;
const int __cpp_lib_incomplete_container_elements = 201505;
const int _OSTREAM_INSERT_H = 1;
const int _CXXABI_FORCED_H = 1;
const int _STL_FUNCTION_H = 1;
const int __cpp_lib_transparent_operators = 201510;
const int _BACKWARD_BINDERS_H = 1;
const int _GLIBCXX_REFWRAP_H = 1;
const int _GLIBCXX_INVOKE_H = 1;
const int _GLIBCXX_RANGE_ACCESS_H = 1;
const int __cpp_lib_nonmember_container_access = 201411;
const int _BASIC_STRING_H = 1;
const int _EXT_ALLOC_TRAITS_H = 1;
const int _ALLOC_TRAITS_H = 1;
const int _STL_CONSTRUCT_H = 1;
const int __cpp_lib_allocator_traits_is_always_equal = 201411;
const int _GLIBCXX_STRING_VIEW = 1;
const int _FUNCTIONAL_HASH_H = 1;
const int __cpp_lib_string_view = 201803;
const int _GLIBCXX_STRING_VIEW_TCC = 1;
const int __cpp_lib_constexpr_string = 201611;
const int _STRING_CONVERSIONS_H = 1;
const int _STDIO_H = 1;
const int _____fpos_t_defined = 1;
const int _____fpos64_t_defined = 1;
const int __struct_FILE_defined = 1;
const int _IO_EOF_SEEN = 16;
const int _IO_ERR_SEEN = 32;
const int _IO_USER_LOCK = 32768;
const int __cookie_io_functions_t_defined = 1;
const int _IOFBF = 0;
const int _IOLBF = 1;
const int _IONBF = 2;
const int BUFSIZ = 8192;
const int EOF = -1;
const int SEEK_SET = 0;
const int SEEK_CUR = 1;
const int SEEK_END = 2;
const int SEEK_DATA = 3;
const int SEEK_HOLE = 4;
const String P_tmpdir = '/tmp';
const int L_tmpnam = 20;
const int TMP_MAX = 238328;
const int _BITS_STDIO_LIM_H = 1;
const int FILENAME_MAX = 4096;
const int L_ctermid = 9;
const int L_cuserid = 9;
const int FOPEN_MAX = 16;
const int _PRINTF_NAN_LEN_MAX = 4;
const int RENAME_NOREPLACE = 1;
const int RENAME_EXCHANGE = 2;
const int RENAME_WHITEOUT = 4;
const int _GLIBCXX_CSTDIO = 1;
const int _ERRNO_H = 1;
const int _BITS_ERRNO_H = 1;
const int EPERM = 1;
const int ENOENT = 2;
const int ESRCH = 3;
const int EINTR = 4;
const int EIO = 5;
const int ENXIO = 6;
const int E2BIG = 7;
const int ENOEXEC = 8;
const int EBADF = 9;
const int ECHILD = 10;
const int EAGAIN = 11;
const int ENOMEM = 12;
const int EACCES = 13;
const int EFAULT = 14;
const int ENOTBLK = 15;
const int EBUSY = 16;
const int EEXIST = 17;
const int EXDEV = 18;
const int ENODEV = 19;
const int ENOTDIR = 20;
const int EISDIR = 21;
const int EINVAL = 22;
const int ENFILE = 23;
const int EMFILE = 24;
const int ENOTTY = 25;
const int ETXTBSY = 26;
const int EFBIG = 27;
const int ENOSPC = 28;
const int ESPIPE = 29;
const int EROFS = 30;
const int EMLINK = 31;
const int EPIPE = 32;
const int EDOM = 33;
const int ERANGE = 34;
const int EDEADLK = 35;
const int ENAMETOOLONG = 36;
const int ENOLCK = 37;
const int ENOSYS = 38;
const int ENOTEMPTY = 39;
const int ELOOP = 40;
const int EWOULDBLOCK = 11;
const int ENOMSG = 42;
const int EIDRM = 43;
const int ECHRNG = 44;
const int EL2NSYNC = 45;
const int EL3HLT = 46;
const int EL3RST = 47;
const int ELNRNG = 48;
const int EUNATCH = 49;
const int ENOCSI = 50;
const int EL2HLT = 51;
const int EBADE = 52;
const int EBADR = 53;
const int EXFULL = 54;
const int ENOANO = 55;
const int EBADRQC = 56;
const int EBADSLT = 57;
const int EDEADLOCK = 35;
const int EBFONT = 59;
const int ENOSTR = 60;
const int ENODATA = 61;
const int ETIME = 62;
const int ENOSR = 63;
const int ENONET = 64;
const int ENOPKG = 65;
const int EREMOTE = 66;
const int ENOLINK = 67;
const int EADV = 68;
const int ESRMNT = 69;
const int ECOMM = 70;
const int EPROTO = 71;
const int EMULTIHOP = 72;
const int EDOTDOT = 73;
const int EBADMSG = 74;
const int EOVERFLOW = 75;
const int ENOTUNIQ = 76;
const int EBADFD = 77;
const int EREMCHG = 78;
const int ELIBACC = 79;
const int ELIBBAD = 80;
const int ELIBSCN = 81;
const int ELIBMAX = 82;
const int ELIBEXEC = 83;
const int EILSEQ = 84;
const int ERESTART = 85;
const int ESTRPIPE = 86;
const int EUSERS = 87;
const int ENOTSOCK = 88;
const int EDESTADDRREQ = 89;
const int EMSGSIZE = 90;
const int EPROTOTYPE = 91;
const int ENOPROTOOPT = 92;
const int EPROTONOSUPPORT = 93;
const int ESOCKTNOSUPPORT = 94;
const int EOPNOTSUPP = 95;
const int EPFNOSUPPORT = 96;
const int EAFNOSUPPORT = 97;
const int EADDRINUSE = 98;
const int EADDRNOTAVAIL = 99;
const int ENETDOWN = 100;
const int ENETUNREACH = 101;
const int ENETRESET = 102;
const int ECONNABORTED = 103;
const int ECONNRESET = 104;
const int ENOBUFS = 105;
const int EISCONN = 106;
const int ENOTCONN = 107;
const int ESHUTDOWN = 108;
const int ETOOMANYREFS = 109;
const int ETIMEDOUT = 110;
const int ECONNREFUSED = 111;
const int EHOSTDOWN = 112;
const int EHOSTUNREACH = 113;
const int EALREADY = 114;
const int EINPROGRESS = 115;
const int ESTALE = 116;
const int EUCLEAN = 117;
const int ENOTNAM = 118;
const int ENAVAIL = 119;
const int EISNAM = 120;
const int EREMOTEIO = 121;
const int EDQUOT = 122;
const int ENOMEDIUM = 123;
const int EMEDIUMTYPE = 124;
const int ECANCELED = 125;
const int ENOKEY = 126;
const int EKEYEXPIRED = 127;
const int EKEYREVOKED = 128;
const int EKEYREJECTED = 129;
const int EOWNERDEAD = 130;
const int ENOTRECOVERABLE = 131;
const int ERFKILL = 132;
const int EHWPOISON = 133;
const int ENOTSUP = 95;
const int __error_t_defined = 1;
const int _GLIBCXX_CERRNO = 1;
const int _GLIBCXX_CHARCONV_H = 1;
const int __cpp_lib_string_udls = 201304;
const int _BASIC_STRING_TCC = 1;
const int _GLIBCXX_MEMORY_RESOURCE_H = 1;
const int _GLIBCXX_CSTDDEF = 1;
const int __cpp_lib_byte = 201603;
const int _USES_ALLOCATOR_H = 1;
const int _USES_ALLOCATOR_ARGS = 1;
const int _GLIBCXX_TUPLE = 1;
const int __cpp_lib_apply = 201603;
const int __cpp_lib_make_from_tuple = 201606;
const int _LOCALE_CLASSES_TCC = 1;
const int _GLIBCXX_SYSTEM_ERROR = 1;
const int _GLIBCXX_ERROR_CONSTANTS = 1;
const int _GLIBCXX_STDEXCEPT = 1;
const int _GLIBXX_STREAMBUF = 1;
const int _STREAMBUF_TCC = 1;
const int _BASIC_IOS_H = 1;
const int _LOCALE_FACETS_H = 1;
const int _WCTYPE_H = 1;
const int _BITS_WCTYPE_WCHAR_H = 1;
const int _GLIBCXX_CWCTYPE = 1;
const int _STREAMBUF_ITERATOR_H = 1;
const int _GLIBCXX_NUM_FACETS = 14;
const int _GLIBCXX_NUM_CXX11_FACETS = 8;
const int _GLIBCXX_NUM_UNICODE_FACETS = 2;
const int _GLIBCXX_NUM_LBDL_ALT128_FACETS = 6;
const int _LOCALE_FACETS_TCC = 1;
const int _BASIC_IOS_TCC = 1;
const int _GLIBCXX_OSTREAM = 1;
const int _OSTREAM_TCC = 1;
const int _ISTREAM_TCC = 1;
const int _SSTREAM_TCC = 1;
const int __cpp_lib_complex_udls = 201309;
const int _ASSERT_H = 1;
const int __ASSERT_LINE = 1885;
const int _GLIBCXX_FUNCTIONAL = 1;
const int _GLIBCXX_STD_FUNCTION_H = 1;
const int _GLIBCXX_UNORDERED_MAP = 1;
const int _HASHTABLE_H = 1;
const int _HASHTABLE_POLICY_H = 1;
const int _ALIGNED_BUFFER_H = 1;
const int _ENABLE_SPECIAL_MEMBERS_H = 1;
const int _NODE_HANDLE = 1;
const int __cpp_lib_node_extract = 201606;
const int __cpp_lib_unordered_map_try_emplace = 201411;
const int _GLIBCXX_ERASE_IF_H = 1;
const int _GLIBCXX_VECTOR = 1;
const int _STL_UNINITIALIZED_H = 1;
const int __cpp_lib_raw_memory_algorithms = 201606;
const int _STL_VECTOR_H = 1;
const int _STL_BVECTOR_H = 1;
const int _VECTOR_TCC = 1;
const int _GLIBCXX_ARRAY = 1;
const int _STL_ALGO_H = 1;
const int _GLIBCXX_ALGORITHMFWD_H = 1;
const int _STL_HEAP_H = 1;
const int _STL_TEMPBUF_H = 1;
const int __cpp_lib_clamp = 201603;
const int __cpp_lib_sample = 201603;
const int __cpp_lib_invoke = 201411;
const int __cpp_lib_not_fn = 201603;
const int __cpp_lib_boyer_moore_searcher = 201603;
const int _STRING_H = 1;
const int _STRINGS_H = 1;
const int _GLIBCXX_CSTRING = 1;
const int _LIBC_LIMITS_H_ = 1;
const int MB_LEN_MAX = 16;
const int LLONG_MIN = -9223372036854775808;
const int LLONG_MAX = 9223372036854775807;
const int ULLONG_MAX = -1;
const int CHAR_WIDTH = 8;
const int SCHAR_WIDTH = 8;
const int UCHAR_WIDTH = 8;
const int SHRT_WIDTH = 16;
const int USHRT_WIDTH = 16;
const int INT_WIDTH = 32;
const int UINT_WIDTH = 32;
const int LONG_WIDTH = 64;
const int ULONG_WIDTH = 64;
const int LLONG_WIDTH = 64;
const int ULLONG_WIDTH = 64;
const int BOOL_MAX = 1;
const int BOOL_WIDTH = 1;
const int _BITS_POSIX1_LIM_H = 1;
const int _POSIX_AIO_LISTIO_MAX = 2;
const int _POSIX_AIO_MAX = 1;
const int _POSIX_ARG_MAX = 4096;
const int _POSIX_CHILD_MAX = 25;
const int _POSIX_DELAYTIMER_MAX = 32;
const int _POSIX_HOST_NAME_MAX = 255;
const int _POSIX_LINK_MAX = 8;
const int _POSIX_LOGIN_NAME_MAX = 9;
const int _POSIX_MAX_CANON = 255;
const int _POSIX_MAX_INPUT = 255;
const int _POSIX_MQ_OPEN_MAX = 8;
const int _POSIX_MQ_PRIO_MAX = 32;
const int _POSIX_NAME_MAX = 14;
const int _POSIX_NGROUPS_MAX = 8;
const int _POSIX_OPEN_MAX = 20;
const int _POSIX_FD_SETSIZE = 20;
const int _POSIX_PATH_MAX = 256;
const int _POSIX_PIPE_BUF = 512;
const int _POSIX_RE_DUP_MAX = 255;
const int _POSIX_RTSIG_MAX = 8;
const int _POSIX_SEM_NSEMS_MAX = 256;
const int _POSIX_SEM_VALUE_MAX = 32767;
const int _POSIX_SIGQUEUE_MAX = 32;
const int _POSIX_SSIZE_MAX = 32767;
const int _POSIX_STREAM_MAX = 8;
const int _POSIX_SYMLINK_MAX = 255;
const int _POSIX_SYMLOOP_MAX = 8;
const int _POSIX_TIMER_MAX = 32;
const int _POSIX_TTY_NAME_MAX = 9;
const int _POSIX_TZNAME_MAX = 6;
const int _POSIX_QLIMIT = 1;
const int _POSIX_HIWAT = 512;
const int _POSIX_UIO_MAXIOV = 16;
const int _POSIX_CLOCKRES_MIN = 20000000;
const int NGROUPS_MAX = 65536;
const int MAX_CANON = 255;
const int MAX_INPUT = 255;
const int NAME_MAX = 255;
const int PATH_MAX = 4096;
const int PIPE_BUF = 4096;
const int XATTR_NAME_MAX = 255;
const int XATTR_SIZE_MAX = 65536;
const int XATTR_LIST_MAX = 65536;
const int RTSIG_MAX = 32;
const int _POSIX_THREAD_KEYS_MAX = 128;
const int PTHREAD_KEYS_MAX = 1024;
const int _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4;
const int PTHREAD_DESTRUCTOR_ITERATIONS = 4;
const int _POSIX_THREAD_THREADS_MAX = 64;
const int AIO_PRIO_DELTA_MAX = 20;
const int DELAYTIMER_MAX = 2147483647;
const int TTY_NAME_MAX = 32;
const int LOGIN_NAME_MAX = 256;
const int HOST_NAME_MAX = 64;
const int MQ_PRIO_MAX = 32768;
const int SEM_VALUE_MAX = 2147483647;
const int SSIZE_MAX = 9223372036854775807;
const int _BITS_POSIX2_LIM_H = 1;
const int _POSIX2_BC_BASE_MAX = 99;
const int _POSIX2_BC_DIM_MAX = 2048;
const int _POSIX2_BC_SCALE_MAX = 99;
const int _POSIX2_BC_STRING_MAX = 1000;
const int _POSIX2_COLL_WEIGHTS_MAX = 2;
const int _POSIX2_EXPR_NEST_MAX = 32;
const int _POSIX2_LINE_MAX = 2048;
const int _POSIX2_RE_DUP_MAX = 255;
const int _POSIX2_CHARCLASS_NAME_MAX = 14;
const int BC_BASE_MAX = 99;
const int BC_DIM_MAX = 2048;
const int BC_SCALE_MAX = 99;
const int BC_STRING_MAX = 1000;
const int COLL_WEIGHTS_MAX = 255;
const int EXPR_NEST_MAX = 32;
const int LINE_MAX = 2048;
const int CHARCLASS_NAME_MAX = 2048;
const int RE_DUP_MAX = 32767;
const int _XOPEN_LIM_H = 1;
const int _XOPEN_IOV_MAX = 16;
const int _BITS_UIO_LIM_H = 1;
const int __IOV_MAX = 1024;
const int IOV_MAX = 1024;
const int NL_ARGMAX = 4096;
const int NL_LANGMAX = 2048;
const int NL_MSGMAX = 2147483647;
const int NL_NMAX = 2147483647;
const int NL_SETMAX = 2147483647;
const int NL_TEXTMAX = 2147483647;
const int NZERO = 20;
const int WORD_BIT = 32;
const int LONG_BIT = 64;
const int SCHAR_MAX = 127;
const int SHRT_MAX = 32767;
const int INT_MAX = 2147483647;
const int LONG_MAX = 9223372036854775807;
const int SCHAR_MIN = -128;
const int SHRT_MIN = -32768;
const int INT_MIN = -2147483648;
const int LONG_MIN = -9223372036854775808;
const int UCHAR_MAX = 255;
const int USHRT_MAX = 65535;
const int UINT_MAX = 4294967295;
const int ULONG_MAX = -1;
const int CHAR_BIT = 8;
const int CHAR_MIN = -128;
const int CHAR_MAX = 127;
const int LONG_LONG_MAX = 9223372036854775807;
const int LONG_LONG_MIN = -9223372036854775808;
const int ULONG_LONG_MAX = -1;
const int _GLIBCXX_CLIMITS = 1;
const int _GLIBCXX_ALGORITHM = 1;
const int _PSTL_ALGORITHM_FORWARD_DECLARED = 1;
const int __cpp_lib_parallel_algorithm = 201603;
const int _GLIBCXX_CSTDINT = 1;
const int _STDINT_H = 1;
const int _BITS_STDINT_UINTN_H = 1;
const int INT8_MIN = -128;
const int INT16_MIN = -32768;
const int INT32_MIN = -2147483648;
const int INT64_MIN = -9223372036854775808;
const int INT8_MAX = 127;
const int INT16_MAX = 32767;
const int INT32_MAX = 2147483647;
const int INT64_MAX = 9223372036854775807;
const int UINT8_MAX = 255;
const int UINT16_MAX = 65535;
const int UINT32_MAX = 4294967295;
const int UINT64_MAX = -1;
const int INT_LEAST8_MIN = -128;
const int INT_LEAST16_MIN = -32768;
const int INT_LEAST32_MIN = -2147483648;
const int INT_LEAST64_MIN = -9223372036854775808;
const int INT_LEAST8_MAX = 127;
const int INT_LEAST16_MAX = 32767;
const int INT_LEAST32_MAX = 2147483647;
const int INT_LEAST64_MAX = 9223372036854775807;
const int UINT_LEAST8_MAX = 255;
const int UINT_LEAST16_MAX = 65535;
const int UINT_LEAST32_MAX = 4294967295;
const int UINT_LEAST64_MAX = -1;
const int INT_FAST8_MIN = -128;
const int INT_FAST16_MIN = -9223372036854775808;
const int INT_FAST32_MIN = -9223372036854775808;
const int INT_FAST64_MIN = -9223372036854775808;
const int INT_FAST8_MAX = 127;
const int INT_FAST16_MAX = 9223372036854775807;
const int INT_FAST32_MAX = 9223372036854775807;
const int INT_FAST64_MAX = 9223372036854775807;
const int UINT_FAST8_MAX = 255;
const int UINT_FAST16_MAX = -1;
const int UINT_FAST32_MAX = -1;
const int UINT_FAST64_MAX = -1;
const int INTPTR_MIN = -9223372036854775808;
const int INTPTR_MAX = 9223372036854775807;
const int UINTPTR_MAX = -1;
const int INTMAX_MIN = -9223372036854775808;
const int INTMAX_MAX = 9223372036854775807;
const int UINTMAX_MAX = -1;
const int PTRDIFF_MIN = -9223372036854775808;
const int PTRDIFF_MAX = 9223372036854775807;
const int SIG_ATOMIC_MIN = -2147483648;
const int SIG_ATOMIC_MAX = 2147483647;
const int SIZE_MAX = -1;
const int WINT_MIN = 0;
const int WINT_MAX = 4294967295;
const int INT8_WIDTH = 8;
const int UINT8_WIDTH = 8;
const int INT16_WIDTH = 16;
const int UINT16_WIDTH = 16;
const int INT32_WIDTH = 32;
const int UINT32_WIDTH = 32;
const int INT64_WIDTH = 64;
const int UINT64_WIDTH = 64;
const int INT_LEAST8_WIDTH = 8;
const int UINT_LEAST8_WIDTH = 8;
const int INT_LEAST16_WIDTH = 16;
const int UINT_LEAST16_WIDTH = 16;
const int INT_LEAST32_WIDTH = 32;
const int UINT_LEAST32_WIDTH = 32;
const int INT_LEAST64_WIDTH = 64;
const int UINT_LEAST64_WIDTH = 64;
const int INT_FAST8_WIDTH = 8;
const int UINT_FAST8_WIDTH = 8;
const int INT_FAST16_WIDTH = 64;
const int UINT_FAST16_WIDTH = 64;
const int INT_FAST32_WIDTH = 64;
const int UINT_FAST32_WIDTH = 64;
const int INT_FAST64_WIDTH = 64;
const int UINT_FAST64_WIDTH = 64;
const int INTPTR_WIDTH = 64;
const int UINTPTR_WIDTH = 64;
const int INTMAX_WIDTH = 64;
const int UINTMAX_WIDTH = 64;
const int PTRDIFF_WIDTH = 64;
const int SIG_ATOMIC_WIDTH = 32;
const int SIZE_WIDTH = 64;
const int WCHAR_WIDTH = 32;
const int WINT_WIDTH = 32;
const int EIGEN_GLIBC_MALLOC_ALREADY_ALIGNED = 1;
const int EIGEN_FREEBSD_MALLOC_ALREADY_ALIGNED = 0;
const int EIGEN_MALLOC_ALREADY_ALIGNED = 1;
const double EIGEN_PI = 3.141592653589793;
const double EIGEN_LOG2E = 1.4426950408889634;
const double EIGEN_LN2 = 0.6931471805599453;
const int EIGEN_USE_STD_FPCLASSIFY = 1;
const int EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD = 8;
const int EIGEN_ARCH_DEFAULT_NUMBER_OF_REGISTERS = 16;
const int EIGEN_UNROLLING_LIMIT = 110;
const int EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH = 8;
const int EIGEN_GEMM_TO_COEFFBASED_THRESHOLD = 20;
const int _GLIBCXX_ATOMIC = 1;
const int _GLIBCXX_ATOMIC_BASE_H = 1;
const int _GLIBCXX_ATOMIC_LOCK_FREE_H = 1;
const int ATOMIC_BOOL_LOCK_FREE = 2;
const int ATOMIC_CHAR_LOCK_FREE = 2;
const int ATOMIC_WCHAR_T_LOCK_FREE = 2;
const int ATOMIC_CHAR16_T_LOCK_FREE = 2;
const int ATOMIC_CHAR32_T_LOCK_FREE = 2;
const int ATOMIC_SHORT_LOCK_FREE = 2;
const int ATOMIC_INT_LOCK_FREE = 2;
const int ATOMIC_LONG_LOCK_FREE = 2;
const int ATOMIC_LLONG_LOCK_FREE = 2;
const int ATOMIC_POINTER_LOCK_FREE = 2;
const int __cpp_lib_atomic_is_always_lock_free = 201603;
const int _GLIBCXX_ITERATOR = 1;
const int _STREAM_ITERATOR_H = 1;
const int __cpp_lib_null_iterators = 201304;
const int _GLIBCXX_FSTREAM = 1;
const int _CODECVT_H = 1;
const int _GLIBCXX_BASIC_FILE_STDIO_H = 1;
const int _GLIBCXX_CXX_IO_H = 1;
const int _GLIBCXX_BUFSIZ = 8192;
const int _FSTREAM_TCC = 1;
const int _GLIBCXX_MAP = 1;
const int _STL_TREE_H = 1;
const int __cpp_lib_generic_associative_lookup = 201304;
const int _STL_MAP_H = 1;
const int __cpp_lib_map_try_emplace = 201411;
const int _STL_MULTIMAP_H = 1;
const int _GLIBCXX_MEMORY = 1;
const int _STL_RAW_STORAGE_ITERATOR_H = 1;
const int _GLIBCXX_ALIGN_H = 1;
const int _UNIQUE_PTR_H = 1;
const int __cpp_lib_make_unique = 201304;
const int _SHARED_PTR_H = 1;
const int _SHARED_PTR_BASE_H = 1;
const int _ALLOCATED_PTR_H = 1;
const int _CONCURRENCE_H = 1;
const int __cpp_lib_shared_ptr_arrays = 201611;
const int __cpp_lib_shared_ptr_weak_type = 201606;
const int __cpp_lib_enable_shared_from_this = 201603;
const int _SHARED_PTR_ATOMIC_H = 1;
const int _BACKWARD_AUTO_PTR_H = 1;
const int _GLIBCXX_IOSTREAM = 1;
const int _GLIBCXX_FORWARD_LIST = 1;
const int _FORWARD_LIST_H = 1;
const int _FORWARD_LIST_TCC = 1;
const int _GLIBCXX_SET = 1;
const int _STL_SET_H = 1;
const int _STL_MULTISET_H = 1;
const int _GLIBCXX_UTILITY = 1;
const int _STL_RELOPS_H = 1;
const int __cpp_lib_exchange_function = 201304;
const int __cpp_lib_as_const = 201510;
const int _GLIBCXX_NUMERIC = 1;
const int _STL_NUMERIC_H = 1;
const int __cpp_lib_gcd_lcm = 201606;
const int __cpp_lib_gcd = 201606;
const int __cpp_lib_lcm = 201606;
const int _PSTL_NUMERIC_FORWARD_DECLARED = 1;
const int _GLIBCXX_MUTEX = 1;
const int _GLIBCXX_CHRONO_H = 1;
const int _GLIBCXX_RATIO = 1;
const int _GLIBCXX_CTIME = 1;
const int _GLIBCXX_PARSE_NUMBERS_H = 1;
const int __cpp_lib_chrono = 201611;
const int __cpp_lib_chrono_udls = 201304;
const int _GLIBCXX_MUTEX_H = 1;
const int _GLIBCXX_UNIQUE_LOCK_H = 1;
const int __cpp_lib_scoped_lock = 201703;
const int _UNISTD_H = 1;
const int _POSIX_VERSION = 200809;
const int __POSIX2_THIS_VERSION = 200809;
const int _POSIX2_VERSION = 200809;
const int _POSIX2_C_VERSION = 200809;
const int _POSIX2_C_BIND = 200809;
const int _POSIX2_C_DEV = 200809;
const int _POSIX2_SW_DEV = 200809;
const int _POSIX2_LOCALEDEF = 200809;
const int _XOPEN_VERSION = 700;
const int _XOPEN_XCU_VERSION = 4;
const int _XOPEN_XPG2 = 1;
const int _XOPEN_XPG3 = 1;
const int _XOPEN_XPG4 = 1;
const int _XOPEN_UNIX = 1;
const int _XOPEN_ENH_I18N = 1;
const int _XOPEN_LEGACY = 1;
const int _BITS_POSIX_OPT_H = 1;
const int _POSIX_JOB_CONTROL = 1;
const int _POSIX_SAVED_IDS = 1;
const int _POSIX_PRIORITY_SCHEDULING = 200809;
const int _POSIX_SYNCHRONIZED_IO = 200809;
const int _POSIX_FSYNC = 200809;
const int _POSIX_MAPPED_FILES = 200809;
const int _POSIX_MEMLOCK = 200809;
const int _POSIX_MEMLOCK_RANGE = 200809;
const int _POSIX_MEMORY_PROTECTION = 200809;
const int _POSIX_CHOWN_RESTRICTED = 0;
const int _POSIX_VDISABLE = 0;
const int _POSIX_NO_TRUNC = 1;
const int _XOPEN_REALTIME = 1;
const int _XOPEN_REALTIME_THREADS = 1;
const int _XOPEN_SHM = 1;
const int _POSIX_THREADS = 200809;
const int _POSIX_REENTRANT_FUNCTIONS = 1;
const int _POSIX_THREAD_SAFE_FUNCTIONS = 200809;
const int _POSIX_THREAD_PRIORITY_SCHEDULING = 200809;
const int _POSIX_THREAD_ATTR_STACKSIZE = 200809;
const int _POSIX_THREAD_ATTR_STACKADDR = 200809;
const int _POSIX_THREAD_PRIO_INHERIT = 200809;
const int _POSIX_THREAD_PRIO_PROTECT = 200809;
const int _POSIX_THREAD_ROBUST_PRIO_INHERIT = 200809;
const int _POSIX_THREAD_ROBUST_PRIO_PROTECT = -1;
const int _POSIX_SEMAPHORES = 200809;
const int _POSIX_REALTIME_SIGNALS = 200809;
const int _POSIX_ASYNCHRONOUS_IO = 200809;
const int _POSIX_ASYNC_IO = 1;
const int _LFS_ASYNCHRONOUS_IO = 1;
const int _POSIX_PRIORITIZED_IO = 200809;
const int _LFS64_ASYNCHRONOUS_IO = 1;
const int _LFS_LARGEFILE = 1;
const int _LFS64_LARGEFILE = 1;
const int _LFS64_STDIO = 1;
const int _POSIX_SHARED_MEMORY_OBJECTS = 200809;
const int _POSIX_CPUTIME = 0;
const int _POSIX_THREAD_CPUTIME = 0;
const int _POSIX_REGEXP = 1;
const int _POSIX_READER_WRITER_LOCKS = 200809;
const int _POSIX_SHELL = 1;
const int _POSIX_TIMEOUTS = 200809;
const int _POSIX_SPIN_LOCKS = 200809;
const int _POSIX_SPAWN = 200809;
const int _POSIX_TIMERS = 200809;
const int _POSIX_BARRIERS = 200809;
const int _POSIX_MESSAGE_PASSING = 200809;
const int _POSIX_THREAD_PROCESS_SHARED = 200809;
const int _POSIX_MONOTONIC_CLOCK = 0;
const int _POSIX_CLOCK_SELECTION = 200809;
const int _POSIX_ADVISORY_INFO = 200809;
const int _POSIX_IPV6 = 200809;
const int _POSIX_RAW_SOCKETS = 200809;
const int _POSIX2_CHAR_TERM = 200809;
const int _POSIX_SPORADIC_SERVER = -1;
const int _POSIX_THREAD_SPORADIC_SERVER = -1;
const int _POSIX_TRACE = -1;
const int _POSIX_TRACE_EVENT_FILTER = -1;
const int _POSIX_TRACE_INHERIT = -1;
const int _POSIX_TRACE_LOG = -1;
const int _POSIX_TYPED_MEMORY_OBJECTS = -1;
const int _POSIX_V7_LPBIG_OFFBIG = -1;
const int _POSIX_V6_LPBIG_OFFBIG = -1;
const int _XBS5_LPBIG_OFFBIG = -1;
const int _POSIX_V7_LP64_OFF64 = 1;
const int _POSIX_V6_LP64_OFF64 = 1;
const int _XBS5_LP64_OFF64 = 1;
const String __ILP32_OFF32_CFLAGS = '-m32';
const String __ILP32_OFF32_LDFLAGS = '-m32';
const String __ILP32_OFFBIG_CFLAGS =
'-m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64';
const String __ILP32_OFFBIG_LDFLAGS = '-m32';
const String __LP64_OFF64_CFLAGS = '-m64';
const String __LP64_OFF64_LDFLAGS = '-m64';
const int STDIN_FILENO = 0;
const int STDOUT_FILENO = 1;
const int STDERR_FILENO = 2;
const int R_OK = 4;
const int W_OK = 2;
const int X_OK = 1;
const int F_OK = 0;
const int L_SET = 0;
const int L_INCR = 1;
const int L_XTND = 2;
const int _PC_LINK_MAX = 0;
const int _PC_MAX_CANON = 1;
const int _PC_MAX_INPUT = 2;
const int _PC_NAME_MAX = 3;
const int _PC_PATH_MAX = 4;
const int _PC_PIPE_BUF = 5;
const int _PC_CHOWN_RESTRICTED = 6;
const int _PC_NO_TRUNC = 7;
const int _PC_VDISABLE = 8;
const int _PC_SYNC_IO = 9;
const int _PC_ASYNC_IO = 10;
const int _PC_PRIO_IO = 11;
const int _PC_SOCK_MAXBUF = 12;
const int _PC_FILESIZEBITS = 13;
const int _PC_REC_INCR_XFER_SIZE = 14;
const int _PC_REC_MAX_XFER_SIZE = 15;
const int _PC_REC_MIN_XFER_SIZE = 16;
const int _PC_REC_XFER_ALIGN = 17;
const int _PC_ALLOC_SIZE_MIN = 18;
const int _PC_SYMLINK_MAX = 19;
const int _PC_2_SYMLINKS = 20;
const int _SC_ARG_MAX = 0;
const int _SC_CHILD_MAX = 1;
const int _SC_CLK_TCK = 2;
const int _SC_NGROUPS_MAX = 3;
const int _SC_OPEN_MAX = 4;
const int _SC_STREAM_MAX = 5;
const int _SC_TZNAME_MAX = 6;
const int _SC_JOB_CONTROL = 7;
const int _SC_SAVED_IDS = 8;
const int _SC_REALTIME_SIGNALS = 9;
const int _SC_PRIORITY_SCHEDULING = 10;
const int _SC_TIMERS = 11;
const int _SC_ASYNCHRONOUS_IO = 12;
const int _SC_PRIORITIZED_IO = 13;
const int _SC_SYNCHRONIZED_IO = 14;
const int _SC_FSYNC = 15;
const int _SC_MAPPED_FILES = 16;
const int _SC_MEMLOCK = 17;
const int _SC_MEMLOCK_RANGE = 18;
const int _SC_MEMORY_PROTECTION = 19;
const int _SC_MESSAGE_PASSING = 20;
const int _SC_SEMAPHORES = 21;
const int _SC_SHARED_MEMORY_OBJECTS = 22;
const int _SC_AIO_LISTIO_MAX = 23;
const int _SC_AIO_MAX = 24;
const int _SC_AIO_PRIO_DELTA_MAX = 25;
const int _SC_DELAYTIMER_MAX = 26;
const int _SC_MQ_OPEN_MAX = 27;
const int _SC_MQ_PRIO_MAX = 28;
const int _SC_VERSION = 29;
const int _SC_PAGESIZE = 30;
const int _SC_PAGE_SIZE = 30;
const int _SC_RTSIG_MAX = 31;
const int _SC_SEM_NSEMS_MAX = 32;
const int _SC_SEM_VALUE_MAX = 33;
const int _SC_SIGQUEUE_MAX = 34;
const int _SC_TIMER_MAX = 35;
const int _SC_BC_BASE_MAX = 36;
const int _SC_BC_DIM_MAX = 37;
const int _SC_BC_SCALE_MAX = 38;
const int _SC_BC_STRING_MAX = 39;
const int _SC_COLL_WEIGHTS_MAX = 40;
const int _SC_EQUIV_CLASS_MAX = 41;
const int _SC_EXPR_NEST_MAX = 42;
const int _SC_LINE_MAX = 43;
const int _SC_RE_DUP_MAX = 44;
const int _SC_CHARCLASS_NAME_MAX = 45;
const int _SC_2_VERSION = 46;
const int _SC_2_C_BIND = 47;
const int _SC_2_C_DEV = 48;
const int _SC_2_FORT_DEV = 49;
const int _SC_2_FORT_RUN = 50;
const int _SC_2_SW_DEV = 51;
const int _SC_2_LOCALEDEF = 52;
const int _SC_PII = 53;
const int _SC_PII_XTI = 54;
const int _SC_PII_SOCKET = 55;
const int _SC_PII_INTERNET = 56;
const int _SC_PII_OSI = 57;
const int _SC_POLL = 58;
const int _SC_SELECT = 59;
const int _SC_UIO_MAXIOV = 60;
const int _SC_IOV_MAX = 60;
const int _SC_PII_INTERNET_STREAM = 61;
const int _SC_PII_INTERNET_DGRAM = 62;
const int _SC_PII_OSI_COTS = 63;
const int _SC_PII_OSI_CLTS = 64;
const int _SC_PII_OSI_M = 65;
const int _SC_T_IOV_MAX = 66;
const int _SC_THREADS = 67;
const int _SC_THREAD_SAFE_FUNCTIONS = 68;
const int _SC_GETGR_R_SIZE_MAX = 69;
const int _SC_GETPW_R_SIZE_MAX = 70;
const int _SC_LOGIN_NAME_MAX = 71;
const int _SC_TTY_NAME_MAX = 72;
const int _SC_THREAD_DESTRUCTOR_ITERATIONS = 73;
const int _SC_THREAD_KEYS_MAX = 74;
const int _SC_THREAD_STACK_MIN = 75;
const int _SC_THREAD_THREADS_MAX = 76;
const int _SC_THREAD_ATTR_STACKADDR = 77;
const int _SC_THREAD_ATTR_STACKSIZE = 78;
const int _SC_THREAD_PRIORITY_SCHEDULING = 79;
const int _SC_THREAD_PRIO_INHERIT = 80;
const int _SC_THREAD_PRIO_PROTECT = 81;
const int _SC_THREAD_PROCESS_SHARED = 82;
const int _SC_NPROCESSORS_CONF = 83;
const int _SC_NPROCESSORS_ONLN = 84;
const int _SC_PHYS_PAGES = 85;
const int _SC_AVPHYS_PAGES = 86;
const int _SC_ATEXIT_MAX = 87;
const int _SC_PASS_MAX = 88;
const int _SC_XOPEN_VERSION = 89;
const int _SC_XOPEN_XCU_VERSION = 90;
const int _SC_XOPEN_UNIX = 91;
const int _SC_XOPEN_CRYPT = 92;
const int _SC_XOPEN_ENH_I18N = 93;
const int _SC_XOPEN_SHM = 94;
const int _SC_2_CHAR_TERM = 95;
const int _SC_2_C_VERSION = 96;
const int _SC_2_UPE = 97;
const int _SC_XOPEN_XPG2 = 98;
const int _SC_XOPEN_XPG3 = 99;
const int _SC_XOPEN_XPG4 = 100;
const int _SC_CHAR_BIT = 101;
const int _SC_CHAR_MAX = 102;
const int _SC_CHAR_MIN = 103;
const int _SC_INT_MAX = 104;
const int _SC_INT_MIN = 105;
const int _SC_LONG_BIT = 106;
const int _SC_WORD_BIT = 107;
const int _SC_MB_LEN_MAX = 108;
const int _SC_NZERO = 109;
const int _SC_SSIZE_MAX = 110;
const int _SC_SCHAR_MAX = 111;
const int _SC_SCHAR_MIN = 112;
const int _SC_SHRT_MAX = 113;
const int _SC_SHRT_MIN = 114;
const int _SC_UCHAR_MAX = 115;
const int _SC_UINT_MAX = 116;
const int _SC_ULONG_MAX = 117;
const int _SC_USHRT_MAX = 118;
const int _SC_NL_ARGMAX = 119;
const int _SC_NL_LANGMAX = 120;
const int _SC_NL_MSGMAX = 121;
const int _SC_NL_NMAX = 122;
const int _SC_NL_SETMAX = 123;
const int _SC_NL_TEXTMAX = 124;
const int _SC_XBS5_ILP32_OFF32 = 125;
const int _SC_XBS5_ILP32_OFFBIG = 126;
const int _SC_XBS5_LP64_OFF64 = 127;
const int _SC_XBS5_LPBIG_OFFBIG = 128;
const int _SC_XOPEN_LEGACY = 129;
const int _SC_XOPEN_REALTIME = 130;
const int _SC_XOPEN_REALTIME_THREADS = 131;
const int _SC_ADVISORY_INFO = 132;
const int _SC_BARRIERS = 133;
const int _SC_BASE = 134;
const int _SC_C_LANG_SUPPORT = 135;
const int _SC_C_LANG_SUPPORT_R = 136;
const int _SC_CLOCK_SELECTION = 137;
const int _SC_CPUTIME = 138;
const int _SC_THREAD_CPUTIME = 139;
const int _SC_DEVICE_IO = 140;
const int _SC_DEVICE_SPECIFIC = 141;
const int _SC_DEVICE_SPECIFIC_R = 142;
const int _SC_FD_MGMT = 143;
const int _SC_FIFO = 144;
const int _SC_PIPE = 145;
const int _SC_FILE_ATTRIBUTES = 146;
const int _SC_FILE_LOCKING = 147;
const int _SC_FILE_SYSTEM = 148;
const int _SC_MONOTONIC_CLOCK = 149;
const int _SC_MULTI_PROCESS = 150;
const int _SC_SINGLE_PROCESS = 151;
const int _SC_NETWORKING = 152;
const int _SC_READER_WRITER_LOCKS = 153;
const int _SC_SPIN_LOCKS = 154;
const int _SC_REGEXP = 155;
const int _SC_REGEX_VERSION = 156;
const int _SC_SHELL = 157;
const int _SC_SIGNALS = 158;
const int _SC_SPAWN = 159;
const int _SC_SPORADIC_SERVER = 160;
const int _SC_THREAD_SPORADIC_SERVER = 161;
const int _SC_SYSTEM_DATABASE = 162;
const int _SC_SYSTEM_DATABASE_R = 163;
const int _SC_TIMEOUTS = 164;
const int _SC_TYPED_MEMORY_OBJECTS = 165;
const int _SC_USER_GROUPS = 166;
const int _SC_USER_GROUPS_R = 167;
const int _SC_2_PBS = 168;
const int _SC_2_PBS_ACCOUNTING = 169;
const int _SC_2_PBS_LOCATE = 170;
const int _SC_2_PBS_MESSAGE = 171;
const int _SC_2_PBS_TRACK = 172;
const int _SC_SYMLOOP_MAX = 173;
const int _SC_STREAMS = 174;
const int _SC_2_PBS_CHECKPOINT = 175;
const int _SC_V6_ILP32_OFF32 = 176;
const int _SC_V6_ILP32_OFFBIG = 177;
const int _SC_V6_LP64_OFF64 = 178;
const int _SC_V6_LPBIG_OFFBIG = 179;
const int _SC_HOST_NAME_MAX = 180;
const int _SC_TRACE = 181;
const int _SC_TRACE_EVENT_FILTER = 182;
const int _SC_TRACE_INHERIT = 183;
const int _SC_TRACE_LOG = 184;
const int _SC_LEVEL1_ICACHE_SIZE = 185;
const int _SC_LEVEL1_ICACHE_ASSOC = 186;
const int _SC_LEVEL1_ICACHE_LINESIZE = 187;
const int _SC_LEVEL1_DCACHE_SIZE = 188;
const int _SC_LEVEL1_DCACHE_ASSOC = 189;
const int _SC_LEVEL1_DCACHE_LINESIZE = 190;
const int _SC_LEVEL2_CACHE_SIZE = 191;
const int _SC_LEVEL2_CACHE_ASSOC = 192;
const int _SC_LEVEL2_CACHE_LINESIZE = 193;
const int _SC_LEVEL3_CACHE_SIZE = 194;
const int _SC_LEVEL3_CACHE_ASSOC = 195;
const int _SC_LEVEL3_CACHE_LINESIZE = 196;
const int _SC_LEVEL4_CACHE_SIZE = 197;
const int _SC_LEVEL4_CACHE_ASSOC = 198;
const int _SC_LEVEL4_CACHE_LINESIZE = 199;
const int _SC_IPV6 = 235;
const int _SC_RAW_SOCKETS = 236;
const int _SC_V7_ILP32_OFF32 = 237;
const int _SC_V7_ILP32_OFFBIG = 238;
const int _SC_V7_LP64_OFF64 = 239;
const int _SC_V7_LPBIG_OFFBIG = 240;
const int _SC_SS_REPL_MAX = 241;
const int _SC_TRACE_EVENT_NAME_MAX = 242;
const int _SC_TRACE_NAME_MAX = 243;
const int _SC_TRACE_SYS_MAX = 244;
const int _SC_TRACE_USER_EVENT_MAX = 245;
const int _SC_XOPEN_STREAMS = 246;
const int _SC_THREAD_ROBUST_PRIO_INHERIT = 247;
const int _SC_THREAD_ROBUST_PRIO_PROTECT = 248;
const int _SC_MINSIGSTKSZ = 249;
const int _SC_SIGSTKSZ = 250;
const int _CS_PATH = 0;
const int _CS_V6_WIDTH_RESTRICTED_ENVS = 1;
const int _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1;
const int _CS_GNU_LIBC_VERSION = 2;
const int _CS_GNU_LIBPTHREAD_VERSION = 3;
const int _CS_V5_WIDTH_RESTRICTED_ENVS = 4;
const int _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS = 4;
const int _CS_V7_WIDTH_RESTRICTED_ENVS = 5;
const int _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS = 5;
const int _CS_LFS_CFLAGS = 1000;
const int _CS_LFS_LDFLAGS = 1001;
const int _CS_LFS_LIBS = 1002;
const int _CS_LFS_LINTFLAGS = 1003;
const int _CS_LFS64_CFLAGS = 1004;
const int _CS_LFS64_LDFLAGS = 1005;
const int _CS_LFS64_LIBS = 1006;
const int _CS_LFS64_LINTFLAGS = 1007;
const int _CS_XBS5_ILP32_OFF32_CFLAGS = 1100;
const int _CS_XBS5_ILP32_OFF32_LDFLAGS = 1101;
const int _CS_XBS5_ILP32_OFF32_LIBS = 1102;
const int _CS_XBS5_ILP32_OFF32_LINTFLAGS = 1103;
const int _CS_XBS5_ILP32_OFFBIG_CFLAGS = 1104;
const int _CS_XBS5_ILP32_OFFBIG_LDFLAGS = 1105;
const int _CS_XBS5_ILP32_OFFBIG_LIBS = 1106;
const int _CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 1107;
const int _CS_XBS5_LP64_OFF64_CFLAGS = 1108;
const int _CS_XBS5_LP64_OFF64_LDFLAGS = 1109;
const int _CS_XBS5_LP64_OFF64_LIBS = 1110;
const int _CS_XBS5_LP64_OFF64_LINTFLAGS = 1111;
const int _CS_XBS5_LPBIG_OFFBIG_CFLAGS = 1112;
const int _CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 1113;
const int _CS_XBS5_LPBIG_OFFBIG_LIBS = 1114;
const int _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 1115;
const int _CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116;
const int _CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117;
const int _CS_POSIX_V6_ILP32_OFF32_LIBS = 1118;
const int _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS = 1119;
const int _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120;
const int _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121;
const int _CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122;
const int _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS = 1123;
const int _CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124;
const int _CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125;
const int _CS_POSIX_V6_LP64_OFF64_LIBS = 1126;
const int _CS_POSIX_V6_LP64_OFF64_LINTFLAGS = 1127;
const int _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128;
const int _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129;
const int _CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130;
const int _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS = 1131;
const int _CS_POSIX_V7_ILP32_OFF32_CFLAGS = 1132;
const int _CS_POSIX_V7_ILP32_OFF32_LDFLAGS = 1133;
const int _CS_POSIX_V7_ILP32_OFF32_LIBS = 1134;
const int _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS = 1135;
const int _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS = 1136;
const int _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS = 1137;
const int _CS_POSIX_V7_ILP32_OFFBIG_LIBS = 1138;
const int _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS = 1139;
const int _CS_POSIX_V7_LP64_OFF64_CFLAGS = 1140;
const int _CS_POSIX_V7_LP64_OFF64_LDFLAGS = 1141;
const int _CS_POSIX_V7_LP64_OFF64_LIBS = 1142;
const int _CS_POSIX_V7_LP64_OFF64_LINTFLAGS = 1143;
const int _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS = 1144;
const int _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS = 1145;
const int _CS_POSIX_V7_LPBIG_OFFBIG_LIBS = 1146;
const int _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS = 1147;
const int _CS_V6_ENV = 1148;
const int _CS_V7_ENV = 1149;
const int _GETOPT_POSIX_H = 1;
const int _GETOPT_CORE_H = 1;
const int F_ULOCK = 0;
const int F_LOCK = 1;
const int F_TLOCK = 2;
const int F_TEST = 3;
const int CLOSE_RANGE_UNSHARE = 2;
const int CLOSE_RANGE_CLOEXEC = 4;
const String PATH_SPLITTER = ':';
const int _GLIBCXX_BITSET = 1;
const int _GLIBCXX_CHRONO = 1;
const int _GLIBCXX_THREAD = 1;
const int _GLIBCXX_THREAD_H = 1;
const int _GLIBCXX_THIS_THREAD_SLEEP_H = 1;

BIN
assets/test/frames/0001.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 KiB

1
example/linux/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
flutter/ephemeral

View File

@ -0,0 +1,145 @@
# Project-level configuration.
cmake_minimum_required(VERSION 3.10)
project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "archimedes_mobile_lib_example")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.archimedes_mobile_lib")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
cmake_policy(SET CMP0063 NEW)
# Load bundled libraries from the lib/ directory relative to the binary.
set(CMAKE_INSTALL_RPATH "$ORIGIN/lib")
# Root filesystem for cross-building.
if(FLUTTER_TARGET_PLATFORM_SYSROOT)
set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT})
set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()
# Define build configuration options.
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Debug" CACHE
STRING "Flutter build mode" FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Profile" "Release")
endif()
# Compilation settings that should be applied to most targets.
#
# Be cautious about adding new options here, as plugins use this function by
# default. In most cases, you should add new options to specific targets instead
# of modifying this function.
function(APPLY_STANDARD_SETTINGS TARGET)
target_compile_features(${TARGET} PUBLIC cxx_std_14)
target_compile_options(${TARGET} PRIVATE -Wall -Werror)
target_compile_options(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>")
target_compile_definitions(${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>")
endfunction()
# Flutter library and tool build rules.
set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter")
add_subdirectory(${FLUTTER_MANAGED_DIR})
# System-level dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}")
# Define the application target. To change its name, change BINARY_NAME above,
# not the value here, or `flutter run` will no longer work.
#
# Any new source files that you add to the application should be added here.
add_executable(${BINARY_NAME}
"main.cc"
"my_application.cc"
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
)
# Apply the standard set of build settings. This can be removed for applications
# that need different build settings.
apply_standard_settings(${BINARY_NAME})
# Add dependency libraries. Add any application-specific dependencies here.
target_link_libraries(${BINARY_NAME} PRIVATE flutter)
target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK)
# Run the Flutter tool portions of the build. This must not be removed.
add_dependencies(${BINARY_NAME} flutter_assemble)
# Only the install-generated bundle's copy of the executable will launch
# correctly, since the resources must in the right relative locations. To avoid
# people trying to run the unbundled copy, put it in a subdirectory instead of
# the default top-level location.
set_target_properties(${BINARY_NAME}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run"
)
# Generated plugin build rules, which manage building the plugins and adding
# them to the application.
include(flutter/generated_plugins.cmake)
# === Installation ===
# By default, "installing" just makes a relocatable bundle in the build
# directory.
set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE)
endif()
# Start with a clean build bundle directory every time.
install(CODE "
file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\")
" COMPONENT Runtime)
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime)
install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
COMPONENT Runtime)
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES})
install(FILES "${bundled_library}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endforeach(bundled_library)
# Copy the native assets provided by the build.dart from all packages.
set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/linux/")
install(DIRECTORY "${NATIVE_ASSETS_DIR}"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
# Fully re-copy the assets directory on each build to avoid having stale files
# from a previous install.
set(FLUTTER_ASSET_DIR_NAME "flutter_assets")
install(CODE "
file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\")
" COMPONENT Runtime)
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
# Install the AOT library on non-Debug builds only.
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
endif()

View File

@ -0,0 +1,88 @@
# This file controls Flutter-level build steps. It should not be edited.
cmake_minimum_required(VERSION 3.10)
set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral")
# Configuration provided via flutter tool.
include(${EPHEMERAL_DIR}/generated_config.cmake)
# TODO: Move the rest of this into files in ephemeral. See
# https://github.com/flutter/flutter/issues/57146.
# Serves the same purpose as list(TRANSFORM ... PREPEND ...),
# which isn't available in 3.10.
function(list_prepend LIST_NAME PREFIX)
set(NEW_LIST "")
foreach(element ${${LIST_NAME}})
list(APPEND NEW_LIST "${PREFIX}${element}")
endforeach(element)
set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE)
endfunction()
# === Flutter Library ===
# System-level dependencies.
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0)
set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so")
# Published to parent scope for install step.
set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE)
set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE)
set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE)
set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE)
list(APPEND FLUTTER_LIBRARY_HEADERS
"fl_basic_message_channel.h"
"fl_binary_codec.h"
"fl_binary_messenger.h"
"fl_dart_project.h"
"fl_engine.h"
"fl_json_message_codec.h"
"fl_json_method_codec.h"
"fl_message_codec.h"
"fl_method_call.h"
"fl_method_channel.h"
"fl_method_codec.h"
"fl_method_response.h"
"fl_plugin_registrar.h"
"fl_plugin_registry.h"
"fl_standard_message_codec.h"
"fl_standard_method_codec.h"
"fl_string_codec.h"
"fl_value.h"
"fl_view.h"
"flutter_linux.h"
)
list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/")
add_library(flutter INTERFACE)
target_include_directories(flutter INTERFACE
"${EPHEMERAL_DIR}"
)
target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}")
target_link_libraries(flutter INTERFACE
PkgConfig::GTK
PkgConfig::GLIB
PkgConfig::GIO
)
add_dependencies(flutter flutter_assemble)
# === Flutter tool backend ===
# _phony_ is a non-existent file to force this command to run every time,
# since currently there's no way to get a full input/output list from the
# flutter tool.
add_custom_command(
OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/_phony_
COMMAND ${CMAKE_COMMAND} -E env
${FLUTTER_TOOL_ENVIRONMENT}
"${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh"
${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE}
VERBATIM
)
add_custom_target(flutter_assemble DEPENDS
"${FLUTTER_LIBRARY}"
${FLUTTER_LIBRARY_HEADERS}
)

6
example/linux/main.cc Normal file
View File

@ -0,0 +1,6 @@
#include "my_application.h"
int main(int argc, char** argv) {
g_autoptr(MyApplication) app = my_application_new();
return g_application_run(G_APPLICATION(app), argc, argv);
}

View File

@ -0,0 +1,124 @@
#include "my_application.h"
#include <flutter_linux/flutter_linux.h>
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
#endif
#include "flutter/generated_plugin_registrant.h"
struct _MyApplication {
GtkApplication parent_instance;
char** dart_entrypoint_arguments;
};
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
// Implements GApplication::activate.
static void my_application_activate(GApplication* application) {
MyApplication* self = MY_APPLICATION(application);
GtkWindow* window =
GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application)));
// Use a header bar when running in GNOME as this is the common style used
// by applications and is the setup most users will be using (e.g. Ubuntu
// desktop).
// If running on X and not using GNOME then just use a traditional title bar
// in case the window manager does more exotic layout, e.g. tiling.
// If running on Wayland assume the header bar will work (may need changing
// if future cases occur).
gboolean use_header_bar = TRUE;
#ifdef GDK_WINDOWING_X11
GdkScreen* screen = gtk_window_get_screen(window);
if (GDK_IS_X11_SCREEN(screen)) {
const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen);
if (g_strcmp0(wm_name, "GNOME Shell") != 0) {
use_header_bar = FALSE;
}
}
#endif
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "archimedes_mobile_lib_example");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else {
gtk_window_set_title(window, "archimedes_mobile_lib_example");
}
gtk_window_set_default_size(window, 1280, 720);
gtk_widget_show(GTK_WIDGET(window));
g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments);
FlView* view = fl_view_new(project);
gtk_widget_show(GTK_WIDGET(view));
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
fl_register_plugins(FL_PLUGIN_REGISTRY(view));
gtk_widget_grab_focus(GTK_WIDGET(view));
}
// Implements GApplication::local_command_line.
static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) {
MyApplication* self = MY_APPLICATION(application);
// Strip out the first argument as it is the binary name.
self->dart_entrypoint_arguments = g_strdupv(*arguments + 1);
g_autoptr(GError) error = nullptr;
if (!g_application_register(application, nullptr, &error)) {
g_warning("Failed to register: %s", error->message);
*exit_status = 1;
return TRUE;
}
g_application_activate(application);
*exit_status = 0;
return TRUE;
}
// Implements GApplication::startup.
static void my_application_startup(GApplication* application) {
//MyApplication* self = MY_APPLICATION(object);
// Perform any actions required at application startup.
G_APPLICATION_CLASS(my_application_parent_class)->startup(application);
}
// Implements GApplication::shutdown.
static void my_application_shutdown(GApplication* application) {
//MyApplication* self = MY_APPLICATION(object);
// Perform any actions required at application shutdown.
G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application);
}
// Implements GObject::dispose.
static void my_application_dispose(GObject* object) {
MyApplication* self = MY_APPLICATION(object);
g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev);
G_OBJECT_CLASS(my_application_parent_class)->dispose(object);
}
static void my_application_class_init(MyApplicationClass* klass) {
G_APPLICATION_CLASS(klass)->activate = my_application_activate;
G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line;
G_APPLICATION_CLASS(klass)->startup = my_application_startup;
G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown;
G_OBJECT_CLASS(klass)->dispose = my_application_dispose;
}
static void my_application_init(MyApplication* self) {}
MyApplication* my_application_new() {
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID,
"flags", G_APPLICATION_NON_UNIQUE,
nullptr));
}

View File

@ -0,0 +1,18 @@
#ifndef FLUTTER_MY_APPLICATION_H_
#define FLUTTER_MY_APPLICATION_H_
#include <gtk/gtk.h>
G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
GtkApplication)
/**
* my_application_new:
*
* Creates a new Flutter-based application.
*
* Returns: a new #MyApplication.
*/
MyApplication* my_application_new();
#endif // FLUTTER_MY_APPLICATION_H_

View File

@ -1,15 +1,16 @@
# Run with `flutter pub run ffigen --config ffigen.yaml`.
name: ArchimedesMobileLibBindings
description: |
Bindings for `src/archimedes_mobile_lib.h`.
Bindings for `src/image.h`.
Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`.
output: 'lib/archimedes_mobile_lib_bindings_generated.dart'
compiler-opts: '-I/usr/include -L /usr/lib/ -lpng'
headers:
entry-points:
- 'src/archimedes_mobile_lib.h'
- 'src/image.h'
include-directives:
- 'src/archimedes_mobile_lib.h'
- 'src/image.h'
preamble: |
// ignore_for_file: always_specify_types
// ignore_for_file: camel_case_types

View File

@ -1,131 +1,59 @@
import 'dart:async';
// import 'dart:async';
import 'dart:ffi';
import 'dart:io';
import 'dart:isolate';
import 'dart:typed_data';
// import 'dart:isolate';
// import 'dart:ui';
import "package:ffi/ffi.dart";
import "package:path/path.dart" show dirname, join;
import 'dart:io' show Platform;
import 'archimedes_mobile_lib_bindings_generated.dart';
/// A very short-lived native function.
///
/// For very short-lived functions, it is fine to call them on the main isolate.
/// They will block the Dart execution while running the native function, so
/// only do this for native functions which are guaranteed to be short-lived.
int sum(int a, int b) => _bindings.sum(a, b);
/// A longer lived native function, which occupies the thread calling it.
///
/// Do not call these kind of native functions in the main isolate. They will
/// block Dart execution. This will cause dropped frames in Flutter applications.
/// Instead, call these native functions on a separate isolate.
///
/// Modify this to suit your own use case. Example use cases:
///
/// 1. Reuse a single isolate for various different kinds of requests.
/// 2. Use multiple helper isolates for parallel execution.
Future<int> sumAsync(int a, int b) async {
final SendPort helperIsolateSendPort = await _helperIsolateSendPort;
final int requestId = _nextSumRequestId++;
final _SumRequest request = _SumRequest(requestId, a, b);
final Completer<int> completer = Completer<int>();
_sumRequests[requestId] = completer;
helperIsolateSendPort.send(request);
return completer.future;
}
const String _libName = 'archimedes_mobile_lib';
final here = dirname(Platform.script.path);
final build = join(dirname(here), "build");
/// The dynamic library in which the symbols for [ArchimedesMobileLibBindings] can be found.
final DynamicLibrary _dylib = () {
if (Platform.isMacOS || Platform.isIOS) {
return DynamicLibrary.open('$_libName.framework/$_libName');
return DynamicLibrary.open(join(build, '$_libName.framework', _libName));
}
if (Platform.isAndroid || Platform.isLinux) {
return DynamicLibrary.open('lib$_libName.so');
return DynamicLibrary.open(join(build, 'lib$_libName.so'));
}
if (Platform.isWindows) {
return DynamicLibrary.open('$_libName.dll');
return DynamicLibrary.open(join('$_libName.dll'));
}
throw UnsupportedError('Unknown platform: ${Platform.operatingSystem}');
}();
/// The bindings to the native functions in [_dylib].
final ArchimedesMobileLibBindings _bindings = ArchimedesMobileLibBindings(_dylib);
final ArchimedesMobileLibBindings _bindings =
ArchimedesMobileLibBindings(_dylib);
int getImageData(Pointer<Frame> frame, Pointer<UnsignedChar> data) =>
_bindings.archimedes_get_image_data(frame, data);
/// A request to compute `sum`.
///
/// Typically sent from one isolate to another.
class _SumRequest {
final int id;
final int a;
final int b;
Pointer<Frame> newFrame(
Pointer<Uint8> data, int dataLen, int w, int h, int depth) =>
_bindings.new_frame_from_data(data, dataLen, w, h, depth);
const _SumRequest(this.id, this.a, this.b);
void main(List<String> arguments) {
final assets = join(dirname(here), "assets");
final testFrames = join(assets, "test", "frames");
final firstFrame = join(testFrames, "0001.png");
final f = File(firstFrame);
final l = f.readAsBytesSync().cast();
final myPointer = malloc<Uint8>(l.length);
for (int i = 0; i < l.length; ++i) {
myPointer[i] = l[i];
print(myPointer[i]);
}
Pointer<Frame> frame = newFrame(myPointer, l.length, 768, 768, 64);
Pointer<UnsignedChar> data = malloc<UnsignedChar>(l.length * 4);
getImageData(frame, data);
}
/// A response with the result of `sum`.
///
/// Typically sent from one isolate to another.
class _SumResponse {
final int id;
final int result;
const _SumResponse(this.id, this.result);
}
/// Counter to identify [_SumRequest]s and [_SumResponse]s.
int _nextSumRequestId = 0;
/// Mapping from [_SumRequest] `id`s to the completers corresponding to the correct future of the pending request.
final Map<int, Completer<int>> _sumRequests = <int, Completer<int>>{};
/// The SendPort belonging to the helper isolate.
Future<SendPort> _helperIsolateSendPort = () async {
// The helper isolate is going to send us back a SendPort, which we want to
// wait for.
final Completer<SendPort> completer = Completer<SendPort>();
// Receive port on the main isolate to receive messages from the helper.
// We receive two types of messages:
// 1. A port to send messages on.
// 2. Responses to requests we sent.
final ReceivePort receivePort = ReceivePort()
..listen((dynamic data) {
if (data is SendPort) {
// The helper isolate sent us the port on which we can sent it requests.
completer.complete(data);
return;
}
if (data is _SumResponse) {
// The helper isolate sent us a response to a request we sent.
final Completer<int> completer = _sumRequests[data.id]!;
_sumRequests.remove(data.id);
completer.complete(data.result);
return;
}
throw UnsupportedError('Unsupported message type: ${data.runtimeType}');
});
// Start the helper isolate.
await Isolate.spawn((SendPort sendPort) async {
final ReceivePort helperReceivePort = ReceivePort()
..listen((dynamic data) {
// On the helper isolate listen to requests and respond to them.
if (data is _SumRequest) {
final int result = _bindings.sum_long_running(data.a, data.b);
final _SumResponse response = _SumResponse(data.id, result);
sendPort.send(response);
return;
}
throw UnsupportedError('Unsupported message type: ${data.runtimeType}');
});
// Send the port to the main isolate on which we can receive requests.
sendPort.send(helperReceivePort.sendPort);
}, receivePort.sendPort);
// Wait until the helper isolate has sent us back the SendPort on which we
// can start sending requests.
return completer.future;
}();

View File

@ -8,7 +8,7 @@
// ignore_for_file: type=lint
import 'dart:ffi' as ffi;
/// Bindings for `src/archimedes_mobile_lib.h`.
/// Bindings for `src/image.h`.
///
/// Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`.
///
@ -27,44 +27,164 @@ class ArchimedesMobileLibBindings {
lookup)
: _lookup = lookup;
/// A very short-lived native function.
///
/// For very short-lived functions, it is fine to call them on the main isolate.
/// They will block the Dart execution while running the native function, so
/// only do this for native functions which are guaranteed to be short-lived.
int sum(
int a,
int b,
ffi.Pointer<Frame> new_frame_from_handle(
ffi.Pointer<FILE> arg0,
int arg1,
int arg2,
int arg3,
) {
return _sum(
a,
b,
return _new_frame_from_handle(
arg0,
arg1,
arg2,
arg3,
);
}
late final _sumPtr =
_lookup<ffi.NativeFunction<ffi.IntPtr Function(ffi.IntPtr, ffi.IntPtr)>>(
'sum');
late final _sum = _sumPtr.asFunction<int Function(int, int)>();
late final _new_frame_from_handlePtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<Frame> Function(ffi.Pointer<FILE>, ffi.Int, ffi.Int,
ffi.Int)>>('new_frame_from_handle');
late final _new_frame_from_handle = _new_frame_from_handlePtr.asFunction<
ffi.Pointer<Frame> Function(ffi.Pointer<FILE>, int, int, int)>();
/// A longer lived native function, which occupies the thread calling it.
///
/// Do not call these kind of native functions in the main isolate. They will
/// block Dart execution. This will cause dropped frames in Flutter applications.
/// Instead, call these native functions on a separate isolate.
int sum_long_running(
int a,
int b,
ffi.Pointer<Frame> new_frame_from_data(
ffi.Pointer<ffi.Uint8> arg0,
int arg1,
int arg2,
int arg3,
int arg4,
) {
return _sum_long_running(
a,
b,
return _new_frame_from_data(
arg0,
arg1,
arg2,
arg3,
arg4,
);
}
late final _sum_long_runningPtr =
_lookup<ffi.NativeFunction<ffi.IntPtr Function(ffi.IntPtr, ffi.IntPtr)>>(
'sum_long_running');
late final _sum_long_running =
_sum_long_runningPtr.asFunction<int Function(int, int)>();
late final _new_frame_from_dataPtr = _lookup<
ffi.NativeFunction<
ffi.Pointer<Frame> Function(ffi.Pointer<ffi.Uint8>, ffi.Size, ffi.Int,
ffi.Int, ffi.Int)>>('new_frame_from_data');
late final _new_frame_from_data = _new_frame_from_dataPtr.asFunction<
ffi.Pointer<Frame> Function(
ffi.Pointer<ffi.Uint8>, int, int, int, int)>();
int archimedes_get_image_data(
ffi.Pointer<Frame> arg0,
ffi.Pointer<ffi.UnsignedChar> arg1,
) {
return _archimedes_get_image_data(
arg0,
arg1,
);
}
late final _archimedes_get_image_dataPtr = _lookup<
ffi.NativeFunction<
ffi.Int Function(ffi.Pointer<Frame>,
ffi.Pointer<ffi.UnsignedChar>)>>('archimedes_get_image_data');
late final _archimedes_get_image_data =
_archimedes_get_image_dataPtr.asFunction<
int Function(ffi.Pointer<Frame>, ffi.Pointer<ffi.UnsignedChar>)>();
}
final class _Frame extends ffi.Struct {
external ffi.Pointer<FILE> stream;
@ffi.Int()
external int w;
@ffi.Int()
external int h;
@ffi.Int()
external int depth;
}
typedef FILE = _IO_FILE;
final class _IO_FILE extends ffi.Struct {
@ffi.Int()
external int _flags;
external ffi.Pointer<ffi.Char> _IO_read_ptr;
external ffi.Pointer<ffi.Char> _IO_read_end;
external ffi.Pointer<ffi.Char> _IO_read_base;
external ffi.Pointer<ffi.Char> _IO_write_base;
external ffi.Pointer<ffi.Char> _IO_write_ptr;
external ffi.Pointer<ffi.Char> _IO_write_end;
external ffi.Pointer<ffi.Char> _IO_buf_base;
external ffi.Pointer<ffi.Char> _IO_buf_end;
external ffi.Pointer<ffi.Char> _IO_save_base;
external ffi.Pointer<ffi.Char> _IO_backup_base;
external ffi.Pointer<ffi.Char> _IO_save_end;
external ffi.Pointer<_IO_marker> _markers;
external ffi.Pointer<_IO_FILE> _chain;
@ffi.Int()
external int _fileno;
@ffi.Int()
external int _flags2;
@__off_t()
external int _old_offset;
@ffi.UnsignedShort()
external int _cur_column;
@ffi.SignedChar()
external int _vtable_offset;
@ffi.Array.multi([1])
external ffi.Array<ffi.Char> _shortbuf;
external ffi.Pointer<_IO_lock_t> _lock;
@__off64_t()
external int _offset;
external ffi.Pointer<_IO_codecvt> _codecvt;
external ffi.Pointer<_IO_wide_data> _wide_data;
external ffi.Pointer<_IO_FILE> _freeres_list;
external ffi.Pointer<ffi.Void> _freeres_buf;
@ffi.Size()
external int __pad5;
@ffi.Int()
external int _mode;
@ffi.Array.multi([20])
external ffi.Array<ffi.Char> _unused2;
}
final class _IO_marker extends ffi.Opaque {}
typedef __off_t = ffi.Long;
typedef _IO_lock_t = ffi.Void;
typedef __off64_t = ffi.Long;
final class _IO_codecvt extends ffi.Opaque {}
final class _IO_wide_data extends ffi.Opaque {}
typedef Frame = _Frame;

26
scripts/compilelib.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
BUILD_DIR=$(realpath $DIR/../build)
SRC_DIR=$(realpath $DIR/../src)
CMAKE_INSTALL_PREFIX=$(realpath $DIR/../../openMVG/build/_install)
ls $BUILD_DIR
set -e
printf "\033c"
cd ${BUILD_DIR}
cmake \
${SRC_DIR}\
-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}\
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
make
set +e

13
scripts/dartffi.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
ROOT_DIR=$(realpath ${DIR}/..)
cd -P ${ROOT_DIR} && dart run ffigen --config ffigen.yaml

14
scripts/watch_compilelib.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SRC_DIR=$(realpath ${DIR}/../src)
find ${SRC_DIR} -name "*.c" -o -name "*.h" -o -name "CMakeLists.txt" | \
entr -r ${DIR}/compilelib.sh

14
scripts/watch_dartffi.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
SOURCE=${BASH_SOURCE[0]}
while [ -L "$SOURCE" ]; do
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SOURCE=$(readlink "$SOURCE")
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
done
DIR=$(cd -P "$(dirname "$SOURCE")" >/dev/null 2>&1 && pwd)
SRC_DIR=$(realpath ${DIR}/../src)
find ${SRC_DIR} -name "*.c" -o -name "*.h" -o -name "CMakeLists.txt" | \
entr -r ${DIR}/dartffi.sh

View File

@ -2,30 +2,83 @@
# installed. You should not increase this version, as doing so will cause
# the plugin to fail to compile for some customers of the plugin.
cmake_minimum_required(VERSION 3.10)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
include(ExternalProject)
function(dump_cmake_variables)
get_cmake_property(_variableNames VARIABLES)
list (SORT _variableNames)
foreach (_variableName ${_variableNames})
if (ARGV0)
unset(MATCHED)
project(archimedes_mobile_lib_library VERSION 0.0.1 LANGUAGES C)
#case sensitive match
# string(REGEX MATCH ${ARGV0} MATCHED ${_variableName})
#
#case insenstitive match
string( TOLOWER "${ARGV0}" ARGV0_lower )
string( TOLOWER "${_variableName}" _variableName_lower )
string(REGEX MATCH ${ARGV0_lower} MATCHED ${_variableName_lower})
ExternalProject_Add(openMVG
GIT_REPOSITORY "git@github.com:src-r-r/openMVG.git"
GIT_TAG "develop"
SOURCE_SUBDIR "src"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_BUILD_DIR} -DCMAKE_INCLUDE-PATH=${CMAKE_BUILD_DIR}/include"
PREFIX ${CMAKE_BUILD_DIR}
INSTALL_DIR ${CMAKE_BUILD_DIR}
if (NOT MATCHED)
continue()
endif()
endif()
message(STATUS "${_variableName}=${${_variableName}}")
endforeach()
endfunction()
project(archimedes_mobile_lib_library VERSION 0.0.1 LANGUAGES CXX)
set (OPENMVG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../openMVG/src)
set (FFMPEG_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/../../ffmpeg_install/include)
set (ARCHIMEDES_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR})
find_package(
OpenMVG
REQUIRED
)
set(PNG_SHARED ON CACHE BOOL "" FORCE)
set(PNG_STATIC OFF CACHE BOOL "" FORCE)
set(PNG_EXECUTABLES OFF CACHE BOOL "" FORCE) # we only want lib
set(PNG_TESTS OFF CACHE BOOL "" FORCE) # we only want lib
set(SKIP_INSTALL_ALL OFF CACHE BOOL "" FORCE) # we only want lib
# find_package(PNG
# REQUIRED
# HINTS "../"
# )
add_definitions(${PNG_DEFINITIONS})
add_library(archimedes_mobile_lib SHARED
"archimedes_mobile_lib.c"
"image.cxx"
)
target_link_libraries(archimedes_mobile_lib ${OPENMVG_LIBRARIES})
include_directories(${OPENMVG_INCLUDE_DIRS})
set_target_properties(archimedes_mobile_lib PROPERTIES
PUBLIC_HEADER archimedes_mobile_lib.h
dump_cmake_variables("^png")
message("LIBRARIES:" ${OpenMVG_LIBRARIES})
target_link_libraries(
archimedes_mobile_lib
${CMAKE_CURRENT_SOURCE_DIR}/../../libpng/_install/lib/libpng16.so
${CMAKE_CURRENT_SOURCE_DIR}/../../openMVG/build/_install/lib/libopenMVG_image.a
${OPENMVG_LIBRARIES}
)
include_directories(
${FFMPEG_INCLUDE_DIRS}
${OPENMVG_INCLUDE_DIRS}
${ARCHIMEDES_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
)
set_target_properties(archimedes_mobile_lib
PROPERTIES
PUBLIC_HEADER image.h
OUTPUT_NAME "archimedes_mobile_lib"
)
target_link_options(archimedes_mobile_lib PRIVATE "-Wl,-Bstatic")
target_link_options(archimedes_mobile_lib PRIVATE "-Wl,-Bdynamic")
target_compile_definitions(archimedes_mobile_lib PUBLIC DART_SHARED_LIB)
target_compile_definitions(archimedes_mobile_lib PUBLIC DART_SHARED_LIB)

71
src/image.cxx Normal file
View File

@ -0,0 +1,71 @@
#include "./image.h"
#ifdef __cplusplus
#include <openMVG/image/image_io.hpp>
#include <openMVG/image/image_concat.hpp>
#endif // __ cplusplus
const Frame *new_frame_from_handle(FILE *stream, int w, int h, int depth)
{
Frame *f = (Frame *)malloc(sizeof(Frame));
f->stream = stream;
f->w = w;
f->h = h;
f->depth = depth;
return f;
}
FILE *make_buffer(const uint8_t *data, const size_t data_len)
{
FILE *file = fmemopen((char *)data, data_len, "r+");
if (file == NULL)
{
perror("Error opening file");
return NULL;
}
// Seek to the beginning of the file
rewind(file);
// Write the data to the file
fwrite(data, sizeof(uint8_t), data_len, file);
return file;
}
#ifdef __cplusplus
extern "C" __attribute__((visibility("default"))) __attribute((used))
#else
__attribute__((visibility("default"))) __attribute((used))
#endif // __cplusplus
const Frame *
new_frame_from_data(const uint8_t *data, const size_t data_len, int w, int h, int depth)
{
FILE *buf = make_buffer(data, data_len);
return new_frame_from_handle(buf, w, h, depth);
}
#ifdef __cplusplus
extern "C" int Archimedes::get_image_data(const Frame *frame, unsigned char *data)
{
std::vector<unsigned char> imageData;
openMVG::image::ReadPngStream(frame->stream, &imageData, (int *)&(frame->w), (int *)&(frame->h), (int *)&(frame->depth));
data = (unsigned char *)calloc(imageData.size(), sizeof(imageData[0]));
memcpy(data, imageData.data(), imageData.size() * sizeof(imageData[0]));
return 1;
}
#endif
#ifdef __cplusplus
extern "C" __attribute__((visibility("default"))) __attribute((used))
#else
__attribute__((visibility("default"))) __attribute((used))
#endif // __cplusplus
int
archimedes_get_image_data(const Frame *frame, unsigned char *data)
{
return Archimedes::get_image_data(frame, data);
}

54
src/image.h Normal file
View File

@ -0,0 +1,54 @@
#ifdef __cplusplus
#include <openMVG/image/image_io.hpp>
#include <openMVG/image/image_concat.hpp>
#include <openMVG/vector_graphics/svgDrawer.hpp>
#include <openMVG/features/feature.hpp>
#include <forward_list>
#include <openMVG/sfm/sfm.hpp>
#include <openMVG/features/mser/mser.hpp>
#endif // __cplusplus
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <png.h>
extern "C" auto png_sig_cm = png_sig_cmp;
typedef struct _Frame
{
FILE *stream;
int w;
int h;
int depth;
} Frame;
const Frame *new_frame_from_handle(FILE *, int, int, int);
#ifdef __cplusplus
extern "C" __attribute__((visibility("default"))) __attribute((used))
#else
__attribute__((visibility("default"))) __attribute((used))
#endif // __cplusplus
const Frame *
new_frame_from_data(const uint8_t *, const size_t, int, int, int);
#ifdef __cplusplus
typedef openMVG::image::Image<openMVG::image::RGBColor> RgbImage;
typedef std::vector<openMVG::features::AffinePointFeature> FeatureVector;
typedef openMVG::image::Image<unsigned char> UImage;
typedef std::vector<openMVG::features::MSER::MSERRegion> RegionVector;
typedef openMVG::sfm::SfM_Data Sfm_Data;
extern "C" namespace Archimedes
{
int get_image_data(const Frame *, unsigned char *data);
}
#endif
#ifdef __cplusplus
extern "C" __attribute__((visibility("default"))) __attribute((used))
#else
__attribute__((visibility("default"))) __attribute((used))
#endif // __cplusplus
int
archimedes_get_image_data(const Frame *, unsigned char *);