Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package is not precompile-safe #128

Closed
tkelman opened this issue May 22, 2017 · 2 comments
Closed

Package is not precompile-safe #128

tkelman opened this issue May 22, 2017 · 2 comments

Comments

@tkelman
Copy link
Contributor

tkelman commented May 22, 2017

As discussed here - ed07680

Due to the conditional dependency on JLD there, if JLD either becomes available after the Knet is precompiled or is removed after Knet has been precompiled, then you get either missing functionality or a failure to load the package. Most prominent on Julia 0.4, but the lack of cache tracking of conditional dependencies is an issue on all Julia versions. If you have to resort to manually managing the cache, then you aren't satisfying the preconditions to mark the package as __precompile__(true).

~/Julia$ export JULIA_PKGDIR=$HOME/Julia/jlpkgtmp
~/Julia$ rm -rf $JULIA_PKGDIR
~/Julia$ julia-0.4/julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.8-pre+3 (2016-11-04 23:38 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 63b33a2 (198 days old release-0.4)
|__/                   |  x86_64-linux-gnu

julia> Pkg.init(); Pkg.add("JLD"); Pkg.add("Knet"); run(`$JULIA_HOME/julia -e 'using Knet'`); Pkg.rm("JLD"); using Knet
INFO: Initializing package repository /home/tkelman2/Julia/jlpkgtmp/v0.4
INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git
INFO: Cloning cache of Blosc from git://github.com/stevengj/Blosc.jl.git
INFO: Cloning cache of Compat from git://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of FileIO from git://github.com/JuliaIO/FileIO.jl.git
INFO: Cloning cache of HDF5 from git://github.com/JuliaIO/HDF5.jl.git
INFO: Cloning cache of JLD from git://github.com/JuliaIO/JLD.jl.git
INFO: Cloning cache of LegacyStrings from https://github.com/JuliaArchive/LegacyStrings.jl.git
INFO: Cloning cache of SHA from git://github.com/staticfloat/SHA.jl.git
INFO: Cloning cache of URIParser from git://github.com/JuliaWeb/URIParser.jl.git
INFO: Installing BinDeps v0.4.7
INFO: Installing Blosc v0.2.1
INFO: Installing Compat v0.25.2
INFO: Installing FileIO v0.2.2
INFO: Installing HDF5 v0.7.3
INFO: Installing JLD v0.6.10
INFO: Installing LegacyStrings v0.2.1
INFO: Installing SHA v0.3.2
INFO: Installing URIParser v0.1.8
INFO: Building Blosc
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   122    0   122    0     0    754      0 --:--:-- --:--:-- --:--:--   757
100  607k  100  607k    0     0  1407k      0 --:--:-- --:--:-- --:--:-- 1407k
Compiling libblosc...
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o bitshuffle-generic.o bitshuffle-generic.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o shuffle-generic.o shuffle-generic.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o shuffle.o shuffle.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o blosclz.o blosclz.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o blosc.o blosc.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o ../internal-complibs/lz4-1.7.2/lz4.o ../internal-complibs/lz4-1.7.2/lz4.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -c -o ../internal-complibs/lz4-1.7.2/lz4hc.o ../internal-complibs/lz4-1.7.2/lz4hc.c
echo "building with AVX2"
building with AVX2
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -mavx2 -c -o bitshuffle-avx2.o bitshuffle-avx2.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -mavx2 -c -o shuffle-avx2.o shuffle-avx2.c
echo "building without AVX2"
building without AVX2
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -msse2 -c -o bitshuffle-sse2.o bitshuffle-sse2.c
gcc -I. -DBLOSC_SHARED_LIBRARY -DSHUFFLE_AVX2_ENABLED -DSHUFFLE_SSE2_ENABLED -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -msse2 -c -o shuffle-sse2.o shuffle-sse2.c
gcc -fPIC -O3 -pthread -std=gnu99 -DHAVE_LZ4 -I../internal-complibs/lz4-1.7.2 -shared bitshuffle-generic.o shuffle-generic.o shuffle.o blosclz.o blosc.o ../internal-complibs/lz4-1.7.2/lz4.o ../internal-complibs/lz4-1.7.2/lz4hc.o bitshuffle-avx2.o shuffle-avx2.o bitshuffle-sse2.o shuffle-sse2.o -o ../../libblosc.so
INFO: Building HDF5
INFO: Package database updated
INFO: Cloning cache of AutoGrad from git://github.com/denizyuret/AutoGrad.jl.git
INFO: Cloning cache of Knet from git://github.com/denizyuret/Knet.jl.git
INFO: Installing AutoGrad v0.0.7
INFO: Installing Knet v0.8.3
INFO: Building Knet
WARNING: Cannot find nvcc, GPU support will not be available.
g++ -c -O3 -Wall -fPIC -fopenmp conv.cpp -o conv.o
g++ --shared -O3 -Wall -fPIC -fopenmp conv.o -o libknet8.so
< ... unrelated ambiguity warnings ... >
INFO: Removing BinDeps v0.4.7
INFO: Removing Blosc v0.2.1
INFO: Removing FileIO v0.2.2
INFO: Removing HDF5 v0.7.3
INFO: Removing JLD v0.6.10
INFO: Removing LegacyStrings v0.2.1
INFO: Removing SHA v0.3.2
INFO: Removing URIParser v0.1.8
INFO: Package database updated
ERROR: ArgumentError: module Blosc not found in current path.
Run `Pkg.add("Blosc")` to install the Blosc package.
 in require at ./loading.jl:246
 in stale_cachefile at loading.jl:477
 in _require_search_from_serialized at loading.jl:114
 in require at ./loading.jl:249
@denizyuret
Copy link
Owner

#172 may fix this but it breaks Julia4. Asked @MikeInnes for help.

@denizyuret
Copy link
Owner

Using JLD2 unconditionally in latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants