I'm new-ish to C. I am trying to do some matrix manipulation in JavaScript and wanted to embed a C library as a Node JS module. I finished a proof-of-concept module that does this and is working fine.
I downloaded Meschach from here (mesch12b.tar.gz) to do matrix manipulation. It looks like a good option for what I need (though I'm open to other options in C or C++).
For some reason, when I run the ./configure
script, it can't find anything:
$ ./configure
loading cache ./config.cache
checking for acc... no
checking for cc... (cached) no
checking for gcc... (cached) no
checking for cc... (cached) no
configure: error: no acceptable cc found in $PATH
My PATH seems fine and cc
and gcc
are available on my system (I've had build-essential
installed forever):
$ which cc
/usr/bin/cc
$ which gcc
/usr/bin/gcc
I looked all over SO but didn't find anything that helped. Any tips?
UPDATE
I found that if I set the CC
environment variable, we get around the first problem, but more are arising. I'll try to work through them one at a time, but if anyone can point out something major I'm doing wrong, I'd appreciate it.
$ CC=/usr/bin/gcc ./configure
loading cache ./config.cache
checking for acc... /usr/bin/gcc
checking for cc... (cached) /usr/bin/gcc
checking for gcc... (cached) /usr/bin/gcc
checking whether the C compiler (/usr/bin/gcc ) works... yes
checking whether the C compiler (/usr/bin/gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether /usr/bin/gcc accepts -g... yes
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for AIX... no
./configure: 957: ./configure: AC_HPUX: not found
checking for minix/config.h... no
checking for POSIXized ISC... no
checking for ranlib... ranlib
checking for memory.h... yes
checking for ANSI C header files... yes
checking for complex.h... yes
checking for malloc.h... yes
checking for varargs.h... no
checking for size_t... yes
checking for working const... yes
checking whether byte ordering is bigendian... no
computing machine epsilon(s)
/usr/bin/gcc -o macheps dmacheps.c
dmacheps.c:37:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^
/usr/bin/gcc -o macheps fmacheps.c
fmacheps.c:37:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^
computing M_MAX_INT
/usr/bin/gcc -o maxint maxint.c
maxint.c:27:1: warning: return type defaults to 'int' [-Wimplicit-int]
main()
^
maxint.c: In function 'main':
maxint.c:37:5: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
printf("%d\n", old_i);
^
maxint.c:37:5: warning: incompatible implicit declaration of built-in function 'printf'
maxint.c:37:5: note: include '<stdio.h>' or provide a declaration of 'printf'
checking char \0 vs. float zeros
checking for bcopy... yes
checking for bzero... yes
./configure: 1697: ./configure: Syntax error: "(" unexpected (expecting "fi")
I ended up fixing the configure errors (adding CC=/usr/bin
a few methods needed types in the declarations, etc.).
But then the build had about a hundred warnings/errors, and I noticed the non-standard and potentially illiberal third clause of the license in the files, so I abandoned it and am going to go with a different matrix library instead.