I'm trying to install LISTSERV by lsoft.com on redhat. The package comes with a compiler test, and this test is failing.
The OS is:
Red Hat Enterprise Linux Server release 6.8 (Santiago)
The Arch is:
x86_64
The compiler is:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Here's the full "gcc -v":
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
compilertest.c:
main()
{}
The compiler test command:
gcc -O compilertest.c
The error message:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
The file exists as a real file (i.e. not a symbolic link):
-rw-r--r-- 1 root root 1240 Jan 28 2016 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o
So, what am I missing? Was something compiled using 32b instead of 64b? Am I missing a library or have the wrong version of one?
$ readelf -h /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: REL (Relocatable file)
Machine: Intel 80386
Version: 0x1
Entry point address: 0x0
Start of program headers: 0 (bytes into file)
Start of section headers: 288 (bytes into file)
Flags: 0x0
Size of this header: 52 (bytes)
Size of program headers: 0 (bytes)
Number of program headers: 0
Size of section headers: 40 (bytes)
Number of section headers: 13
Section header string table index: 10
$ env -i PATH=/usr/bin gcc -O compilertest.c
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
$ gcc -v compilertest.c
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic'
/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/cc1 -quiet -v compilertest.c -quiet -dumpbase compilertest.c -mtune=generic -auxbase compilertest -version -o /tmp/ccGTjhJB.s
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include
/usr/include
End of search list.
GNU C (GCC) version 4.4.7 20120313 (Red Hat 4.4.7-17) (x86_64-redhat-linux)
compiled by GNU C version 4.4.7 20120313 (Red Hat 4.4.7-17), GMP version 4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 2e79a9448b1040fd1e442d3c6bfaea69
COLLECT_GCC_OPTIONS='-v' '-mtune=generic'
as -V -Qy -o /tmp/cc4clAj5.o /tmp/ccGTjhJB.s
GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version version 2.20.51.0.2-5.44.el6 20100205
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic'
/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/collect2 --eh-frame-hdr --build-id -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../.. /tmp/cc4clAj5.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crtn.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
$ file /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.18, not stripped
This error message:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../crt1.o: could not read symbols: File in wrong format collect2: ld returned 1 exit status
Indicates that the linker found a 32-bit object file where it expected a 64-bit one, or vise versa. You can determine which by examining the file in question with the file command. readelf is a little bit overkill for this purpose, but it gets the job done, too. We know as a result that yours is a 32-bit ELF object file, so presumably the compiler expected a 64-bit one.
The path you present canonicalizes to /usr/lib/crt1.o. On RHEL6, that belongs to the 32-bit glibc-devel package (the 64-bit analog lives in /usr/lib64). A 32-bit ELF object is exactly what that file should be, so if the compiler expected a 64-bit object then something is seriously wrong with it.
My best guess is that an installation from source or from a package for some other RPM-based distribution (maybe even a different version of RHEL) has produced an unusable environment for you. If you have an installed-from-source copy of GCC somewhere other than /usr/bin, then removing that (from the path, at least) might be sufficient to solve your problem. The command which gcc might be useful in determining whether you're getting a rogue gcc instead of RHEL's standard one.
Otherwise, your best bet is to remove all copies of gcc and your development libraries, and then reinstall from the official package repositories. The main packages to remove and reinstall are 'gcc' and 'glibc-devel'; removing these may cause other tools and development libraries to be removed as well. I recommend also removing any 'compat-gcc' package. Do not attempt to remove the main 'glibc' package, however, for if you somehow managed to do that, it would render your system inoperable.
Related
I recently installed MSYS2 following Steely Wing's answer on this thread: How to install MinGW-w64 and MSYS2?
The final goal is to compile a project on Windows in order to create an executable that I can use with an installer.
But here comes the problem: when I use make, gcc does not find err.h:
src/debug/error_handler.c:2:10: fatal error: err.h: No such file or directory
2 | #include <err.h>
| ^~~~~~~
compilation terminated.
make: *** [Makefile:26: imagin] Interrupt
After some searching I found out that it could come from the MinGW's default Include path. Thus following this: http://mingw.org/wiki/IncludePathHOWTO, I created an empty foo.c and executed gcc -v foo.c:
Configured with: ../gcc-9.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=c,lto,c++,fortran,ada,objc,obj-c++ --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --enable-plugin --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev2, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 9.2.0 (Rev2, Built by MSYS2 project)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/cc1.exe -quiet -v -iprefix C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/ -D_REENTRANT foo.c -quiet -dumpbase foo.c -mtune=generic -march=x86-64 -auxbase foo -version -o C:\msys64\tmp\ccXlDSUc.s
GNU C17 (Rev2, Built by MSYS2 project) version 9.2.0 (x86_64-w64-mingw32)
compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP
warning: GMP header version 6.1.2 differs from library version 6.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/9.2.0/include"
ignoring nonexistent directory "C:/building/msys64/mingw64/include"
ignoring nonexistent directory "/mingw64/include"
ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/9.2.0/include-fixed"
ignoring duplicate directory "C:/msys64/mingw64/lib/gcc/../../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/include"
ignoring nonexistent directory "C:/building/msys64/mingw64/x86_64-w64-mingw32/include"
#include "..." search starts here:
#include <...> search starts here:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/include
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../include
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/include-fixed
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/include
End of search list.
GNU C17 (Rev2, Built by MSYS2 project) version 9.2.0 (x86_64-w64-mingw32)
compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP
warning: GMP header version 6.1.2 differs from library version 6.2.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 3bcdf03344e3ad7cb057c2ec82f696e6
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/as.exe -v -o C:\msys64\tmp\cckgYpTe.o C:\msys64\tmp\ccXlDSUc.s
GNU assembler version 2.33.1 (x86_64-w64-mingw32) using BFD version (GNU Binutils) 2.33.1
COMPILER_PATH=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/;C:/msys64/mingw64/bin/../lib/gcc/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/;C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/collect2.exe -plugin C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/liblto_plugin-0.dll -plugin-opt=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\msys64\tmp\cch1aQIi.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lpthread -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_eh -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt -m i386pep -Bdynamic C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/crtbegin.o -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0 -LC:/msys64/mingw64/bin/../lib/gcc -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib -LC:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../.. C:\msys64\tmp\cckgYpTe.o -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc -lgcc_eh -lmoldname -lmingwex -lmsvcrt C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/default-manifest.o C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/crtend.o
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o): in function `main':
D:/mingwbuild/mingw-w64-crt-git/src/mingw-w64/mingw-w64-crt/crt/crt0_c.c:18: undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
This is a bit messy but I think the interesting part is there:
#include "..." search starts here:
#include <...> search starts here:
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/include
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../include
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/include-fixed
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/include
Considering the fact that err.h comes from openssl that I installed using https://packages.msys2.org/package/mingw-w64-x86_64-openssl, openssl folder is included in /mingw64/include. But gcc does not find it.
I tried to use -I/mingw64/include in my CFLAGS, but it did not work. I tried with -I/mingw64/include/openssl and it worked, but now gcc considers errx function as unititialized, as if, before, gcc never went in the openssl folder. I tried to add -L/mingw64/lib but it did not work.
Any help is appreciated, thank's by advance. DO NOT hesitate to ask for any precision I could have miss here.
After hours of searching I found out that there was no err.h on MSYS2, see https://github.com/cliffordwolf/icestorm/issues/85 and resolved my case by replacing all my errx() function calls following these method https://github.com/cliffordwolf/icestorm/pull/88/commits/9acaac752ac53b51b9b33290394b7811048221fa.
I downloaded and built (seemingly correctly) the relevant BLAS and CBLAS libraries (from netlib.org/blas) in my Linux Fedora environment. The result of this was a blas_LINUX.a file, which I renamed libblas.a and copied to \usr\local\lib, and a cblas.h file which I copied to \usr\include. I subsequently tried referencing this in a CMakeList.txt file in a CLion project. The file is as follows:
project(test C)
cmake_minimum_required(VERSION 3.10)
set(CMAKE_C_STANDARD 99)
include_directories(include)
add_executable(${PROJECT_NAME} src/main.c)
find_library(blas libblas.a /usr/local/lib)
MESSAGE(STATUS "CBLAS location is: " ${blas})
target_link_libraries(${PROJECT_NAME} ${blas})
Going by the message that cmake produces when reloaded, the cblas library seems to get found fine. However when I try and run my application, I get the following linker error message:
undefined reference to `cblas_dgemm`
Following are the contents of my main.c file
#include <stdio.h>
#include <stdlib.h>
#include <cblas.h>
int main(int arg, char *args[]) {
.
.
.
printf("Processing cblas_dgemm matrix multiplication.\n");
cblas_dgemm(CblasRowMajor, CblasNoTrans, CblasNoTrans, N, N, N, alpha, A[0], N, B[0], N, beta, C[0], N);
.
.
.
return 0;
}
I'm not entirely sure where I'm going wrong here. I'm very new using cmake, and I'm going around in circles trying to figure out what the problems is, when searching online. Any pointers in the right direction would be greatly received, and appreciated.
Ammendment (CMakeOutput.txt is as follows)
The system is: Linux - 5.4.8-200.fc31.x86_64 - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /usr/bin/cc
Build flags:
Id flags:
The output was:
0
Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "a.out"
The C compiler identification is GNU, found in "/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/3.15.3/CompilerIdC/a.out"
Determining if the C compiler works passed with the following output:
Change Dir: /home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_3ac25/fast && gmake[1]: Entering directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
/usr/bin/gmake -f CMakeFiles/cmTC_3ac25.dir/build.make CMakeFiles/cmTC_3ac25.dir/build
gmake[2]: Entering directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_3ac25.dir/testCCompiler.c.o
/usr/bin/cc -o CMakeFiles/cmTC_3ac25.dir/testCCompiler.c.o -c /home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_3ac25
/home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3ac25.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_3ac25.dir/testCCompiler.c.o -o cmTC_3ac25
gmake[2]: Leaving directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
gmake[1]: Leaving directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
Detecting C compiler ABI info compiled with the following output:
Change Dir: /home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_8e81c/fast && gmake[1]: Entering directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
/usr/bin/gmake -f CMakeFiles/cmTC_8e81c.dir/build.make CMakeFiles/cmTC_8e81c.dir/build
gmake[2]: Entering directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o
/usr/bin/cc -v -o CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -c /home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/share/cmake-3.15/Modules/CMakeCCompilerABI.c
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/9/cc1 -quiet -v /home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/share/cmake-3.15/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -version -o /tmp/ccTuVrPj.s
GNU C17 (GCC) version 9.2.1 20190827 (Red Hat 9.2.1-1) (x86_64-redhat-linux)
compiled by GNU C version 9.2.1 20190827 (Red Hat 9.2.1-1), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.16.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/9/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/9/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-redhat-linux/9/include
/usr/local/include
/usr/include
End of search list.
GNU C17 (GCC) version 9.2.1 20190827 (Red Hat 9.2.1-1) (x86_64-redhat-linux)
compiled by GNU C version 9.2.1 20190827 (Red Hat 9.2.1-1), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.16.1-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 0e6902e158034d8f60c5405e0210406c
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
as -v --64 -o CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o /tmp/ccTuVrPj.s
GNU assembler version 2.32 (x86_64-redhat-linux) using BFD version version 2.32-30.fc31
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64'
Linking C executable cmTC_8e81c
/home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8e81c.dir/link.txt --verbose=1
/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -o cmTC_8e81c
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_8e81c' '-mtune=generic' '-march=x86-64'
/usr/libexec/gcc/x86_64-redhat-linux/9/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/9/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccTQ8sAE.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_8e81c /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/9/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/9 -L/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/9/../../.. CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-redhat-linux/9/crtend.o /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o
COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_8e81c' '-mtune=generic' '-march=x86-64'
gmake[2]: Leaving directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
gmake[1]: Leaving directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp'
Parsed C implicit include dir info from above output: rv=done
found start of include info
found start of implicit include info
add: [/usr/lib/gcc/x86_64-redhat-linux/9/include]
add: [/usr/local/include]
add: [/usr/include]
end of search list found
collapse include dir [/usr/lib/gcc/x86_64-redhat-linux/9/include] ==> [/usr/lib/gcc/x86_64-redhat-linux/9/include]
collapse include dir [/usr/local/include] ==> [/usr/local/include]
collapse include dir [/usr/include] ==> [/usr/include]
implicit include dirs: [/usr/lib/gcc/x86_64-redhat-linux/9/include;/usr/local/include;/usr/include]
Parsed C implicit link information from above output:
link line regex: [^( *|.*[/\])(ld|CMAKE_LINK_STARTFILE-NOTFOUND|([^/\]+-)?ld|collect2)[^/\]*( |$)]
ignore line: [Change Dir: /home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp]
ignore line: []
ignore line: [Run Build Command(s):/usr/bin/gmake cmTC_8e81c/fast && gmake[1]: Entering directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp']
ignore line: [/usr/bin/gmake -f CMakeFiles/cmTC_8e81c.dir/build.make CMakeFiles/cmTC_8e81c.dir/build]
ignore line: [gmake[2]: Entering directory '/home/xxx.xxx/CLionProjects/assignment_2/cmake-build-debug/CMakeFiles/CMakeTmp']
ignore line: [Building C object CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o]
ignore line: [/usr/bin/cc -v -o CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -c /home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/share/cmake-3.15/Modules/CMakeCCompilerABI.c]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-redhat-linux]
ignore line: [Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux]
ignore line: [Thread model: posix]
ignore line: [gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC) ]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [ /usr/libexec/gcc/x86_64-redhat-linux/9/cc1 -quiet -v /home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/share/cmake-3.15/Modules/CMakeCCompilerABI.c -quiet -dumpbase CMakeCCompilerABI.c -mtune=generic -march=x86-64 -auxbase-strip CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -version -o /tmp/ccTuVrPj.s]
ignore line: [GNU C17 (GCC) version 9.2.1 20190827 (Red Hat 9.2.1-1) (x86_64-redhat-linux)]
ignore line: [ compiled by GNU C version 9.2.1 20190827 (Red Hat 9.2.1-1), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.16.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/9/include-fixed"]
ignore line: [ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/9/../../../../x86_64-redhat-linux/include"]
ignore line: [#include "..." search starts here:]
ignore line: [#include <...> search starts here:]
ignore line: [ /usr/lib/gcc/x86_64-redhat-linux/9/include]
ignore line: [ /usr/local/include]
ignore line: [ /usr/include]
ignore line: [End of search list.]
ignore line: [GNU C17 (GCC) version 9.2.1 20190827 (Red Hat 9.2.1-1) (x86_64-redhat-linux)]
ignore line: [ compiled by GNU C version 9.2.1 20190827 (Red Hat 9.2.1-1), GMP version 6.1.2, MPFR version 3.1.6-p2, MPC version 1.1.0, isl version isl-0.16.1-GMP]
ignore line: []
ignore line: [GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072]
ignore line: [Compiler executable checksum: 0e6902e158034d8f60c5405e0210406c]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [ as -v --64 -o CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o /tmp/ccTuVrPj.s]
ignore line: [GNU assembler version 2.32 (x86_64-redhat-linux) using BFD version version 2.32-30.fc31]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-o' 'CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o' '-c' '-mtune=generic' '-march=x86-64']
ignore line: [Linking C executable cmTC_8e81c]
ignore line: [/home/xxx.xxx/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/193.5662.56/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8e81c.dir/link.txt --verbose=1]
ignore line: [/usr/bin/cc -v -rdynamic CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -o cmTC_8e81c ]
ignore line: [Using built-in specs.]
ignore line: [COLLECT_GCC=/usr/bin/cc]
ignore line: [COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper]
ignore line: [OFFLOAD_TARGET_NAMES=nvptx-none]
ignore line: [OFFLOAD_TARGET_DEFAULT=1]
ignore line: [Target: x86_64-redhat-linux]
ignore line: [Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux]
ignore line: [Thread model: posix]
ignore line: [gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC) ]
ignore line: [COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/9/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/]
ignore line: [LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/9/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/9/../../../:/lib/:/usr/lib/]
ignore line: [COLLECT_GCC_OPTIONS='-v' '-rdynamic' '-o' 'cmTC_8e81c' '-mtune=generic' '-march=x86-64']
link line: [ /usr/libexec/gcc/x86_64-redhat-linux/9/collect2 -plugin /usr/libexec/gcc/x86_64-redhat-linux/9/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper -plugin-opt=-fresolution=/tmp/ccTQ8sAE.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id --no-add-needed --eh-frame-hdr --hash-style=gnu -m elf_x86_64 -export-dynamic -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o cmTC_8e81c /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/9/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/9 -L/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/9/../../.. CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/lib/gcc/x86_64-redhat-linux/9/crtend.o /usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o]
arg [/usr/libexec/gcc/x86_64-redhat-linux/9/collect2] ==> ignore
arg [-plugin] ==> ignore
arg [/usr/libexec/gcc/x86_64-redhat-linux/9/liblto_plugin.so] ==> ignore
arg [-plugin-opt=/usr/libexec/gcc/x86_64-redhat-linux/9/lto-wrapper] ==> ignore
arg [-plugin-opt=-fresolution=/tmp/ccTQ8sAE.res] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [-plugin-opt=-pass-through=-lc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
arg [-plugin-opt=-pass-through=-lgcc_s] ==> ignore
arg [--build-id] ==> ignore
arg [--no-add-needed] ==> ignore
arg [--eh-frame-hdr] ==> ignore
arg [--hash-style=gnu] ==> ignore
arg [-m] ==> ignore
arg [elf_x86_64] ==> ignore
arg [-export-dynamic] ==> ignore
arg [-dynamic-linker] ==> ignore
arg [/lib64/ld-linux-x86-64.so.2] ==> ignore
arg [-o] ==> ignore
arg [cmTC_8e81c] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crt1.o] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crti.o] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/9/crtbegin.o] ==> ignore
arg [-L/usr/lib/gcc/x86_64-redhat-linux/9] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/9]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64]
arg [-L/lib/../lib64] ==> dir [/lib/../lib64]
arg [-L/usr/lib/../lib64] ==> dir [/usr/lib/../lib64]
arg [-L/usr/lib/gcc/x86_64-redhat-linux/9/../../..] ==> dir [/usr/lib/gcc/x86_64-redhat-linux/9/../../..]
arg [CMakeFiles/cmTC_8e81c.dir/CMakeCCompilerABI.c.o] ==> ignore
arg [-lgcc] ==> lib [gcc]
arg [--push-state] ==> ignore
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--pop-state] ==> ignore
arg [-lc] ==> lib [c]
arg [-lgcc] ==> lib [gcc]
arg [--push-state] ==> ignore
arg [--as-needed] ==> ignore
arg [-lgcc_s] ==> lib [gcc_s]
arg [--pop-state] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/9/crtend.o] ==> ignore
arg [/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64/crtn.o] ==> ignore
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/9] ==> [/usr/lib/gcc/x86_64-redhat-linux/9]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/9/../../../../lib64] ==> [/usr/lib64]
collapse library dir [/lib/../lib64] ==> [/lib64]
collapse library dir [/usr/lib/../lib64] ==> [/usr/lib64]
collapse library dir [/usr/lib/gcc/x86_64-redhat-linux/9/../../..] ==> [/usr/lib]
implicit libs: [gcc;gcc_s;c;gcc;gcc_s]
implicit dirs: [/usr/lib/gcc/x86_64-redhat-linux/9;/usr/lib64;/lib64;/usr/lib]
implicit fwks: []
Your CMakeLists.txt should have something that looks like this, following the FindBLAS suggestion:
include(FindBLAS)
if (BLAS_FOUND)
target_compile_options(${PROJECT_NAME} PRIVATE ${BLAS_LINKER_FLAGS})
target_link_libraries(${PROJECT_NAME} ${BLAS_LIBRARIES})
endif ()
Looks like the dynamic linker cannot find a shared library.
You can use ldd to inspect dynamic dependencies
Example looking at the dependencies of /bin/ls
ldd /bin/ls
linux-vdso.so.1 (0x00007ffcc3563000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f87e5459000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f87e5254000)
libc.so.6 => /lib64/libc.so.6 (0x00007f87e4e92000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f87e4c22000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f87e4a1e000)
/lib64/ld-linux-x86-64.so.2 (0x00005574bf12e000)
libattr.so.1 => /lib64/libattr.so.1 (0x00007f87e4817000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f87e45fa000)
Ensure the .so files exist at the path specified.
ldd manpage
I do not know how exactly you generated your libblas.a, but you could have a look at the FindBLAS CMake directive. (Take care about the note regarding C/C++)
https://cmake.org/cmake/help/v3.14/module/FindBLAS.html
There are a bunch of things that can go wrong here, but to simplify:
copy libblas.a into the same directory as your program
Reference it explicitly in the makefile.
Check to see the location of CBLAS in your output (not shown)
Verify the permissions of libblas.a, and look at the symbols using nm
Force CMake to link everything statically (e.g. here static link question
Your symptoms suggest that you are picking up some other blas library at compile but not at runtime.
This is a long but simple basic question. So anyone familiar could answer to my questions.
I have a simple program below on my CentOS 6.4 system. (have it unnder ~/test)
I wanted to test insmod and rmmod.
#include <linux/module.h>
static int __init hello_world( void )
{
printk( "hello world!\n" );
return 0;
}
static void __exit goodbye_world( void )
{
printk( "goodbye world!\n" );
}
module_init( hello_world );
module_exit( goodbye_world );
When I did
gcc -o hello_world hello_world.c
I got
hello_world.c:1:26: error: linux/module.h: No such file or directory
hello_world.c:3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hello_world'
hello_world.c:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'goodbye_world'
hello_world.c:14: warning: data definition has no type or storage class
hello_world.c:14: warning: parameter names (without types) in function declaration
hello_world.c:15: warning: data definition has no type or storage class
hello_world.c:15: warning: parameter names (without types) in function declaration
So I figured the include path is not setup correctly. I searched where this linux/module.h is located and found linux/module.h is under /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/module.h.
(When I give 'uname -a', I get
Linux stph45.etri.re.kr 2.6.32-358.2.1.el6.x86_64 #1 SMP Wed Mar 13 00:26:49 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
So this /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include is the right kernel header directory.)
Then I tried again like this
gcc -I/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/ -o hello_world hello_world.c
and got
In file included from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/list.h:7,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/module.h:9,
from hello_world.c:1:
/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/prefetch.h:14:27: error: asm/processor.h: No such file or directory
/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/prefetch.h:15:23: error: asm/cache.h: No such file or directory
... more lines ...
I found this architecture dependent header file in /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include/asm/processor.h. So this time I did
gcc -I/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include -I/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include -o hello_world hello_world.c
providing the separate header path for the arch dependent files. Now I have these errors..
In file included from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include/asm/percpu.h:45,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include/asm/current.h:5,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include/asm/processor.h:15,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/prefetch.h:14,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/list.h:7,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/module.h:9,
from hello_world.c:1:
/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/kernel.h:949:2: warning: #warning Attempt to use kernel headers from user space, see http:
In file included from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include/asm/processor.h:15,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/prefetch.h:14,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/list.h:7,
from /usr/src/kernels/2.6.32-358.2.1.el6.x86_64/include/linux/module.h:9,
from hello_world.c:1:
/usr/src/kernels/2.6.32-358.2.1.el6.x86_64/arch/x86/include/asm/current.h:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'struct'
.... more lines ....
I think this 'Attempt to user kernel headers' is ok in this case. and I have to find the cause of "error: expected '=', ',', ';', 'asm' or 'attribute' before 'struct'" error.
I think my gcc (I guess it came with the CentOS.) seems to have some problem. Can anybody tell me what's wrong with my gcc installation? Seeing below message, there are some mismatches and I don't know the procedures for the cures. (afraid to ruin the whole development tool chain which is dependent on gcc)
ckim#stph45:~/testprog] echo "" | gcc -o /tmp/tmp.o -v -x c -
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
COLLECT_GCC_OPTIONS='-o' '/tmp/tmp.o' '-v' '-mtune=generic'
/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/cc1 -quiet -v - -quiet -dumpbase - -mtune=generic -auxbase - -version -o /tmp/ccWAQshz.s
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include-fixed"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include
/usr/include
End of search list.
GNU C (GCC) version 4.4.7 20120313 (Red Hat 4.4.7-4) (x86_64-redhat-linux)
compiled by GNU C version 4.4.7 20120313 (Red Hat 4.4.7-4), GMP version 4.3.1, MPFR version 2.4.1.
warning: GMP header version 4.3.1 differs from library version 4.3.2.
warning: MPFR header version 2.4.1 differs from library version 2.4.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 11481e4aa93ef024f1be70ed47ae45e3
COLLECT_GCC_OPTIONS='-o' '/tmp/tmp.o' '-v' '-mtune=generic'
as -V -Qy -o /tmp/ccTYQoBw.o /tmp/ccWAQshz.s
GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version version 2.20.51.0.2-5.36.el6 20100205
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-o' '/tmp/tmp.o' '-v' '-mtune=generic'
/usr/libexec/gcc/x86_64-redhat-linux/4.4.7/collect2 --eh-frame-hdr --build-id -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o /tmp/tmp.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtbegin.o -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../.. /tmp/ccTYQoBw.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.4.7/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crtn.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
To compile a kernel module, you are supposed to write a Makefile to setup the kernel path and other environment variable.
You can use the below Makefile to build you kernel module
obj-m := hello_world.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
Copy the above contents to file name Makefile in the same directory as that of the source.
Just enter $ make command to build the module. The output would be hello_world.ko in the same directory.
Concerning the header/library mismatch
warning: GMP header version 4.3.1 differs from library version 4.3.2.
warning: MPFR header version 2.4.1 differs from library version 2.4.2.
it may not be a problem here. I suppose that GCC was compiled with GMP 4.3.1 and MPFR 2.4.1, but after that, the GMP and MPFR shared libraries were upgraded to ABI-compatible versions 4.3.2 and 2.4.2 respectively. If this is the case, this is allowed.
Objective-C has a runtime that translates its syntax into functions that are organized and compiled. Does C have a runtime library? Also, if anyone can answer the question, what are the steps GCC takes during C compilation? e.g. main.c >> main.s >> main.bin
Yes, the C language features a standard library; that is, a number of standard macros, routines and types one can use in his programs, apart from any in the core language itself.
In popular implementations, there is a separate library file containing the code for the C standard library. For example, in GNU/Linux environments, the GNU C library (libc) is almost always present. Microsoft provides the msvcrt.dll runtime library for the Windows system, and so on.
Also, the C standard library might not be available in freestanding implementations. Sometimes it is possible to compile a program without linking against the C standard library from your system. As an example, the Windows API is well known for behaving as a freestanding C programming environment (although one might need to link against other system libraries specific to Windows).
Regarding GCC, the following illustrates briefly the compilation pipeline:
The input source is preprocessed with GNU cpp, resulting in a translation unit. (Actually, as Basile pointed out, nowadays no cpp process is created; the entire preprocessing work is done within cc1. Nevertheless, the resulting behavior is most likely the same as with cpp.)
The translation unit is then interpreted and compiled to assembly source with GCC cc1;
The assembly source is then assembled into object code with GNU as;
Finally, object files and libraries are linked together to produce a binary image with GNU ld.
Naturally, each of these steps may be altered or not executed at all depending on the driver options; the above is just a rough explanation of the overall process.
C has a standard library (libc on Linux, which provides standard functions like those in <stdio.h> such as fprintf and in <stdlib.h> such as malloc and also all the system calls), and even when you use gcc in free standing mode with gcc -ffreestanding (e.g. to compile a libc or some kernel) it links a tiny libgcc library which provides the functionality built-in the language (e.g. 64 bits addition on 32 bits platforms).
To learn what the gcc command is doing, pass it the -v flag. (Don't forget to take the habit to always compile with -Wall to get warnings and -g to get the debug information), e.g.
% gcc -v -g -Wall hello.c -o hello
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-4' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-4)
COLLECT_GCC_OPTIONS='-v' '-g' '-Wall' '-o' 'hello' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.7/cc1 -quiet -v -imultiarch x86_64-linux-gnu hello.c -quiet -dumpbase hello.c -mtune=generic -march=x86-64 -auxbase hello -g -Wall -version -o /tmp/ccsWt3UC.s
GNU C (Debian 4.7.2-4) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/4.7/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.7/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C (Debian 4.7.2-4) version 4.7.2 (x86_64-linux-gnu)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.0-p10, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: c5f63dedeacd449634699df94fe3d914
COLLECT_GCC_OPTIONS='-v' '-g' '-Wall' '-o' 'hello' '-mtune=generic' '-march=x86-64'
as -v --64 -o /tmp/ccO5i3pU.o /tmp/ccsWt3UC.s
GNU assembler version 2.22 (x86_64-linux-gnu) using BFD version (GNU Binutils for Debian) 2.22
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.7/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-g' '-Wall' '-o' 'hello' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.7/collect2 --sysroot=/ --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o hello /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.7/crtbegin.o -L/usr/lib/gcc/x86_64-linux-gnu/4.7 -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.7/../../.. /tmp/ccO5i3pU.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.7/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.7/../../../x86_64-linux-gnu/crtn.o
Notice that collect2 is the linker wrapped to do additional things, and that libc.so gets used by almost every Linux executable (because it is wrapping syscalls).
C has a standard library (e.g., strlen, malloc, etc.)
The steps are: compile your code that uses the standard library, then link your code to the standard library. libc can be contained in either a static library or a dynamic library, depending; usually both are available.
I recently compiled Clang 2.9 (from here) on an Ubuntu system. I'm having trouble compiling and linking a simple program. Does anyone know how to fix this? Here's the output I see:
a#ubuntu:~/Desktop$ clang add.c
/usr/bin/ld: 1: Syntax error: word unexpected (expecting ")")
clang: error: linker command failed with exit code 2 (use -v to see invocation)
uname -a output
Linux ubuntu 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
gcc -v output:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4 --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
clang verbose ouput
clang version 2.9 (tags/RELEASE_29/final)
Target: i386-pc-linux-gnu
Thread model: posix
"/usr/local/bin/clang" -cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name add.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.21.0.20110327 -momit-leaf-frame-pointer -v -resource-dir /usr/local/bin/../lib/clang/2.9 -ferror-limit 19 -fmessage-length 138 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-JJruTv.o -x c add.c
clang -cc1 version 2.9 based upon llvm 2.9 hosted on i386-pc-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/bin/../lib/clang/2.9/include
/usr/include
End of search list.
"/usr/bin/ld" --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out crt1.o crti.o crtbegin.o -L -L/../../.. /tmp/cc-JJruTv.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o crtn.o
/usr/bin/ld: 1: Syntax error: word unexpected (expecting ")")
clang: error: linker command failed with exit code 2 (use -v to see invocation)
Sounds like a problem in your linker script. But the ld line above does not contain a specific linker script so the default one should be used (to see it simply type ld -v).
-L -L/../../..
that does look a bit weird. Don't see it on your original line though so not sure where it came from. Perhaps your installation is broken?
Do a gcc -v add.c and compare the lines invoking /usr/bin/ld. Perhaps add it to the question.