I've an OpenSUSE OS and want to compile GCC from scratch. I want to compile 4.9.1 version because of the c++11 support. I am following this guide here. I am using gcc version 4.8.3 for compilation. After executing make, I get following errors;
libtool: compile: /mnt/disk2/gccWork-Ozgur/4.9.1-objdir/./gcc/xgcc -shared-libgcc -B/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/./gcc -nostdinc++ -L/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/x86_64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/mnt/disk2/gccWork-Ozgur/4.9.1-install/x86_64-unknown-linux-gnu/bin/ -B/mnt/disk2/gccWork-Ozgur/4.9.1-install/x86_64-unknown-linux-gnu/lib/ -isystem /mnt/disk2/gccWork-Ozgur/4.9.1-install/x86_64-unknown-linux-gnu/include -isystem /mnt/disk2/gccWork-Ozgur/4.9.1-install/x86_64-unknown-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I. -I../../../../gcc-4.9.1/libsanitizer/sanitizer_common -I.. -I ../../../../gcc-4.9.1/libsanitizer/include -isystem ../../../../gcc-4.9.1/libsanitizer/include/system -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/x86_64-unknown-linux-gnu -I../../../../gcc-4.9.1/libsanitizer/../libstdc++-v3/libsupc++ -DSANITIZER_LIBBACKTRACE -DSANITIZER_CP_DEMANGLE -I ../../../../gcc-4.9.1/libsanitizer/../libbacktrace -I ../libbacktrace -I ../../../../gcc-4.9.1/libsanitizer/../include -include ../../../../gcc-4.9.1/libsanitizer/libbacktrace/backtrace-rename.h -g -O2 -D_GNU_SOURCE -MT sanitizer_platform_limits_posix.lo -MD -MP -MF .deps/sanitizer_platform_limits_posix.Tpo -c ../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc -fPIC -DPIC -o .libs/sanitizer_platform_limits_posix.o
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:232:27: error: ‘PTRACE_GETSIGINFO’ was not declared in this scope
int ptrace_getsiginfo = PTRACE_GETSIGINFO;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:233:27: error: ‘PTRACE_SETSIGINFO’ was not declared in this scope
int ptrace_setsiginfo = PTRACE_SETSIGINFO;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:390:30: error: ‘EVIOCGREP’ was not declared in this scope
unsigned IOCTL_EVIOCGREP = EVIOCGREP;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:399:30: error: ‘EVIOCSREP’ was not declared in this scope
unsigned IOCTL_EVIOCSREP = EVIOCSREP;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:682:36: error: ‘FS_IOC_GETFLAGS’ was not declared in this scope
unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:683:38: error: ‘FS_IOC_GETVERSION’ was not declared in this scope
unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:684:36: error: ‘FS_IOC_SETFLAGS’ was not declared in this scope
unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS;
^
../../../../gcc-4.9.1/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:685:38: error: ‘FS_IOC_SETVERSION’ was not declared in this scope
unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION;
^
make[4]: *** [sanitizer_platform_limits_posix.lo] Error 1
make[4]: Leaving directory `/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/x86_64-unknown-linux-gnu/libsanitizer/sanitizer_common'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/x86_64-unknown-linux-gnu/libsanitizer'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/disk2/gccWork-Ozgur/4.9.1-objdir/x86_64-unknown-linux-gnu/libsanitizer'
make[1]: *** [all-target-libsanitizer] Error 2
make[1]: Leaving directory `/mnt/disk2/gccWork-Ozgur/4.9.1-objdir'
make: *** [all] Error 2
Any help is appreciated. Thank you
Related
OS - RedHat 8.5, kernel 4.18.0-348.20.1.el8_5.x86_64, gcc-8.5.0
I have installed kernel-devel and kernel-headers, and tried to build a very simple kernel module (just a pair of printk()).
Makefile:
obj-m += test_mod.o
MSRC ?= $(PWD)
KDIR ?= /lib/modules/`uname -r`/build/
all:
make -C $(KDIR) M=$(MSRC) modules
clean:
make -C $(KDIR) M=$(MSRC) clean
However I'm getting error:
% make V=1
make -C /lib/modules/`uname -r`/build M= modules
make[1]: Entering directory '/usr/src/kernels/4.18.0-348.20.1.el8_5.x86_64'
arch/x86/Makefile:249: *** You are building kernel with non-retpoline compiler, please update your compiler.. Stop.
make[1]: Leaving directory '/usr/src/kernels/4.18.0-348.20.1.el8_5.x86_64'
make: *** [Makefile:4: all] Error 2
%
Do I have to upgrade to a new compiler, if so which compiler version is needed? man gcc on my machine (RHEL8.5) says that -mindirect-branch= option is supported, and I believe this is the one enabling retpoline.
Should it be possible to disable retpoline support in the kernel? (however I would not like to rebuild the kernel if possible).
Thanks!
EDIT
I disabled retpoline as suggested by 0andriy via grub configuration file, (cat /proc/cmdline shows spectre_v2=off):
% grub2-editenv - set kernelopts=root=/dev/mapper/rhel_ps3cat5505k1-root ro crashkernel=auto resume=/dev/mapper/rhel_ps3cat5505k1-swap rd.lvm.lv=rhel_ps3cat5505k1/root rd.lvm.lv=rhel_ps3cat5505k1/swap rhgb quiet spectre_v2=off
% reboot
However the build still fails:
% make V=1
make -C /lib/modules/`uname -r`/build/ M=/home/mrv/tmp modules
make[1]: Entering directory '/usr/src/kernels/4.18.0-348.20.1.el8_5.x86_64'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
mkdir -p /home/mrv/tmp/.tmp_versions ; rm -f /home/mrv/tmp/.tmp_versions/*
make -f ./scripts/Makefile.build obj=/home/mrv/tmp
(cat /dev/null; echo kernel//home/mrv/tmp/test_mod.ko;) > /home/mrv/tmp/modules.order
gcc -Wp,-MD,/home/mrv/tmp/.test_mod.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/8/include -I./arch/x86/include -I./arch/x86/include/generated -I./include/drm-backport -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -include ./include/linux/compiler_types.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -DCC_HAVE_ASM_GOTO -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_AVX512=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -DCONFIG_TPAUSE=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mindirect-branch=thunk-extern -mindirect-branch-register -fno-jump-tables -fno-delete-null-pointer-checks -Wno-frame-address -Wno-format-truncation -Wno-format-overflow -Wno-int-in-bool-context -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -Wno-unused-const-variable -g -gdwarf-4 -pg -mrecord-mcount -mfentry -DCC_USING_FENTRY -fno-inline-functions-called-once -Wdeclaration-after-statement -Wno-pointer-sign -Wno-stringop-truncation -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Werror=designated-init -fmacro-prefix-map=./= -Wno-packed-not-aligned -DMODULE -DKBUILD_BASENAME='"test_mod"' -DKBUILD_MODNAME='"test_mod"' -c -o /home/mrv/tmp/.tmp_test_mod.o /home/mrv/tmp/test_mod.c
In file included from ./include/linux/module.h:18,
from /home/mrv/tmp/test_mod.c:1:
./include/linux/moduleparam.h:22:1: error: expected ‘,’ or ‘;’ before ‘static’
static const char __UNIQUE_ID(name)[] \
^~~~~~
./include/linux/module.h:158:32: note: in expansion of macro ‘__MODULE_INFO’
#define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info)
^~~~~~~~~~~~~
./include/linux/module.h:196:34: note: in expansion of macro ‘MODULE_INFO’
#define MODULE_LICENSE(_license) MODULE_INFO(license, _license)
^~~~~~~~~~~
/home/mrv/tmp/test_mod.c:19:1: note: in expansion of macro ‘MODULE_LICENSE’
MODULE_LICENSE("GPL")
^~~~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:322: /home/mrv/tmp/test_mod.o] Error 1
make[1]: *** [Makefile:1571: _module_/home/mrv/tmp] Error 2
make[1]: Leaving directory '/usr/src/kernels/4.18.0-348.20.1.el8_5.x86_64'
make: *** [Makefile:6: all] Error 2
%
So, running 'make oldconfig && make prepare' in kernel sources directory /usr/src/kernels/4.18.0-348.20.1.el8_5.x86_64 results in failure to locate tools/build/Build.include.
Not sure if RedHat allows to build kernel modules in RHEL8 at all.
EDIT2
Simple kernel module:
#include <linux/module.h>
#include <linux/kernel.h>
static __init int test_init(void)
{
printk("Init module\n");
return 0;
}
static __exit void test_exit(void)
{
printk("Cleanup module\n");
}
module_init(test_init)
module_exit(test_exit)
MODULE_DESCRIPTION("Test module");
MODULE_LICENSE("GPL");
I'm using bitbake 1.32.0, Yocto 2.2.2 (Poky) trying to add protobuf-c to my build. I keep getting a build failure on protobuf_2.6.1 (protobuf-c depends on protobuf).
I can manually download the Protobuf source code and cross-compile it without any problems. But for some reason Yocto can't build it.
During the Yocto build process, libprotobuf-lite.so links okay, but libprotobuf.so fails linking due to these errors:
| /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:87: undefined reference to `__init_array_end'
| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:87: undefined reference to `__init_array_start'
| /home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/libexec/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0/ld: .libs/libprotobuf.so.9.0.1: hidden symbol `__init_array_end' isn't defined
| /home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/libexec/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0/ld: final link failed: Bad value
I have tried looking through the .o files that are part of libprotobuf.so but are not included in libprotobuf-lite.so, to see if anything directly references the missing symbols, but I haven't found anything useful yet.
For a while I thought the culprit was -nostdlib. But then I saw libprotobuf-lite compiles just fine with that flag, and the -lc and -lgcc flags are included in the link command.
The recipe is a very straightforward autotools setup.
SUMMARY = "Protocol Buffers - structured data serialisation mechanism"
DESCRIPTION = "Protocol Buffers are a way of encoding structured data in an \
efficient yet extensible format. Google uses Protocol Buffers for almost \
all of its internal RPC protocols and file formats."
HOMEPAGE = "https://github.com/google/protobuf"
SECTION = "console/tools"
LICENSE = "BSD-3-Clause"
PACKAGE_BEFORE_PN = "${PN}-compiler"
DEPENDS = "zlib"
RDEPENDS_${PN}-compiler = "${PN}"
RDEPENDS_${PN}-dev += "${PN}-compiler"
LIC_FILES_CHKSUM =
"file://LICENSE;md5=af6809583bfde9a31595a58bb4a24514"
SRCREV = "bba83652e1be610bdb7ee1566ad18346d98b843c"
PV = "2.6.1+git${SRCPV}"
SRC_URI = "git://github.com/google/protobuf.git"
EXTRA_OECONF += " --with-protoc=echo"
inherit autotools
S = "${WORKDIR}/git"
FILES_${PN}-compiler = "${bindir} ${libdir}/libprotoc${SOLIBS}"
BBCLASSEXTEND = "native nativesdk"
Here is the more complete error statement:
| arm-agl-linux-gnueabi-libtool: link: arm-agl-linux-gnueabi-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 --sysroot=/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4 -fPIC -DPIC -shared -nostdlib /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/Scrt1.o /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/crti.o /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/arm-agl-linux-gnueabi/6.2.0/crtbeginS.o google/protobuf/stubs/.libs/atomicops_internals_x86_gcc.o google/protobuf/stubs/.libs/atomicops_internals_x86_msvc.o google/protobuf/stubs/.libs/common.o google/protobuf/stubs/.libs/once.o google/protobuf/stubs/.libs/stringprintf.o google/protobuf/.libs/extension_set.o google/protobuf/.libs/generated_message_util.o google/protobuf/.libs/message_lite.o google/protobuf/.libs/repeated_field.o google/protobuf/.libs/wire_format_lite.o google/protobuf/io/.libs/coded_stream.o google/protobuf/io/.libs/zero_copy_stream.o google/protobuf/io/.libs/zero_copy_stream_impl_lite.o google/protobuf/stubs/.libs/strutil.o google/protobuf/stubs/.libs/substitute.o google/protobuf/stubs/.libs/structurally_valid.o google/protobuf/.libs/descriptor.o google/protobuf/.libs/descriptor.pb.o google/protobuf/.libs/descriptor_database.o google/protobuf/.libs/dynamic_message.o google/protobuf/.libs/extension_set_heavy.o google/protobuf/.libs/generated_message_reflection.o google/protobuf/.libs/message.o google/protobuf/.libs/reflection_ops.o google/protobuf/.libs/service.o google/protobuf/.libs/text_format.o google/protobuf/.libs/unknown_field_set.o google/protobuf/.libs/wire_format.o google/protobuf/io/.libs/gzip_stream.o google/protobuf/io/.libs/printer.o google/protobuf/io/.libs/strtod.o google/protobuf/io/.libs/tokenizer.o google/protobuf/io/.libs/zero_copy_stream_impl.o google/protobuf/compiler/.libs/importer.o google/protobuf/compiler/.libs/parser.o -lpthread -lz -L/home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/lib/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0 -L/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/lib -L/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/arm-agl-linux-gnueabi/6.2.0 -L/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libstdc++.so -lm /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libssp_nonshared.a -lc -lgcc_s -lgcc /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/arm-agl-linux-gnueabi/6.2.0/crtendS.o /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/crtn.o -march=armv7-a -marm -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 --sysroot=/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4 -pthread -O2 -g -fstack-protector-strong -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z -Wl,relro -Wl,-z -Wl,now -pthread -Wl,-soname -Wl,libprotobuf.so.9 -o .libs/libprotobuf.so.9.0.1
| arm-agl-linux-gnueabi-libtool: link: arm-agl-linux-gnueabi-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 --sysroot=/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4 -fPIC -DPIC -shared -nostdlib /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/Scrt1.o /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/crti.o /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/arm-agl-linux-gnueabi/6.2.0/crtbeginS.o google/protobuf/stubs/.libs/atomicops_internals_x86_gcc.o google/protobuf/stubs/.libs/atomicops_internals_x86_msvc.o google/protobuf/stubs/.libs/common.o google/protobuf/stubs/.libs/once.o google/protobuf/stubs/.libs/stringprintf.o google/protobuf/.libs/extension_set.o google/protobuf/.libs/generated_message_util.o google/protobuf/.libs/message_lite.o google/protobuf/.libs/repeated_field.o google/protobuf/.libs/wire_format_lite.o google/protobuf/io/.libs/coded_stream.o google/protobuf/io/.libs/zero_copy_stream.o google/protobuf/io/.libs/zero_copy_stream_impl_lite.o -lpthread -lz -L/home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/lib/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0 -L/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/lib -L/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/arm-agl-linux-gnueabi/6.2.0 -L/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libstdc++.so -lm /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libssp_nonshared.a -lc -lgcc_s -lgcc /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/arm-agl-linux-gnueabi/6.2.0/crtendS.o /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/crtn.o -march=armv7-a -marm -mfpu=neon -mfloat-abi=softfp -mcpu=cortex-a9 --sysroot=/home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4 -pthread -O2 -g -fstack-protector-strong -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -fstack-protector-strong -Wl,-z -Wl,relro -Wl,-z -Wl,now -pthread -Wl,-soname -Wl,libprotobuf-lite.so.9 -o .libs/libprotobuf-lite.so.9.0.1
| ERROR: oe_runmake failed
| /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:87: undefined reference to `__init_array_end'
| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:87: undefined reference to `__init_array_start'
| /home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/libexec/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0/ld: .libs/libprotobuf-lite.so.9.0.1: hidden symbol `__init_array_end' isn't defined
| /home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/libexec/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0/ld: final link failed: Bad value
| collect2: error: ld returned 1 exit status
| make[3]: *** [libprotobuf-lite.la] Error 1
| make[3]: *** Waiting for unfinished jobs....
| /home/cjholmes/gen4/build/tmp/sysroots/imx6dlleargen4/usr/lib/libc_nonshared.a(elf-init.oS): In function `__libc_csu_init':
| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:87: undefined reference to `__init_array_end'
| /usr/src/debug/glibc/2.24-r0/git/csu/elf-init.c:87: undefined reference to `__init_array_start'
| /home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/libexec/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0/ld: .libs/libprotobuf.so.9.0.1: hidden symbol `__init_array_end' isn't defined
| /home/cjholmes/gen4/build/tmp/sysroots/x86_64-linux/usr/libexec/arm-agl-linux-gnueabi/gcc/arm-agl-linux-gnueabi/6.2.0/ld: final link failed: Bad value
| collect2: error: ld returned 1 exit status
| make[3]: *** [libprotobuf.la] Error 1
| make[3]: Leaving directory `/home/cjholmes/gen4/build/tmp/work/cortexa9-neon-agl-linux-gnueabi/protobuf/2.6.1+gitAUTOINC+bba83652e1-r0/build/src'
| make[2]: *** [all] Error 2
| make[2]: Leaving directory `/home/cjholmes/gen4/build/tmp/work/cortexa9-neon-agl-linux-gnueabi/protobuf/2.6.1+gitAUTOINC+bba83652e1-r0/build/src'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/home/cjholmes/gen4/build/tmp/work/cortexa9-neon-agl-linux-gnueabi/protobuf/2.6.1+gitAUTOINC+bba83652e1-r0/build'
| make: *** [all] Error 2
| WARNING: /home/cjholmes/gen4/build/tmp/work/cortexa9-neon-agl-linux-gnueabi/protobuf/2.6.1+gitAUTOINC+bba83652e1-r0/temp/run.do_compile.121250:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_compile (log file is located at /home/cjholmes/gen4/build/tmp/work/cortexa9-neon-agl-linux-gnueabi/protobuf/2.6.1+gitAUTOINC+bba83652e1-r0/temp/log.do_compile.121250)
I could really use some pointers on what to look at next. This has eaten a lot of hours already.
The environments are Cent OS 6.7, boost-1.6.2, gcc-6.2.0
I have tried to install a software, but I got some errors.
Are theses errors come from g++ ? or boost?
I can't understand these messages.. because I have never been use g++..
Here is starting line.
[root#cms CASMcode-0.2.0]# scons install
scons: Reading SConscript files ...
rm /usr/local/include/casm
scons: done reading SConscript files.
scons: Building targets ...
Install directory: "include/casm" as "/usr/local/include/casm"
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/version/version.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude src/casm/version/version.cc
/usr/local/gcc-6.2/bin/g++-6.2 -o src/casm/clex/ConfigIOStrucScore.os -c -DNDEBUG -O3 --std=c++11 -Wno-deprecated-register -Wno-deprecated-declarations -DEIGEN_DEFAULT_DENSE_INDEX_TYPE=long -Wno-unused-parameter -DNDEBUG -O3 -DGZSTREAM_NAMESPACE=gz -fPIC -Iinclude -I/usr/local/boost_1_62_0/include src/casm/clex/ConfigIOStrucScore.cc
In file included from include/casm/external/Eigen/Core:263:0,
from include/casm/external/Eigen/Dense:1,
from include/casm/CASM_global_definitions.hh:13,
from include/casm/casm_io/EigenDataStream.hh:3,
from src/casm/clex/ConfigIOStrucScore.cc:3:
Error message appear here.
In file included from include/casm/casm_io/DataFormatterTools.hh:1291:0,
from include/casm/casm_io/DataFormatter_impl.hh:3,
from include/casm/casm_io/DataFormatter.hh:757,
from include/casm/clex/ConfigIO.hh:4,
from src/casm/clex/ConfigIOStrucScore.cc:6:
include/casm/casm_io/DataFormatterTools_impl.hh: In member function 'bool CASM::DataFormatterOperator<ValueType, ArgType, DataObject>::parse_args(const string&)':
include/casm/casm_io/DataFormatterTools_impl.hh:33:33: error: invalid initialization of reference of type 'const wstring& {aka const std::__cxx11::basic_string<wchar_t>&}' from expression of type 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
val = std::stod(ttag);
^
And here
In file included from include/casm/clex/PrimClex.hh:14:0,
from include/casm/clex/ConfigIOStrucScore.hh:6,
from src/casm/clex/ConfigIOStrucScore.cc:7:
include/casm/clex/ChemicalReference.hh: In member function 'void CASM::ChemicalReferencePrinter::print(const std::vector<CASM::ChemicalReferenceState>&)':
include/casm/clex/ChemicalReference.hh:366:27: error: 'round' is not a member of 'std'
if(almost_equal(std::round(num), num, 1e-14)) {
^~~
I couldn't build opencv with cuda support on Mavericks:
When using cmake -G "Unix Makefiles" -DWITH_CUDA=ON ..
i got error:
-- Configuring incomplete, errors occurred!
Any workaround on this?
(Similar error when using macport too)
CMakeError.log
Determining size of off64_t failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec3929617441/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec3929617441.dir/build.make CMakeFiles/cmTryCompileExec3929617441.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3929617441.dir/OFF64_T.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec3929617441.dir/OFF64_T.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:19:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 10000)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:20:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 1000)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:21:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 100)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:22:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + ((SIZE / 10)%10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:23:12: error: use of undeclared identifier 'off64_t'; did you mean 'off_t'?
('0' + (SIZE % 10)),
^
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:17:22: note: expanded from macro 'SIZE'
#define SIZE (sizeof(off64_t))
^
5 errors generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec3929617441.dir/OFF64_T.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3929617441/fast] Error 2
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CheckTypeSize/OFF64_T.c:
#include <sys/types.h>
#include <stdint.h>
#include <stddef.h>
#undef KEY
#if defined(__i386)
# define KEY '_','_','i','3','8','6'
#elif defined(__x86_64)
# define KEY '_','_','x','8','6','_','6','4'
#elif defined(__ppc__)
# define KEY '_','_','p','p','c','_','_'
#elif defined(__ppc64__)
# define KEY '_','_','p','p','c','6','4','_','_'
#endif
#define SIZE (sizeof(off64_t))
char info_size[] = {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
('0' + ((SIZE / 10000)%10)),
('0' + ((SIZE / 1000)%10)),
('0' + ((SIZE / 100)%10)),
('0' + ((SIZE / 10)%10)),
('0' + (SIZE % 10)),
']',
#ifdef KEY
' ','k','e','y','[', KEY, ']',
#endif
'\0'};
#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
int require = 0;
require += info_size[argc];
(void)argv;
return require;
}
Determining if the include file io.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec647810530/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec647810530.dir/build.make CMakeFiles/cmTryCompileExec647810530.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec647810530.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec647810530.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'io.h' file not found
#include <io.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec647810530.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec647810530/fast] Error 2
Determining if the function jbg_newlen exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec4172827471/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec4172827471.dir/build.make CMakeFiles/cmTryCompileExec4172827471.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec4172827471.dir/CheckFunctionExists.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -DCHECK_FUNCTION_EXISTS=jbg_newlen -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec4172827471.dir/CheckFunctionExists.c.o -c /opt/local/share/cmake-2.8/Modules/CheckFunctionExists.c
Linking C executable cmTryCompileExec4172827471
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec4172827471.dir/link.txt --verbose=1
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -DCHECK_FUNCTION_EXISTS=jbg_newlen -O3 -DNDEBUG -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTryCompileExec4172827471.dir/CheckFunctionExists.c.o -o cmTryCompileExec4172827471
Undefined symbols for architecture x86_64:
"_jbg_newlen", referenced from:
_main in CheckFunctionExists.c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [cmTryCompileExec4172827471] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec4172827471/fast] Error 2
Determining if the include file linux/videodev.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec70111243/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec70111243.dir/build.make CMakeFiles/cmTryCompileExec70111243.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec70111243.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec70111243.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'linux/videodev.h' file not found
#include <linux/videodev.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec70111243.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec70111243/fast] Error 2
Determining if the include file linux/videodev2.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec661389614/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec661389614.dir/build.make CMakeFiles/cmTryCompileExec661389614.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec661389614.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec661389614.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'linux/videodev2.h' file not found
#include <linux/videodev2.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec661389614.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec661389614/fast] Error 2
Determining if the include file sys/videoio.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec741892054/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec741892054.dir/build.make CMakeFiles/cmTryCompileExec741892054.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec741892054.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec741892054.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'sys/videoio.h' file not found
#include <sys/videoio.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec741892054.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec741892054/fast] Error 2
Determining if the include file libavformat/avformat.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec2161613468/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec2161613468.dir/build.make CMakeFiles/cmTryCompileExec2161613468.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec2161613468.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec2161613468.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'libavformat/avformat.h' file not found
#include <libavformat/avformat.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec2161613468.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec2161613468/fast] Error 2
Determining if the include file ffmpeg/avformat.h exists failed with the following output:
Change Dir: /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp
Run Build Command:/opt/local/bin/gmake "cmTryCompileExec188285781/fast"
/opt/local/bin/gmake -f CMakeFiles/cmTryCompileExec188285781.dir/build.make CMakeFiles/cmTryCompileExec188285781.dir/build
gmake[1]: Entering directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
/opt/local/bin/cmake -E cmake_progress_report /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec188285781.dir/CheckIncludeFile.c.o
/usr/bin/cc -fsigned-char -W -Werror=return-type -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -fdiagnostics-show-option -fno-omit-frame-pointer -msse -msse2 -msse3 -O3 -DNDEBUG -o CMakeFiles/cmTryCompileExec188285781.dir/CheckIncludeFile.c.o -c /Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'ffmpeg/avformat.h' file not found
#include <ffmpeg/avformat.h>
^
1 error generated.
gmake[1]: *** [CMakeFiles/cmTryCompileExec188285781.dir/CheckIncludeFile.c.o] Error 1
gmake[1]: Leaving directory `/Users/caominhvu/Downloads/opencv-2.4.7/build/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec188285781/fast] Error 2
Here's how I compiled OpenCV 2.4.8 on OSX Mavericks 10.9.1 using Xcode 5.0.2 and CUDA 5.5:
open CMake to set the project, and to the basic configuration
in latest Xcode (I think >= 5) there's no more the gcc compiler, deprecated in favor of clang, so go to the CUDA options of the CMAKE project and change CUDA_HOST_COMPILER to use "/usr/bin/clang". Luckily CUDA 5.5 supports clang and not only gcc
Apparently CUDA 5.5 supports only the older libstdc++ library and not the more modern libc++, so update CUDA_NVCC_FLAGS to tell mvcc to pass tell the nativa compilar to use this older library. Add "-Xcompiler -stdlib=libstdc++; -Xlinker -stdlib=libstdc++"
Tell also the C++ compiler that compiles the rest of the library to use libstdc++: show the advanced options of CMAKE and go to CMAKE to add "-stdlib=libstdc++" to both CMAKE_CXX_FLAGS and CMAKE_EXE_LINKER_FLAGS
For anyone coming here later who may be trying to install from this tutorial. I ran into this problem because my OPENCV_EXTRA_MODULES_PATH was pointing to the wrong directory. I had mine in ~/src/, and not just ~/
I was trying to compile open-vm-toos package (9.0.0-782409) under buildroot env and it fails in one file. Below is log of the error. I narrowed it down on something to do with locale includes. Tried to doff standard locale includes vs those available under buildroot env, and there's no difference. Which include I'm missing (Maybe something to pass explicitly to CFLAGS to configure script of open-vm-tools)?
/bin/sh ../../libtool --tag=CC --mode=compile /myRepository/repo/cai/buildroot/output/staging/usr/bin/i686-unknown-linux-uclibc-gcc -Os -pipe -Os -mtune=i686 -march=i686 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/myRepository/repo/cai/buildroot/output/staging/usr/include -I/myRepository/repo/cai/buildroot/output/staging/include --sysroot=/myRepository/repo/cai/buildroot/output/staging/ -isysroot /myRepository/repo/cai/buildroot/output/staging -DPACKAGE_NAME=\"open-vm-tools\" -DPACKAGE_TARNAME=\"open-vm-tools\" -DPACKAGE_VERSION=\"8.4.2\" -DPACKAGE_STRING=\"open-vm-tools\ 8.4.2\" -DPACKAGE_BUGREPORT=\"open-vm-tools-devel#lists.sourceforge.net\" -DPACKAGE_URL=\"\" -DPACKAGE=\"open-vm-tools\" -DVERSION=\"8.4.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DX_DISPLAY_MISSING=1 -DNO_PROCPS=1 -DNO_DNET=1 -DHAVE_CRYPT_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_WCHAR_H=1 -DHAVE_SYS_IO_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_SYSINFO_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_USER_H=1 -DHAVE_SYS_VFS_H=1 -DHAVE_UNWIND_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STRUCT_STAT_ST_RDEV=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_LSEEK=1 -DNO_MULTIMON=1 -I. -I/myRepository/repo/cai/buildroot/output/build/open-vm-tools-8.4.2-261024/lib/include -I/myRepository/repo/cai/buildroot/output/build/open-vm-tools-8.4.2-261024/lib/include -DUSING_AUTOCONF=1 -DOPEN_VM_TOOLS -DVMX86_TOOLS -DNO_CORE_ICU -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE -DGLIBC_VERSION_21 -DGLIBC_VERSION_22 -I/myRepository/repo/cai/buildroot/output/staging/usr/include -I/myRepository/repo/cai/buildroot/output/build/usr/include -liconv -DNO_FLOATING_POINT -Wall -Werror -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing -Wno-unknown-pragmas -Wno-uninitialized -MT codesetOld.lo -MD -MP -MF .deps/codesetOld.Tpo -c -o codesetOld.lo codesetOld.c
....
codesetOld.c: In function 'CodeSetOldGetCodeSetFromLocale':
codesetOld.c:728: error: '__locale_t' undeclared (first use in this function)
codesetOld.c:728: error: (Each undeclared identifier is reported only once
codesetOld.c:728: error: for each function it appears in.)
codesetOld.c:728: error: expected ';' before 'new'
codesetOld.c:729: error: 'new' undeclared (first use in this function)
cc1: warnings being treated as errors
codesetOld.c:736: error: implicit declaration of function '__newlocale'
codesetOld.c:739: error: implicit declaration of function '__nl_langinfo_l'
codesetOld.c:739: error: passing argument 2 of 'Util_SafeInternalStrdup' makes pointer from integer without a cast
codesetOld.c:740: error: implicit declaration of function '__freelocale'
make[5]: *** [codesetOld.lo] Error 1
make[4]: *** [all-recursive] Error 1
make[3]: *** [all-recursive] Error 1
Here's code snippet of file under error:
721 static char *
722 CodeSetOldGetCodeSetFromLocale(void)
723 {
724 char *codeset;
725
726 #if defined(__linux__)
727
728 locale_t new = newlocale(LC_CTYPE_MASK, "", NULL);
729 if (!new) {
730 /*
731 * If the machine is configured incorrectly (no current locale),
732 * newlocale() could return NULL. Try to fall back on the "C"
733 * locale.
734 */
735
736 new = newlocale(LC_CTYPE_MASK, "C", NULL);
737 ASSERT(new);
738 }
739 codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new));
740 freelocale(new);
741
742 #elif defined(sun)
743
744 char *locale = setlocale(LC_CTYPE, NULL);
745 if (!setlocale(LC_CTYPE, "")) {
Enable locale support in your toolchain, then do a make clean; make all cycle.