我在新安装的操作系统Ubuntu 14.04.1上从源代码构建Julia
。
git clone https://github.com/JuliaLang/julia.git
make -C deps getall
make -j 12
构建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;
make VERBOSE=1
之后,错误消息为:
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
答案 0 :(得分:2)
您需要根据Julia libssl-dev
:
README.md
openssl - 在Linux上的libgit2中支持HTTPS,需要通过 apt-get install libssl-dev 或yum install openssl-devel进行安装。
因此,为了在Ubuntu中安装它,请在终端中发出以下命令:
sudo apt-get install libssl-dev
之后,您可能会再次尝试重新编译Julia。
答案 1 :(得分:1)
<MyButton@Button>:
markup: True
font_size: '20dp'
size_hint_y: None
看起来Julia配置错误。
根据您的评论“我已经安装了libssl-dev并且还从源手动构建了另一个版本openssl ....”,您应该在某处看到/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;
...
选项像-I
这样的东西。如果在-I /usr/local/ssl/include
安装了OpenSSL,则标头位置为/usr/local/ssl
,库位置为/usr/local/ssl/include
。
您应该在/usr/local/ssl/lib
中包含-Wl,-rpath,/usr/local/ssl/lib
,以确保运行时链接能够获取正确的OpenSSL库。或者,您可能必须使用CFLAGS
(但通常更容易使用RPATH)。
Julia对配置OpenSSL(除了需要的配置)没什么好说的:
LD_LIBRARY_PATH
如果朱莉娅是一个表现良好的项目并且它尊敬$ cat README.md | grep -B 1 -A 1 -i ssl
- **[cmake]** — needed to build `libgit2`.
- **[openssl]** — needed for HTTPS support in `libgit2` on Linux, install via `apt-get install libssl-dev` or `yum install openssl-devel`.
- **[pkg-config]** - needed to build libgit2 correctly, especially for proxy support
--
[libunwind]: http://www.nongnu.org/libunwind
[openssl]: https://www.openssl.org
[libssh2]: https://www.libssh2.org
,那么这就是你应该做的全部:
CFLAGS
如果有任何C ++组件,那么您将需要使用:
$ 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
在大多数情况下,它看起来很尊重您的$ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" make -C deps getall
$ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" make VERBOSE=1
:
CFLAGS
我不知道其他Julia问题,例如$ 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
^
。我猜测(这纯粹是猜测),因为我在OS X上测试它,但是它没有真正支持它('ASMNAME' macro redefined
是一个赠品,因为OS X使用Apple的{{1} },而不是RANLIB="ranlib"
)。