I am building a project over cmake with a ninja generator and build my project for coverage with add_compile_options("$<$<CONFIG:COVERAGE>:-g;-O0;-ftest-coverage;-fprofile-arcs;-fno-builtin>"). What happens is that my gcno files are put in the ${CMAKE_BINARY_DIR} and not in the corresponding target directory like ${CMAKE_BINARY_DIR}/CMakeFiles/Project.dir.
The implication of this difference is that I now cannot have source files with the same name.
When I build the same project with makefiles, the gcno files do end up in those folders. I checked the different calls it does in the command line and the difference is the following. It is most definitely the change of working directory.
How can I tell ninja to also put the gcno files in the corresponding project directories?
make
cd C:/my_project/MASTER/build/EXTERNAL_3RDPARTY/blake2 && C:/qnx700/host/win64/x86_64/usr/bin/qcc.exe -Vgcc_ntox86_64 -IC:/C:/my_project/3RDPARTY/blake2/src -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wall -Wextra -pedantic -Wmissing-declarations -Wunused -Wpedantic -Wlogical-op -Wdouble-promotion -Wformat=2 -fmessage-length=0 -fno-exceptions -march=broadwell -g -O0 -ftest-coverage -fprofile-arcs -fno-builtin -std=c11 -o CMakeFiles/libblake2.dir/src/blake2/blake2b.c.o -c C:/my_project/3RDPARTY/blake2/src/blake2/blake2b.c
ninja:
C:\qnx700\host\win64\x86_64\usr\bin\qcc.exe -Vgcc_ntox86_64 -IC:/C:/my_project/3RDPARTY/blake2/src -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion -Wall -Wextra -pedantic -Wmissing-declarations -Wunused -Wpedantic -Wlogical-op -Wdouble-promotion -Wformat=2 -fmessage-length=0 -fno-exceptions -march=broadwell -g -O0 -ftest-coverage -fprofile-arcs -fno-builtin -std=c11 -Wp,-MD,EXTERNAL_3RDPARTY\blake2\CMakeFiles\libblake2.dir\src\blake2\blake2b.c.o.d -Wp,-MT,EXTERNAL_3RDPARTY/blake2/CMakeFiles/libblake2.dir/src/blake2/blake2b.c.o -Wp,-MF,EXTERNAL_3RDPARTY\blake2\CMakeFiles\libblake2.dir\src\blake2\blake2b.c.o.d -o EXTERNAL_3RDPARTY/blake2/CMakeFiles/libblake2.dir/src/blake2/blake2b.c.o -c C:/my_project/3RDPARTY/blake2/src/blake2/blake2b.c
We did some more research and came to the conclusion that the qcc.exe wrapper is the actual problem. Using gcc.exe directly resolves the issue.
Related
My makefile has the following defines for linux. What would the equivalent be for the mac build? I'm not seeing anything in an internet search for linux and mac defines or -dlinux_64.
DEFINES=-D_INCLUDE_POSIX_SOURCE -DLINUX -DLINUX_64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
DEBUG_DEFINES=$(DEFINES)
PROFILE_DEFINES=$(DEFINES)
During the build, it's showing like this:
/usr/bin/gcc -MM -fPIC -O2 -m64 -Wall -D_INCLUDE_POSIX_SOURCE -DLINUX -DLINUX_64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I../inc -I. jdmainct.c > jdmainct.d
/usr/bin/gcc -fPIC -O2 -m64 -Wall -D_INCLUDE_POSIX_SOURCE -DLINUX -DLINUX_64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I../inc -I. -c jdmarker.c -o jdmarker.o
...
Do I need to change that for the mac build? What is the equivalent for mac? Thanks!
n order to install caffe,which is used for deep learing,i need to upgrade gcc version from 4.4.7 to 4.8.2 in redhat 6.5。
First run ./configure it worked,
then make -j4, it will report
options.c:11145: error: narrowing conversion of '-0x00000000000000001' from 'int' to 'short unsigned int' inside { }
g++ -std=gnu++0x -c -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace ../../gcc/hash-table.c -o hash-table.o
g++ -std=gnu++0x -c -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace ../../gcc/file-find.c -o file-find.o
make[3]: *** [options.o] Error 1
make[3]: *** Waiting for unfinished jobs....
I search google,but can't find good ways to fix it ,who has the same issues before?
Replacing the original gcc can cause problems. The alternative is to install Developer Toolset which installs a new gcc version (currently at 4.9) along side the original to avoid file conflict. Get started here: http://developers.redhat.com/products/developertoolset/overview/
I'm trying to build gcc 4.9.2 on RHEL6, as follows:
unpack the source tarball (to ~/gcc-4.9.2)
in the source dir:
./contrib/download_prerequisites
create a separate build directory ~/gcc-4.9.2-build
in the build dir:
~/gcc-4.9.2/configure --prefix=/usr/local/gcc-4.9.2
make
This fails with:
make[6]: Entering directory `/root/gcc-4.9.2-build-try0/x86_64-unknown-linux-gnu/libjava/classpath/native/jni/java-math'
/bin/sh ../../../libtool --tag=CC --mode=compile /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/root/gcc-4.9.2/libjava/classpath/native/jni/java-math -I../../../include -I/root/gcc-4.9.2/libjava/classpath/include -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I/root/gcc-4.9.2/libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -MT gnu_java_math_GMP.lo -MD -MP -MF .deps/gnu_java_math_GMP.Tpo -c -o gnu_java_math_GMP.lo /root/gcc-4.9.2/libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c
libtool: compile: /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/root/gcc-4.9.2/libjava/classpath/native/jni/java-math -I../../../include -I/root/gcc-4.9.2/libjava/classpath/include -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I/root/gcc-4.9.2/libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -MT gnu_java_math_GMP.lo -MD -MP -MF .deps/gnu_java_math_GMP.Tpo -c /root/gcc-4.9.2/libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c -fPIC -DPIC -o .libs/gnu_java_math_GMP.o
mv -f .deps/gnu_java_math_GMP.Tpo .deps/gnu_java_math_GMP.Plo
/bin/sh ../../../libtool --tag=CC --mode=link /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -module -version-info 0:0:0 -no-undefined -lgmp -avoid-version -o libjavamath.la -rpath /usr/local/gcc-4.9.2/lib/../lib64/gcj-4.9.2-15 gnu_java_math_GMP.lo ../../../native/jni/classpath/jcl.lo -lrt
libtool: link: /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -shared .libs/gnu_java_math_GMP.o ../../../native/jni/classpath/.libs/jcl.o /root/gcc-4.9.2-build-try0/./gmp/.libs/libgmp.a -lrt -Wl,-soname -Wl,libjavamath.so -o .libs/libjavamath.so
/usr/bin/ld: /root/gcc-4.9.2-build-try0/./gmp/.libs/libgmp.a(mp_set_fns.o): relocation R_X86_64_32 against `__gmp_default_allocate' can not be used when making a shared object; recompile with -fPIC
/root/gcc-4.9.2-build-try0/./gmp/.libs/libgmp.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[6]: *** [libjavamath.la] Error 1
make[6]: Leaving directory `/root/gcc-4.9.2-build-try0/x86_64-unknown-linux-gnu/libjava/classpath/native/jni/java-math'
A little googling pointed me at the --disable-shared option, which sort of helped, but now:
in the build dir:
~/gcc-4.9.2/configure --prefix=/usr/local/gcc-4.9.2 --disable-shared
make
yielded a slightly different error:
make[8]: Entering directory `/root/gcc-4.9.2-build/x86_64-unknown-linux-gnu/32/libjava/classpath/native/jni/classpath'
/bin/sh ../../../libtool --tag=CC --mode=compile /root/gcc-4.9.2-build/./gcc/xgcc -B/root/gcc-4.9.2-build/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -m32 -DHAVE_CONFIG_H -I. -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I../../../include -I/root/gcc-4.9.2/libjava/classpath/include -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I/root/gcc-4.9.2/libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -Wstrict-prototypes -pedantic -fexceptions -fasynchronous-unwind-tables -g -O2 -m32 -MT jcl.lo -MD -MP -MF .deps/jcl.Tpo -c -o jcl.lo /root/gcc-4.9.2/libjava/classpath/native/jni/classpath/jcl.c
libtool: compile: not configured to build any kind of library
libtool: compile: See the libtool documentation for more information.
libtool: compile: Fatal configuration error.
make[8]: *** [jcl.lo] Error 1
make[8]: Leaving directory `/root/gcc-4.9.2-build/x86_64-unknown-linux-gnu/32/libjava/classpath/native/jni/classpath'
Adding the --enable-static option made no difference.
Any suggestions on what might be wrong?
BTW, gcc 4.9.1 gave the same errors.
System: Linux 2.6.32-431.29.2.el6.x86_64 #1 SMP Sun Jul 27 15:55:46 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
System is RHEL6, fully updated via Redhat, and has no custom RPMs that I know of.
Just completed building 4.9.2 on a CentOS 6.4 VM using 4.4.7 gcc. Ran into an out of space issue, which caused the build to fail, but once resolved, everything else went smoothly.
Looks like your build is failing in the Java side of town? Not sure if you need the Java support, so have you tried compiling just the c/c++ language support?
~/gcc-4.9.2/configure --enable-languages=c,c++ ...
I also don't require 32-bit binaries, so I add --disable-multilib to the list of configure parameters.
I am attempting to use Mingw-w64's 32-bit compiler (the i686-w64-mingw32 toolchain) to cross-compile the ICU library for Windows. The host is Ubuntu 12.10 64-bit.
The steps I have taken look something like this:
Grab the latest source code archive from here and extract it.
Make two copies of the source/ directory - one for the host and one for the target.
For the host build:
./configure ; make
For the target build:
./configure --host=i686-w64-mingw32 --with-cross-build=<host_source_dir>
...where <host_source_dir> is the directory from the previous step.
When I run make in the target source directory, compilation proceeds without any errors for a few moments and then throws this error:
i686-w64-mingw32-g++ -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings
-Wno-long-long -mthreads -o ../../bin/uconv.exe uconv.o uwmsg.o
-L../../lib -licuin50 -L../../lib -licuuc50 -L../../stubdata -licudt50
-lm uconvmsg/uconvmsg.a
uconv.o:uconv.cpp:(.text+0x2f): undefined reference to `_uconvmsg_dat'
What could be causing this error? I backed up a few lines and also noticed this:
pkgdata: i686-w64-mingw32-gcc -O2 -Wall -std=c99 -pedantic -Wshadow
-Wpointer-arith -Wmissing-prototypes -Wwrite-strings -mthreads -shared
-Wl,-Bsymbolic -Wl,--enable-auto-import -Wl,--out-implib=./all.lib -o
../lib/icudt50.dll ./out/tmp/icudt50l_dat.o
Cannot export icudt50_dat: symbol not found
collect2: ld returned 1 exit status
-- return status = 256
Error generating library file. Failed command: i686-w64-mingw32-gcc -O2 -Wall
-std=c99 -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes
-Wwrite-strings -mthreads -shared -Wl,-Bsymbolic -Wl,--enable-auto-import
-Wl,--out-implib=./all.lib -o ../lib/icudt50.dll ./out/tmp/icudt50l_dat.o
Error generating assembly code for data.
What am I doing wrong?
In order to debug your symbol problem just provide the flag -Wl,--trace-symbol=_uconvmsg_dat to i686-w64-mingw32-g++ like follows:
i686-w64-mingw32-g++ -O2 -W -Wall -pedantic -Wpointer-arith -Wwrite-strings
-Wno-long-long -mthreads -o ../../bin/uconv.exe uconv.o uwmsg.o
-L../../lib -licuin50 -L../../lib -licuuc50 -L../../stubdata -licudt50
-lm uconvmsg/uconvmsg.a -Wl,--trace-symbol=_uconvmsg_dat
So it turns out that the problem was indeed with the ICU source code. I'm not sure I understand exactly what the problem is, but thankfully someone else did and wrote three patches.
The first two apply to my question above:
icu4c-50_1_2-crossbuild.patch
icu4c-4_6_1-win32.patch
The third patch is used instead of the second in the list above when building for the x86_64 architecture:
icu4c-4_6_1-win64.patch
There does still seem to be a problem when running make install, but at least the source tree seems to build now.
I'm trying to build Gnu Octave for Windows.I built all the main dependencies without having much problem.And configuring process went well.But when I tried to run make(After few source modifications to get over some errors),It triggers tons of errors like
./.libs/liboctinterp.a(liboctinterp_la-octave.o): In function `safe_source_file':
C:\MinGW\sources\octave-3.6.2\src/octave.cc:312: undefined reference to `___cxa_begin_catch'
At the line
libtool: link: gcc -g -O2 -pthread -DHAVE_CONFIG_H -mieee-fp -Wall -W -Wshadow -Wformat -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wcast-align -Wcast-qual -g -O2 -pthread -pthread -g -O2 -pthread -o .libs/octave.exe main.o ./.libs/liboctinterp.a /mingw/sources/octave-3.6.2~~/liboctave/.libs/liboctave.a -L=c:/mingw/bin/../lib/gcc/mingw32/4.7.0 -L=c:/mingw/bin/../lib/gcc -L=c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/lib -L=c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../.. -lfltk_gl -lfltk -lole32 -luuid -lcomctl32 -LC:/MinGW/lib /mingw/lib/libfontconfig.dll.a -L=C:/MinGW/lib /mingw/lib/libfreetype.dll.a -lz -lbz2 /mingw/lib/libexpat.dll.a -lopengl32 -lglu32 ../liboctave/.libs/liboctave.a /mingw/sources/octave-3.6.2~~/libcruft/.libs/libcruft.a /mingw/lib/libarpack.a /mingw/lib/libfftw3.a -lreadline -ltermcap /mingw/lib/libpcre.dll.a ../libcruft/.libs/libcruft.a -llapack -lblas -lgfortran -lquadmath -liberty -lgdi32 -lws2_32 -luser32 -lkernel32 -pthread -L/mingw/lib
I dumped the make log to a file and the file is about 39MB!! Just full of errors like above.
I'm very much thankful if someone can help me to get over this.