构建libgit2、openssl_stream.c和;错误:取消引用指向不完整类型的指针;对于BIOs

构建libgit2、openssl_stream.c和;错误:取消引用指向不完整类型的指针;对于BIOs,git,openssl,julia,libgit2,Git,Openssl,Julia,Libgit2,我正在新安装的操作系统Ubuntu 14.04.1上从源代码构建Julia。 git clone https://github.com/JuliaLang/julia.git make -C deps getall make -j 12 构建libgit2时发生openssl错误,libgit2是Julia的依赖项之一 错误消息如下: [ 11%] Building C object CMakeFiles/libgit2_clar.dir/src/pathspec.c.o /home/guo

我正在新安装的操作系统Ubuntu 14.04.1上从源代码构建
Julia

git clone https://github.com/JuliaLang/julia.git 
make -C deps getall
make -j 12
构建libgit2时发生
openssl
错误,libgit2是
Julia
的依赖项之一

错误消息如下:

[ 11%] Building C object CMakeFiles/libgit2_clar.dir/src/pathspec.c.o
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c: In function ‘bio_create’:
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:159:3: error: dereferencing pointer to incomplete type
  b->init = 1;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:160:3: error: dereferencing pointer to incomplete type
  b->num = 0;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:161:3: error: dereferencing pointer to incomplete type
  b->ptr = NULL;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:162:3: error: dereferencing pointer to incomplete type
  b->flags = 0;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c: In function ‘bio_destroy’:
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:172:3: error: dereferencing pointer to incomplete type
  b->init = 0;
guo@dllab:~/Github/libgit2/build$ make  VERBOSE=1
/home/guo/data/software/cmake-3.6.1-Linux-x86_64/bin/cmake -H/home/guo/Github/libgit2 -B/home/guo/Github/libgit2/build --check-build-system CMakeFiles/Makefile.cmake 0
/home/guo/data/software/cmake-3.6.1-Linux-x86_64/bin/cmake -E cmake_progress_start /home/guo/Github/libgit2/build/CMakeFiles /home/guo/Github/libgit2/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/guo/Github/libgit2/build'
make -f CMakeFiles/libgit2_clar.dir/build.make CMakeFiles/libgit2_clar.dir/depend
make[2]: Entering directory `/home/guo/Github/libgit2/build'
cd /home/guo/Github/libgit2/build && /home/guo/data/software/cmake-3.6.1-Linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /home/guo/Github/libgit2 /home/guo/Github/libgit2 /home/guo/Github/libgit2/build /home/guo/Github/libgit2/build /home/guo/Github/libgit2/build/CMakeFiles/libgit2_clar.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/guo/Github/libgit2/build'
make -f CMakeFiles/libgit2_clar.dir/build.make CMakeFiles/libgit2_clar.dir/build
make[2]: Entering directory `/home/guo/Github/libgit2/build'
[  0%] Building C object CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o
/usr/bin/cc  -DCLAR_FIXTURE_PATH=\"/home/guo/Github/libgit2/tests/resources/\" -DCLAR_RESOURCES=\"\" -DCLAR_TMPDIR=\"libgit2_tests\" -DGIT_ARCH_64 -DGIT_CURL -DGIT_OPENSSL -DGIT_THREADS -DGIT_USE_NSEC -DGIT_USE_STAT_MTIM -DHAVE_FUTIMENS -DHAVE_QSORT_R -DOPENSSL_SHA1 -D_FILE_OFFSET_BITS=64 -I/home/guo/Github/libgit2/src -I/home/guo/Github/libgit2/include -I/usr/local/include -I/home/guo/Github/libgit2/deps/http-parser -I/home/guo/Github/libgit2/tests  -D_GNU_SOURCE -Wall -Wextra  -fvisibility=hidden -fPIC -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-function -g   -o CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o   -c /home/guo/Github/libgit2/src/openssl_stream.c
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_create’:
/home/guo/Github/libgit2/src/openssl_stream.c:159:3: error: dereferencing pointer to incomplete type
  b->init = 1;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:160:3: error: dereferencing pointer to incomplete type
  b->num = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:161:3: error: dereferencing pointer to incomplete type
  b->ptr = NULL;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:162:3: error: dereferencing pointer to incomplete type
  b->flags = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_destroy’:
/home/guo/Github/libgit2/src/openssl_stream.c:172:3: error: dereferencing pointer to incomplete type
  b->init = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:173:3: error: dereferencing pointer to incomplete type
  b->num = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:174:3: error: dereferencing pointer to incomplete type
  b->ptr = NULL;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:175:3: error: dereferencing pointer to incomplete type
  b->flags = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_read’:
/home/guo/Github/libgit2/src/openssl_stream.c:182:35: error: dereferencing pointer to incomplete type
  git_stream *io = (git_stream *) b->ptr;
                                   ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_write’:
/home/guo/Github/libgit2/src/openssl_stream.c:188:35: error: dereferencing pointer to incomplete type
  git_stream *io = (git_stream *) b->ptr;
                                   ^
/home/guo/Github/libgit2/src/openssl_stream.c: At top level:
/home/guo/Github/libgit2/src/openssl_stream.c:217:1: error: variable ‘git_stream_bio_method’ has initializer but incomplete type
 static BIO_METHOD git_stream_bio_method = {
 ^
/home/guo/Github/libgit2/src/openssl_stream.c:218:2: warning: excess elements in struct initializer [enabled by default]
  BIO_TYPE_SOURCE_SINK,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:218:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:219:2: warning: excess elements in struct initializer [enabled by default]
  "git_stream",
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:219:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:220:2: warning: excess elements in struct initializer [enabled by default]
  bio_write,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:220:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:221:2: warning: excess elements in struct initializer [enabled by default]
  bio_read,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:221:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:222:2: warning: excess elements in struct initializer [enabled by default]
  bio_puts,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:222:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:223:2: warning: excess elements in struct initializer [enabled by default]
  bio_gets,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:223:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:224:2: warning: excess elements in struct initializer [enabled by default]
  bio_ctrl,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:224:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:225:2: warning: excess elements in struct initializer [enabled by default]
  bio_create,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:225:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:227:1: warning: excess elements in struct initializer [enabled by default]
 };
 ^
/home/guo/Github/libgit2/src/openssl_stream.c:227:1: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘verify_server_cert’:
/home/guo/Github/libgit2/src/openssl_stream.c:342:4: warning: ‘ASN1_STRING_data’ is deprecated (declared at /usr/local/include/openssl/asn1.h:553) [-Wdeprecated-declarations]
    const char *name = (char *) ASN1_STRING_data(gn->d.ia5);
    ^
/home/guo/Github/libgit2/src/openssl_stream.c:397:4: warning: ‘ASN1_STRING_data’ is deprecated (declared at /usr/local/include/openssl/asn1.h:553) [-Wdeprecated-declarations]
    memcpy(peer_cn, ASN1_STRING_data(str), size);
    ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘openssl_connect’:
/home/guo/Github/libgit2/src/openssl_stream.c:450:5: error: dereferencing pointer to incomplete type
  bio->ptr = st->io;
     ^
make[2]: *** [CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o] Error 1
make[2]: Leaving directory `/home/guo/Github/libgit2/build'
make[1]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2
make[1]: Leaving directory `/home/guo/Github/libgit2/build'
make: *** [all] Error 2

make VERBOSE=1
之后,错误消息如下:

[ 11%] Building C object CMakeFiles/libgit2_clar.dir/src/pathspec.c.o
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c: In function ‘bio_create’:
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:159:3: error: dereferencing pointer to incomplete type
  b->init = 1;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:160:3: error: dereferencing pointer to incomplete type
  b->num = 0;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:161:3: error: dereferencing pointer to incomplete type
  b->ptr = NULL;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:162:3: error: dereferencing pointer to incomplete type
  b->flags = 0;
   ^
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c: In function ‘bio_destroy’:
/home/guo/Github/julia/deps/srccache/libgit2-211e117a0590583a720c53172406f34186c543bd/src/openssl_stream.c:172:3: error: dereferencing pointer to incomplete type
  b->init = 0;
guo@dllab:~/Github/libgit2/build$ make  VERBOSE=1
/home/guo/data/software/cmake-3.6.1-Linux-x86_64/bin/cmake -H/home/guo/Github/libgit2 -B/home/guo/Github/libgit2/build --check-build-system CMakeFiles/Makefile.cmake 0
/home/guo/data/software/cmake-3.6.1-Linux-x86_64/bin/cmake -E cmake_progress_start /home/guo/Github/libgit2/build/CMakeFiles /home/guo/Github/libgit2/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/guo/Github/libgit2/build'
make -f CMakeFiles/libgit2_clar.dir/build.make CMakeFiles/libgit2_clar.dir/depend
make[2]: Entering directory `/home/guo/Github/libgit2/build'
cd /home/guo/Github/libgit2/build && /home/guo/data/software/cmake-3.6.1-Linux-x86_64/bin/cmake -E cmake_depends "Unix Makefiles" /home/guo/Github/libgit2 /home/guo/Github/libgit2 /home/guo/Github/libgit2/build /home/guo/Github/libgit2/build /home/guo/Github/libgit2/build/CMakeFiles/libgit2_clar.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/guo/Github/libgit2/build'
make -f CMakeFiles/libgit2_clar.dir/build.make CMakeFiles/libgit2_clar.dir/build
make[2]: Entering directory `/home/guo/Github/libgit2/build'
[  0%] Building C object CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o
/usr/bin/cc  -DCLAR_FIXTURE_PATH=\"/home/guo/Github/libgit2/tests/resources/\" -DCLAR_RESOURCES=\"\" -DCLAR_TMPDIR=\"libgit2_tests\" -DGIT_ARCH_64 -DGIT_CURL -DGIT_OPENSSL -DGIT_THREADS -DGIT_USE_NSEC -DGIT_USE_STAT_MTIM -DHAVE_FUTIMENS -DHAVE_QSORT_R -DOPENSSL_SHA1 -D_FILE_OFFSET_BITS=64 -I/home/guo/Github/libgit2/src -I/home/guo/Github/libgit2/include -I/usr/local/include -I/home/guo/Github/libgit2/deps/http-parser -I/home/guo/Github/libgit2/tests  -D_GNU_SOURCE -Wall -Wextra  -fvisibility=hidden -fPIC -Wno-missing-field-initializers -Wstrict-aliasing=2 -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-function -g   -o CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o   -c /home/guo/Github/libgit2/src/openssl_stream.c
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_create’:
/home/guo/Github/libgit2/src/openssl_stream.c:159:3: error: dereferencing pointer to incomplete type
  b->init = 1;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:160:3: error: dereferencing pointer to incomplete type
  b->num = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:161:3: error: dereferencing pointer to incomplete type
  b->ptr = NULL;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:162:3: error: dereferencing pointer to incomplete type
  b->flags = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_destroy’:
/home/guo/Github/libgit2/src/openssl_stream.c:172:3: error: dereferencing pointer to incomplete type
  b->init = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:173:3: error: dereferencing pointer to incomplete type
  b->num = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:174:3: error: dereferencing pointer to incomplete type
  b->ptr = NULL;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c:175:3: error: dereferencing pointer to incomplete type
  b->flags = 0;
   ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_read’:
/home/guo/Github/libgit2/src/openssl_stream.c:182:35: error: dereferencing pointer to incomplete type
  git_stream *io = (git_stream *) b->ptr;
                                   ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_write’:
/home/guo/Github/libgit2/src/openssl_stream.c:188:35: error: dereferencing pointer to incomplete type
  git_stream *io = (git_stream *) b->ptr;
                                   ^
/home/guo/Github/libgit2/src/openssl_stream.c: At top level:
/home/guo/Github/libgit2/src/openssl_stream.c:217:1: error: variable ‘git_stream_bio_method’ has initializer but incomplete type
 static BIO_METHOD git_stream_bio_method = {
 ^
/home/guo/Github/libgit2/src/openssl_stream.c:218:2: warning: excess elements in struct initializer [enabled by default]
  BIO_TYPE_SOURCE_SINK,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:218:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:219:2: warning: excess elements in struct initializer [enabled by default]
  "git_stream",
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:219:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:220:2: warning: excess elements in struct initializer [enabled by default]
  bio_write,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:220:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:221:2: warning: excess elements in struct initializer [enabled by default]
  bio_read,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:221:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:222:2: warning: excess elements in struct initializer [enabled by default]
  bio_puts,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:222:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:223:2: warning: excess elements in struct initializer [enabled by default]
  bio_gets,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:223:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:224:2: warning: excess elements in struct initializer [enabled by default]
  bio_ctrl,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:224:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:225:2: warning: excess elements in struct initializer [enabled by default]
  bio_create,
  ^
/home/guo/Github/libgit2/src/openssl_stream.c:225:2: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c:227:1: warning: excess elements in struct initializer [enabled by default]
 };
 ^
/home/guo/Github/libgit2/src/openssl_stream.c:227:1: warning: (near initialization for ‘git_stream_bio_method’) [enabled by default]
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘verify_server_cert’:
/home/guo/Github/libgit2/src/openssl_stream.c:342:4: warning: ‘ASN1_STRING_data’ is deprecated (declared at /usr/local/include/openssl/asn1.h:553) [-Wdeprecated-declarations]
    const char *name = (char *) ASN1_STRING_data(gn->d.ia5);
    ^
/home/guo/Github/libgit2/src/openssl_stream.c:397:4: warning: ‘ASN1_STRING_data’ is deprecated (declared at /usr/local/include/openssl/asn1.h:553) [-Wdeprecated-declarations]
    memcpy(peer_cn, ASN1_STRING_data(str), size);
    ^
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘openssl_connect’:
/home/guo/Github/libgit2/src/openssl_stream.c:450:5: error: dereferencing pointer to incomplete type
  bio->ptr = st->io;
     ^
make[2]: *** [CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o] Error 1
make[2]: Leaving directory `/home/guo/Github/libgit2/build'
make[1]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2
make[1]: Leaving directory `/home/guo/Github/libgit2/build'
make: *** [all] Error 2

您需要根据Julia
README.md
安装l
libssl dev

openssl-需要Linux上libgit2中的HTTPS支持,请通过apt get install libssl dev或yum install openssl devel安装

因此,为了在Ubuntu中安装它,在终端中发出以下命令:

sudo apt-get install libssl-dev
之后,您可以再次尝试重新编译Julia

/usr/bin/cc  -DCLAR_FIXTURE_PATH=\"/home/guo/Github/libgit2/tests/resources/\" -DCLAR_RESOURCES=\"\"
-DCLAR_TMPDIR=\"libgit2_tests\" -DGIT_ARCH_64 -DGIT_CURL -DGIT_OPENSSL -DGIT_THREADS
-DGIT_USE_NSEC -DGIT_USE_STAT_MTIM -DHAVE_FUTIMENS -DHAVE_QSORT_R -DOPENSSL_SHA1
-D_FILE_OFFSET_BITS=64 -I/home/guo/Github/libgit2/src -I/home/guo/Github/libgit2/include
-I/usr/local/include -I/home/guo/Github/libgit2/deps/http-parser -I/home/guo/Github/libgit2/tests
-D_GNU_SOURCE -Wall -Wextra -fvisibility=hidden -fPIC -Wno-missing-field-initializers
-Wstrict-aliasing=2 -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-function -g 
-o CMakeFiles/libgit2_clar.dir/src/openssl_stream.c.o   -c /home/guo/Github/libgit2/src/openssl_stream.c
/home/guo/Github/libgit2/src/openssl_stream.c: In function ‘bio_create’:
/home/guo/Github/libgit2/src/openssl_stream.c:159:3: error: dereferencing pointer to incomplete type
  b->init = 1;
...
看起来朱莉娅的配置有误

根据您的评论,“我已经安装了libssl dev,还手动从源代码构建了另一个版本的openssl…”,您应该在某处看到一个
-I
选项,其中包含类似
-I/usr/local/ssl/include
的内容。如果OpenSSL安装在
/usr/local/ssl
,则标头位置为
/usr/local/ssl/include
,库位置为
/usr/local/ssl/lib

您可能应该在
CFLAGS
中包含
-Wl、-rpath、/usr/local/ssl/lib
,以确保运行时链接选择正确的OpenSSL库。或者,您可能必须使用
LD\u LIBRARY\u PATH
(但使用RPATH通常更容易)

Julia对OpenSSL的配置没有什么可说的(除了它所需要的):

如果Julia是一个表现良好的项目,并且它尊重
CFLAGS
,那么这就是您应该做的所有事情:

$ export CFLAGS="-I/usr/local/ssl/include -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/ssl/lib"
$ CFLAGS="$CFLAGS" make -C deps getall
$ CFLAGS="$CFLAGS" make VERBOSE=1

如果有任何C++组件,那么你会想使用:

$ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" make -C deps getall
$ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" make VERBOSE=1
在大多数情况下,它看起来像是在向你的
CFLAGS
致敬:

$ CFLAGS="$CFLAGS" make VERBOSE=1
make[1]: Entering directory '/Users/jwalton/julia/deps'
...
echo make -C build/openblas-12ab1804b6ebcd38b26960d65d254314d8bc33d6/ CC="clang  -mmacosx-version-min=10.6 -m64" FC="gfortran -m64" RANLIB="ranlib" FFLAGS=" -O2 -fPIC" TARGET= BINARY=64 USE_THREAD=1 GEMM_MULTITHREADING_THRESHOLD=50 NUM_THREADS=16 NO_AFFINITY=1 DYNAMIC_ARCH=1 INTERFACE64=1 SYMBOLSUFFIX="64_" LIBPREFIX="libopenblas64_" OBJCONV=/Users/jwalton/julia/deps/build/objconv/objconv MAKE_NB_JOBS=0 # echo first, so we only print the error message below in a failure case
make -C build/openblas-12ab1804b6ebcd38b26960d65d254314d8bc33d6/ CC=clang  -mmacosx-version-min=10.6 -m64 FC=gfortran -m64 RANLIB=ranlib FFLAGS= -O2 -fPIC TARGET= BINARY=64 USE_THREAD=1 GEMM_MULTITHREADING_THRESHOLD=50 NUM_THREADS=16 NO_AFFINITY=1 DYNAMIC_ARCH=1 INTERFACE64=1 SYMBOLSUFFIX=64_ LIBPREFIX=libopenblas64_ OBJCONV=/Users/jwalton/julia/deps/build/objconv/objconv MAKE_NB_JOBS=0
make[2]: Entering directory '/Users/jwalton/julia/deps/build/openblas-12ab1804b6ebcd38b26960d65d254314d8bc33d6'
make[3]: Entering directory '/Users/jwalton/julia/deps/build/openblas-12ab1804b6ebcd38b26960d65d254314d8bc33d6/interface'
clang  -mmacosx-version-min=10.6 -m64 -I/usr/local/ssl/include -L/usr/local/ssl/lib -Wl,-rpath,/usr/local/ssl/lib -O2 -DMAX_STACK_ALLOC=2048 -DEXPRECISION -Wall -m64 -DF_INTERFACE_GFORT  -fPIC -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=16 -DASMNAME=_ -DASMFNAME=__ -DNAME=_ -DCNAME= -DCHAR_NAME=\"_\" -DCHAR_CNAME=\"\" -DNO_AFFINITY -I. -O2 -DMAX_STACK_ALLOC=2048 -DEXPRECISION -Wall -m64 -DF_INTERFACE_GFORT  -fPIC -DDYNAMIC_ARCH -DSMP_SERVER -DNO_WARMUP -DMAX_CPU_NUMBER=16 -DASMNAME=_saxpy -DASMFNAME=_saxpy_ -DNAME=saxpy_ -DCNAME=saxpy -DCHAR_NAME=\"saxpy_\" -DCHAR_CNAME=\"saxpy\" -DNO_AFFINITY -I.. -I. -UDOUBLE  -UCOMPLEX -c axpy.c -o saxpy.o
clang: warning: -Wl,-rpath,/usr/local/ssl/lib: 'linker' input unused
clang: warning: argument unused during compilation: '-L/usr/local/ssl/lib'
In file included from <built-in>:320:
<command line>:22:9: warning: 'ASMNAME' macro redefined [-Wmacro-redefined]
#define ASMNAME _saxpy
        ^
$CFLAGS=“$CFLAGS”使详细=1
make[1]:输入目录“/Users/jwalton/julia/deps”
...
echo make-C build/openblas-12ab1804b6ebcd38b26960d65d2554314d8bc33d6/CC=“clang-mmacosx version min=10.6-m64”FC=“gfortran-m64”RANLIB=“RANLIB”FFLAGS=“-O2-fPIC”TARGET=BINARY=64 USE\u THREAD=1 GEMM\u多线程\u THRESHOLD=50个线程=16个无亲缘关系=1个动态\u ARCH=1个接口64=1个symuffix=“64”LIBPREFIX=“64”OBJCONV=/Users/jwalton/julia/deps/build/OBJCONV/OBJCONV MAKE_NB#u JOBS=0#echo first,因此我们只在出现故障时打印下面的错误消息
make-C build/openblas-12ab1804b6ebcd38b26960d65d25d254314d8bc33d6/CC=clang-mmacosx version min=10.6-m64 FC=gfortran-m64 RANLIB=RANLIB FFLAGS=-O2-fPIC TARGET=BINARY=64使用线程=1 GEMM\u多线程\u阈值=50个线程=16个无关联=1个动态\u ARCH=1个接口64=1个SYMBOLSUFFIX=64OBJCONV=/Users/jwalton/julia/deps/build/OBJCONV/OBJCONV MAKE_NB_JOBS=0
make[2]:输入目录“/Users/jwalton/julia/deps/build/openblas-12ab1804b6ebcd38b26960d65d25d254314d8bc33d6”
make[3]:输入目录“/Users/jwalton/julia/deps/build/openblas-12ab1804b6ebcd38b26960d65d25d254314d8bc33d6/interface”
clang-mmacosx版本min=10.6-m64-I/usr/local/ssl/include-L/usr/local/ssl/lib-Wl-rpath,/usr/local/ssl/lib-O2-DMAX\u STACK\u ALLOC=2048-DEXPRECISION-Wall-m64-DF\u接口\u GFORT-fPIC-dddynamic\u ARCH-DSMP\u服务器-DNO-WARMUP-DMAX\u CPU号=16-DASMNAME=-DASMFNAME=-dnuchar\u-dcu=-NAME=-dcu=-dcu-DNO\u AFFINITY-I.-O2-DMAX\u STACK\u ALLOC=2048-DEXPRECISION-Wall-m64-DF\u INTERFACE\u GFORT-fPIC-DDYNAMIC\u ARCH-DSMP\u SERVER-DNO\u WARMUP-DMAX\u CPU\u NUMBER=16-DASMNAME=\u saxpy-DASMFNAME=\u saxpy-DNAME=saxpy-DCNAME=saxpy-DCHAR\u NAME=\\DCHAR-DCHAR\u NAME=\“saxpy”-DCHAR\n\n-I.-UDOUBLE-UCOMPLEX-c axpy.c-o saxpy.o
叮当声:警告:-Wl,-rpath,/usr/local/ssl/lib:“链接器”输入未使用
叮当声:警告:编译期间未使用参数:'-L/usr/local/ssl/lib'
在文件中包括:320:
:22:9:警告:“ASMNAME”宏已重新定义[-Wmacro已重新定义]
#定义ASMNAME\u saxpy
^

我不知道Julia的其他问题,比如重新定义的
'ASMNAME'宏
。我在猜测(这纯粹是猜测),这是因为我在OS X上测试它,但它没有真正的支持(
RANLIB=“RANLIB”
是一个赠品,有些东西是错误的,因为OS X使用的是苹果的
libtool
,而不是
RANLIB
)。

谢谢你的回答。我已经安装了
libssl-dev
,还从源代码手动构建了另一个版本
openssl
。可能是
libssl
导致了错误。但是我找不到它。我的v2.10 git无法使用https,这应该是相同的原因<代码>https://github.com/JuliaLang/julia.git 克隆成“朱莉娅”。。。致命错误:找不到“https”的远程帮助程序@Lating-“找不到“https”的远程帮助程序…”-尽管这是Git错误,但通常意味着构建curl时没有SSL/TLS支持。从源代码构建Git非常糟糕。它默默地接受错误并继续,就像因为HTTPS支持和配置失败而忘记停止一样。运行
make-V
make V=1
,这样我们就可以看到编译器调用。@Lating-My bad;其
VERBOSE=1
;不是
V=1
(我认为
V=1
代表
kbuild
)。还可以看到(并且看到默认情况下隐藏信息是多么愚蠢的想法…)从源代码构建Git很糟糕。。。如果您认为Git命令是不好的,因为它喜欢处理每一个简单的工作流并使其变得困难,那么就准备好Git配置并从源代码构建。Git将在配置和构建阶段失败,但继续前进,就好像什么都没发生一样。另见。谢谢,@jww。我重新安装了ubuntu,并通过apt get安装了依赖项。现在一切都好了。还有其他的麻烦是由一个不稳定的NVIDIA司机引起的。