Giter Site home page Giter Site logo

Comments (12)

ruanjue avatar ruanjue commented on July 22, 2024

There should be the problem of serach path of GCC. I have a string.h in sourcecode, your GCC used it even I wrote "#include <string.h>", which usually search the glib's string.h first.

Please run gcc -v, and copy the message into this issue.

from wtdbg.

YiweiNiu avatar YiweiNiu commented on July 22, 2024

Thank you for your quick reply!

Here are the messages when running "gcc -v":

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/software/gcc-4.9.3 --with-mpc=/home/software/
Thread model: posix
gcc version 4.9.3 (GCC)

from wtdbg.

ruanjue avatar ruanjue commented on July 22, 2024

Ok, please also give me the message of cpp -v.

from wtdbg.

YiweiNiu avatar YiweiNiu commented on July 22, 2024

Run cpp -v:

Using built-in specs.
COLLECT_GCC=cpp
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/software/gcc-4.9.3 --with-mpc=/home/software/
Thread model: posix
gcc version 4.9.3 (GCC) 
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
 /home/software/gcc-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/cc1 -E -quiet -v - -mtune=generic -march=x86-64
ignoring nonexistent directory "/home/software/gcc-4.9.3/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /public/software/compiler/intel/composer_xe_2013_sp1.0.080/mkl/include
 .
 /home/software/gcc-4.9.3/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include
 /usr/local/include
 /home/software/gcc-4.9.3/include
 /home/software/gcc-4.9.3/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed
 /usr/include
End of search list.

from wtdbg.

ruanjue avatar ruanjue commented on July 22, 2024

The path . preceded /home/software/gcc-4.9.3/include, it was the problem.

Please type echo $CPATH. If contains ., remove it.

Otherwise, modify Makefile as
Line 4: CC="gcc -I/home/software/gcc-4.9.3/include"
Then make

from wtdbg.

YiweiNiu avatar YiweiNiu commented on July 22, 2024

Thanks for the help!

Here are the messages I got:

$ echo $CPATH
/public/software/compiler/intel/composer_xe_2013_sp1.0.080/mkl/include:

CPATH doesn't contain '.'. Then I modify the Makefile, but still not work:

$ make
"gcc -I/home/software/gcc-4.9.3/include" -g3 -W -Wall -O4 -DTIMESTAMP=1520252552 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -mpopcnt -mssse3 -o wtdbg file_reader.c wtdbg.c -lm -lpthread
/bin/sh: gcc -I/home/software/gcc-4.9.3/include: No such file or directory
make: *** [wtdbg] Error 127

from wtdbg.

ruanjue avatar ruanjue commented on July 22, 2024

CC=gcc -I/home/software/gcc-4.9.3/include, remove the quote.

from wtdbg.

YiweiNiu avatar YiweiNiu commented on July 22, 2024

After removing the quote, I got the same error as the one I attched at the beginning.

from wtdbg.

ruanjue avatar ruanjue commented on July 22, 2024

CC=gcc -v -I/home/software/gcc-4.9.3/include. Please give me the first 60 lines of gcc message.

from wtdbg.

YiweiNiu avatar YiweiNiu commented on July 22, 2024

Messages after using CC=gcc -v -I/home/software/gcc-4.9.3/include:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/software/gcc-4.9.3 --with-mpc=/home/software/
Thread model: posix
gcc version 4.9.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-I' '/home/software/gcc-4.9.3/include' '-g3' '-Wextra' '-Wall' '-O4' '-D' 'TIMESTAMP=1520296709' '-D' '_FILE_OFFSET_BITS=64' '-D' '_GNU_SOURCE' '-mpopcnt' '-mssse3' '-o' 'wtdbg' '-mtune=generic' '-march=x86-64'
 /home/software/gcc-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/cc1 -quiet -v -I /home/software/gcc-4.9.3/include -dD -D TIMESTAMP=1520296709 -D _FILE_OFFSET_BITS=64 -D _GNU_SOURCE file_reader.c -quiet -dumpbase file_reader.c -mpopcnt -mssse3 -mtune=generic -march=x86-64 -auxbase file_reader -g3 -O4 -Wextra -Wall -version -o /tmp/ccs9kVa3.s
GNU C (GCC) version 4.9.3 (x86_64-unknown-linux-gnu)
	compiled by GNU C version 4.9.3, GMP version 5.0.2, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/home/software/gcc-4.9.3/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory "/home/software/gcc-4.9.3/include"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:
 /public/software/compiler/intel/composer_xe_2013_sp1.0.080/mkl/include
 .
 /home/software/gcc-4.9.3/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include
 /usr/local/include
 /home/software/gcc-4.9.3/include
 /home/software/gcc-4.9.3/lib/gcc/x86_64-unknown-linux-gnu/4.9.3/include-fixed
 /usr/include
End of search list.
GNU C (GCC) version 4.9.3 (x86_64-unknown-linux-gnu)
	compiled by GNU C version 4.9.3, GMP version 5.0.2, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 20795a83d25b409b202bf0afa3a704bc
In file included from ./list.h:28:0,
                 from ./string.h:27,
                 from file_reader.h:24,
                 from file_reader.c:20:
./mem_share.h: In function ‘encap_list’:
./mem_share.h:159:2: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration]
  if(mem_zeros) memset(ptr + cur_cap, 0, e_size * (cap - cur_cap));
  ^
./mem_share.h:159:16: warning: incompatible implicit declaration of built-in function ‘memset’
  if(mem_zeros) memset(ptr + cur_cap, 0, e_size * (cap - cur_cap));
                ^
./mem_share.h: In function ‘open_file_for_read’:
./mem_share.h:226:3: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
   full_name = (char*)alloca(strlen(name) + strlen(suffix) + 1);
   ^
In file included from /usr/include/stdlib.h:497:0,
                 from file_reader.h:23,
                 from file_reader.c:20:
./mem_share.h:226:29: warning: incompatible implicit declaration of built-in function ‘strlen’
   full_name = (char*)alloca(strlen(name) + strlen(suffix) + 1);
                             ^
In file included from ./list.h:28:0,
                 from ./string.h:27,
                 from file_reader.h:24,
                 from file_reader.c:20:
./mem_share.h:227:3: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
   memcpy(full_name, name, strlen(name));
   ^
./mem_share.h:227:3: warning: incompatible implicit declaration of built-in function ‘memcpy’
./mem_share.h:230:2: warning: implicit declaration of function ‘strcmp’ [-Wimplicit-function-declaration]
  if(strcmp(full_name, "-") == 0){
  ^
In file included from /usr/include/stdlib.h:497:0,
                 from file_reader.h:23,
                 from file_reader.c:20:
./mem_share.h: In function ‘open_file_for_write’:
./mem_share.h:251:29: warning: incompatible implicit declaration of built-in function ‘strlen’
   full_name = (char*)alloca(strlen(name) + strlen(suffix) + 1);
                             ^
In file included from ./list.h:28:0,
                 from ./string.h:27,
                 from file_reader.h:24,
                 from file_reader.c:20:
./mem_share.h:252:3: warning: incompatible implicit declaration of built-in function ‘memcpy’
   memcpy(full_name, name, strlen(name));
   ^
In file included from /usr/include/stdlib.h:497:0,
                 from file_reader.h:23,
                 from file_reader.c:20:
./mem_share.h: In function ‘open_file_for_append’:
./mem_share.h:278:29: warning: incompatible implicit declaration of built-in function ‘strlen’
   full_name = (char*)alloca(strlen(name) + strlen(suffix) + 1);
                             ^
In file included from ./list.h:28:0,
                 from ./string.h:27,
                 from file_reader.h:24,
                 from file_reader.c:20:
./mem_share.h:279:3: warning: incompatible implicit declaration of built-in function ‘memcpy’
   memcpy(full_name, name, strlen(name));
   ^
./mem_share.h: In function ‘get_linux_sys_info’:
./mem_share.h:316:3: warning: implicit declaration of function ‘strstr’ [-Wimplicit-function-declaration]
   if (strstr(buffer, "MemTotal") == buffer) {
   ^
./mem_share.h:316:7: warning: incompatible implicit declaration of built-in function ‘strstr’
   if (strstr(buffer, "MemTotal") == buffer) {
       ^
./mem_share.h:331:7: warning: incompatible implicit declaration of built-in function ‘strstr’
   if (strstr(buffer, "processor") == buffer) {
       ^
./mem_share.h: In function ‘_char_array_obj_desc_cnt’:
...

Sorry for the late reply.

from wtdbg.

ruanjue avatar ruanjue commented on July 22, 2024

Haha, I see. Your CPATH!
Remove tailing :
export CPATH="/public/software/compiler/intel/composer_xe_2013_sp1.0.080/mkl/include".
make

from wtdbg.

YiweiNiu avatar YiweiNiu commented on July 22, 2024

It works! Thanks for your patience and kindness~

from wtdbg.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.