Skip to content

make fails on Mac OS X El Capitan #10

@MattVUIIS

Description

@MattVUIIS

Attempted to run make in the 'c' folder and got an error.

$ make
cc -std=c99 -O2 -Wall  -c ra.c -o ra.o
ra.c:94:53: warning: format specifies type 'unsigned int' but the argument has type 'unsigned long long' [-Wformat]
    printf("type: %c%u\n", RA_TYPE_CODES[a.eltype], a.elbyte*8);
                    ~~                              ^~~~~~~~~~
                    %llu
ra.c:95:28: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
    printf("eltype: %u\n", a.eltype);
                    ~~     ^~~~~~~~
                    %llu
ra.c:96:28: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
    printf("elbyte: %u\n", a.elbyte);
                    ~~     ^~~~~~~~
                    %llu
ra.c:97:26: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
    printf("size: %u\n", a.size);
                  ~~     ^~~~~~
                  %llu
ra.c:98:31: warning: format specifies type 'unsigned int' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
    printf("dimension: %u\n", a.ndims);
                       ~~     ^~~~~~~
                       %llu
ra.c:103:29: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
        printf("  - %lu\n", a.dims[j]);
                    ~~~     ^~~~~~~~~
                    %llu
ra.c:126:24: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
        printf("%lu ", a.dims[i]);
                ~~~    ^~~~~~~~~
                %llu
ra.c:573:12: warning: unused variable 'dynamic_range' [-Wunused-variable]
    double dynamic_range = fabs(min/max);
           ^
ra.c:667:21: warning: using floating point absolute value function 'fabs' when argument is of integer type
      [-Wabsolute-value]
            norm += fabs(a->data[i] - b->data[i]);
                    ^
ra.c:667:21: note: use function 'abs' instead
            norm += fabs(a->data[i] - b->data[i]);
                    ^~~~
                    abs
ra.c:682:9: warning: implicit declaration of function 'error' is invalid in C99 [-Wimplicit-function-declaration]
        error("Unknown diff_type %d\n", diff_type);
        ^
10 warnings generated.
cc -std=c99 -O2 -Wall  -c float16.c -o float16.o
cc -std=c99 -O2 -Wall  -c ra2cfl.c -o ra2cfl.o
ra2cfl.c:74:25: warning: format specifies type 'unsigned long' but the argument has type 'uint64_t'
      (aka 'unsigned long long') [-Wformat]
    fprintf(fp, "%lu ", a->dims[k]);
                 ~~~    ^~~~~~~~~~
                 %llu
1 warning generated.
cc -std=c99 ra.o float16.o ra2cfl.o -o ra2cfl -lm
Undefined symbols for architecture x86_64:
  "_error", referenced from:
      _ra_diff in ra.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [ra2cfl] Error 1

Compiler is clang:

$ cc --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions