Skip to content

Instantly share code, notes, and snippets.

@robertfeldt
Created November 25, 2014 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robertfeldt/a5433400bc0bdea3996c to your computer and use it in GitHub Desktop.
Save robertfeldt/a5433400bc0bdea3996c to your computer and use it in GitHub Desktop.
Updated Blosc.jl build file to build lib with internal compressors
using BinDeps
vers = "1.5.0"
# Set to true to build locally with internal compressors:
build_locally_w_internal_compressors = true
#build_locally_w_internal_compressors = false
tagfile = "installed_vers"
target = "libblosc.$(Sys.dlext)"
if !isfile(tagfile) || readchomp(tagfile) != vers
if !build_locally_w_internal_compressors && OS_NAME == :Windows
run(download_cmd("http://ab-initio.mit.edu/blosc/libblosc$WORD_SIZE-$vers.dll", target))
elseif !build_locally_w_internal_compressors && OS_NAME == :Darwin
run(download_cmd("http://ab-initio.mit.edu/blosc/libblosc$WORD_SIZE-$vers.dylib", target))
else
tarball = "c-blosc-$vers.tar.gz"
maindir = "c-blosc-$vers"
srcdir = "c-blosc-$vers/blosc"
if !isfile(tarball)
run(download_cmd("https://github.com/Blosc/c-blosc/archive/v$vers.tar.gz", tarball))
end
run(unpack_cmd(tarball, ".", ".gz", ".tar"))
if !build_locally_w_internal_compressors
cd(srcdir) do
println("Compiling libblosc...")
for f in ("blosc.c", "blosclz.c", "shuffle.c")
println(" CC $f")
run(`gcc -fPIC -O3 -msse2 -I. -c $f`)
end
println(" LINK libblosc")
run(`gcc -shared -o ../../$target blosc.o blosclz.o shuffle.o`)
end
else
cd(maindir) do
println("Compiling libblosc with internal compressor libs...")
run(`mkdir build`)
cd("build") do
run(`cmake -DPREFER_EXTERNAL_COMPLIBS=OFF ..`)
run(`make`)
run(`cp blosc/$target ../..`)
run(`make clean`)
end
end
run(`rm -rf $maindir $tarball`)
println("Compiled libblosc with internal compressor libs...")
end
end
run(`echo $vers` |> tagfile)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment