0

我是 C 的新手。我正在尝试在 JavaScript 中进行一些矩阵操作,并希望将 C 库作为 Node JS 模块嵌入。我完成了一个概念验证模块,它可以做到这一点并且工作正常。

我从这里 (mesch12b.tar.gz)下载了 Meschach来进行矩阵操作。它看起来是我需要的一个不错的选择(尽管我对 C 或 C++ 中的其他选项持开放态度)。

出于某种原因,当我运行./configure脚本时,它找不到任何东西:

$ ./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

我的 PATH 看起来不错,cc并且gcc可以在我的系统上使用(我已经build-essential永远安装了):

$ which cc
/usr/bin/cc
$ which gcc
/usr/bin/gcc

我到处查看,但没有找到任何帮助。有小费吗?

更新

我发现如果我设置CC环境变量,我们可以解决第一个问题,但会出现更多问题。我将尝试一次解决它们,但如果有人能指出我做错的主要事情,我将不胜感激。

$ 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")
4

1 回答 1

0

我最终修复了配置错误(CC=/usr/bin在声明中添加了一些需要类型的方法等)。

但是随后构建有大约一百个警告/错误,我注意到文件中许可证的非标准且可能不自由的第三个条款,所以我放弃了它并打算使用不同的矩阵库。

于 2017-08-01T15:18:02.743 回答