maleadt / LLVM.jl

Julia wrapper for the LLVM C API
Other
129 stars 40 forks source link

llvm-extra depends on zlib-dev #7

Closed eso69255 closed 7 years ago

eso69255 commented 7 years ago

Hello, i'm trying to install https://github.com/JuliaGPU/CUDAnative.jl and need this package, but i get the error below. To LLVM i used http://apt.llvm.org/ ( apt-get install clang-3.9 clang-3.9-doc libclang-common-3.9-dev libclang-3.9-dev libclang1-3.9 libclang1-3.9-dbg libllvm-3.9-ocaml-dev libllvm3.9 libllvm3.9-dbg lldb-3.9 llvm-3.9 llvm-3.9-dev llvm-3.9-doc llvm-3.9-examples llvm-3.9-runtime clang-format-3.9 python-clang-3.9 lldb-3.9-dev liblldb-3.9-dbg ).

Ubuntu 16.04.1 Julia Nightly

julia> Pkg.build("LLVM")
INFO: Building LLVM
DEBUG: Acceptable LLVM versions: 3.7.1, 3.8.0, 3.8.1, 3.9.0, 4.0.0, 3.9.0
DEBUG: Searching for config binaries in /usr/bin
DEBUG: - found llvm-config at /usr/bin/llvm-config-3.9
DEBUG: Searching for libraries using /usr/bin/llvm-config-3.9
DEBUG: ... contains libraries in /usr/lib/llvm-3.9/lib
DEBUG: - found v3.9.0 at /usr/lib/llvm-3.9/lib/libLLVM-3.9.so
DEBUG: - found v3.9.0 at /usr/lib/llvm-3.9/lib/libLLVM.so
DEBUG: Searching for config binaries in /usr/local/sbin
DEBUG: Searching for config binaries in /usr/local/bin
DEBUG: Searching for config binaries in /usr/sbin
DEBUG: Searching for config binaries in /sbin
DEBUG: Searching for config binaries in /bin
INFO: Found 2 LLVM installations, providing 1 different versions
INFO: Overriding selection to match v3.9.0
rm -f libLLVM_extra.so ./Transforms/IPO.o ./Target.o ./Target/NVPTX.o
g++ -I/usr/lib/llvm-3.9/include -std=c++0x -gsplit-dwarf -Wl,-fuse-ld=gold -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -I/usr/lib/llvm-3.9/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_AARCH64 -DTARGET_AMDGPU -DTARGET_ARM -DTARGET_BPF -DTARGET_HEXAGON -DTARGET_MIPS -DTARGET_MSP430 -DTARGET_NVPTX -DTARGET_POWERPC -DTARGET_SPARC -DTARGET_SYSTEMZ -DTARGET_X86 -DTARGET_XCORE -D_GLIBCXX_USE_CXX11_ABI=1  -c -o Transforms/IPO.o Transforms/IPO.cpp
g++ -I/usr/lib/llvm-3.9/include -std=c++0x -gsplit-dwarf -Wl,-fuse-ld=gold -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -I/usr/lib/llvm-3.9/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_AARCH64 -DTARGET_AMDGPU -DTARGET_ARM -DTARGET_BPF -DTARGET_HEXAGON -DTARGET_MIPS -DTARGET_MSP430 -DTARGET_NVPTX -DTARGET_POWERPC -DTARGET_SPARC -DTARGET_SYSTEMZ -DTARGET_X86 -DTARGET_XCORE -D_GLIBCXX_USE_CXX11_ABI=1  -c -o Target.o Target.cpp
g++ -I/usr/lib/llvm-3.9/include -std=c++0x -gsplit-dwarf -Wl,-fuse-ld=gold -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -I/usr/lib/llvm-3.9/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_AARCH64 -DTARGET_AMDGPU -DTARGET_ARM -DTARGET_BPF -DTARGET_HEXAGON -DTARGET_MIPS -DTARGET_MSP430 -DTARGET_NVPTX -DTARGET_POWERPC -DTARGET_SPARC -DTARGET_SYSTEMZ -DTARGET_X86 -DTARGET_XCORE -D_GLIBCXX_USE_CXX11_ABI=1  -c -o Target/NVPTX.o Target/NVPTX.cpp
g++ -I/usr/lib/llvm-3.9/include -std=c++0x -gsplit-dwarf -Wl,-fuse-ld=gold -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O2 -g -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fPIC -I/usr/lib/llvm-3.9/include   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DTARGET_AARCH64 -DTARGET_AMDGPU -DTARGET_ARM -DTARGET_BPF -DTARGET_HEXAGON -DTARGET_MIPS -DTARGET_MSP430 -DTARGET_NVPTX -DTARGET_POWERPC -DTARGET_SPARC -DTARGET_SYSTEMZ -DTARGET_X86 -DTARGET_XCORE -D_GLIBCXX_USE_CXX11_ABI=1 -L/usr/lib/llvm-3.9/lib  -Wl,-z,defs "-Wl,-rpath,/usr/lib/llvm-3.9/lib"  -shared Transforms/IPO.o Target.o Target/NVPTX.o -L/usr/lib/llvm-3.9/lib  -Wl,-z,defs "-Wl,-rpath,/usr/lib/llvm-3.9/lib" -lLLVM -lrt -ldl -ltinfo -lpthread -lz -lm -o libLLVM_extra.so
/usr/bin/ld.gold: error: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target 'libLLVM_extra.so' failed
make: *** [libLLVM_extra.so] Error 1
==============================================================================[ ERROR: LLVM ]==============================================================================

LoadError: failed process: Process(`make -j9`, ProcessExited(2)) [2]
while loading /home/xxx/.julia/v0.6/LLVM/deps/build.jl, in expression starting on line 163

===========================================================================================================================================================================

=============================================================================[ BUILD ERRORS ]==============================================================================

WARNING: LLVM had build errors.

 - packages with build errors remain installed in /home/xxx/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("LLVM")`
 - build a single package by running its `deps/build.jl` script

===========================================================================================================================================================================
maleadt commented 7 years ago

You need to install zlib1g-dev, which provides libz. I'll add it to the documentation.

That said, in order to test CUDAnative I'd advise you to rebuild Julia (which you need to anyway, as for now you still need to build from the tb/ext_langimpl branch) with LLVM_VER=3.9.0. This is also the default in the aforementioned branch. LLVM.jl should then pick-up the version built as part of Julia.

I'm working on making everything easier to install, and there should be a blogpost some time soon documenting everything.

eso69255 commented 7 years ago

Thank you, i will wait for the blog post.