GithubHelp home page GithubHelp logo

xtensor-stack / xtensor.jl Goto Github PK

View Code? Open in Web Editor NEW
40.0 4.0 6.0 186 KB

Julia package for xtensor-julia

Home Page: http://quantstack.net/xtensor

License: BSD 3-Clause "New" or "Revised" License

Julia 100.00%
julia-bindings numpy-arrays tensor c-plus-plus

xtensor.jl's People

Contributors

johanmabille avatar sylvaincorlay avatar tkelman avatar wolfv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

xtensor.jl's Issues

logsumexp test segfaults

Trying conversion of logsumexp test from python to julia
I did try changing the pass by const&'s to pass by value

https://gist.github.com/nbecker/af2011043a29e1635adfaad73c0e4e9e

signal (11): Segmentation fault
while loading /home/nbecker/xtensor-julia-test/test_logsumexp.jl, in expression starting on line 21
_ZN2xt6detail14excluding_copyIPKmS3_N9__gnu_cxx17__normal_iteratorIPmSt6vectorImSaImEEEEEEvT_SB_T0_SC_T1_SD_ at ./liblogsumexp.so (unknown line)
_ZN2xt8xreducerINS_6detail7maximumIdEERKNS_7jlarrayIdEERKNS_8jltensorImLm1EEEEC2IS3_RS5_RS9_EEOT_OT0_OT1_ at ./liblogsumexp.so (unknown line)
_ZN2xt6reduceINS_6detail7maximumIdEERNS_7jlarrayIdEERNS_8jltensorImLm1EEEEEDaOT_OT0_OT1_ at ./liblogsumexp.so (unknown line)
_ZN2xt4amaxIRNS_7jlarrayIdEERNS_8jltensorImLm1EEEEEDaOT_OT0_ at ./liblogsumexp.so (unknown line)
_Z10logsumexp2IN2xt7jlarrayIdEENS0_8jltensorImLm1EEEEDaT_T0_ at ./liblogsumexp.so (unknown line)
unknown function (ip: 0x7fefeadd9b2f)
unknown function (ip: 0x7fefeadda303)
_ZNKSt8functionIFN2xt7jlarrayIdEES2_NS0_8jltensorImLm1EEEEEclES2_S4_ at ./liblogsumexp.so (unknown line)
_ZN5jlcxx6detail17ReturnTypeAdapterIN2xt7jlarrayIdEEJS4_NS2_8jltensorImLm1EEEEEclEPKvP10jl_array_tSB_ at ./liblogsumexp.so (unknown line)
_ZN5jlcxx6detail11CallFunctorIN2xt7jlarrayIdEEJS4_NS2_8jltensorImLm1EEEEE5applyEPKvP10jl_array_tSB_ at ./liblogsumexp.so (unknown line)
logsumexp at ./<missing>:0
unknown function (ip: 0x7fefedb3fb06)
jl_apply_generic at /usr/bin/../lib64/libjulia.so.0.6 (unknown line)
...

jltensor / jlarray

Just like we have xtensor / xarray in core, pytensor / pyarray in the python bindings, we need a dynamic-dimensional array binding in xtensor-julia.

p_array

I tried to clone, then build this package.

I get the following error on Pkg.build("Xtensor")

In file included from /Users/sglyon/.julia/v0.6/Xtensor/deps/xtensor-julia-examples/tensors.cpp:3:
/Users/sglyon/.julia/v0.6/Xtensor/deps/usr/include/xtensor-julia/jltensor.hpp:277:27: error: no member named 'p_array'
      in 'xt::jltensor<double, 2>'
        std::copy(&(this->p_array->nrows), &(this->p_array->nrows) + N, m_shape.begin());
                    ~~~~  ^
/Users/sglyon/.julia/v0.6/Xtensor/deps/usr/include/xtensor-julia/jltensor.hpp:279:65: error: no member named 'p_array'
      in 'xt::jltensor<double, 2>'
        m_data = container_type(reinterpret_cast<pointer>(this->p_array->data),

Not sure why this is happening as p_array does seem to be a member of the parent class jlcontainer.

Build failure: ‘jl_current_module’ was not declared in this scope; did you mean ‘jl_core_module’?

┌ Error: Error building `Xtensor`, showing the last 100 of log:-- Detecting C compile features - done
│ -- Check for working CXX compiler: /usr/bin/g++-- Check for working CXX compiler: /usr/bin/g++ -- works
│ -- Detecting CXX compiler ABI info
│ -- Detecting CXX compiler ABI info - done
│ -- Detecting CXX compile features
│ -- Detecting CXX compile features - done
│ -- xtensor-julia v0.8.2-- Found xtl: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtl
│ -- Found xtensor: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor
│ -- Found Julia executable: /home/chriselrod/Documents/languages/julia/usr/bin/julia
│ -- Julia_VERSION_STRING: 1.3.0-- Julia_INCLUDE_DIRS:   /home/chriselrod/Documents/languages/julia/usr/include/julia
│ -- Julia_LIBRARY_DIR:    /home/chriselrod/Documents/languages/julia/usr/lib
│ -- Julia_LIBRARY:        /home/chriselrod/Documents/languages/julia/usr/lib/libjulia.so
│ -- JULIA_HOME:           /home/chriselrod/Documents/languages/julia/usr/bin
│ -- Julia_LLVM_VERSION:   v8.0.0-- Julia_WORD_SIZE:      64-- Found Julia: /home/chriselrod/Documents/languages/julia/usr/lib/libjulia.so (found version "1.3.0") 
│ -- Found JlCxx:-- Configuring done
│ -- Generating done
│ -- Build files have been written to: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/builds/xtensor-julia
│ Install the project...-- Install configuration: ""-- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/jlarray.hpp
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/jlcontainer.hpp
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/jltensor.hpp
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/jlvectorize.hpp
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/xtensor_julia_config.hpp
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/lib/cmake/xtensor-julia/xtensor-juliaConfig.cmake
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/lib/cmake/xtensor-julia/xtensor-juliaConfigVersion.cmake
│ -- Installing: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/lib/cmake/xtensor-julia/xtensor-juliaTargets.cmake
│ -- The C compiler identification is GNU 9.1.1-- The CXX compiler identification is GNU 9.1.1-- Check for working C compiler: /usr/bin/gcc
│ -- Check for working C compiler: /usr/bin/gcc -- works
│ -- Detecting C compiler ABI info
│ -- Detecting C compiler ABI info - done
│ -- Detecting C compile features
│ -- Detecting C compile features - done
│ -- Check for working CXX compiler: /usr/bin/g++-- Check for working CXX compiler: /usr/bin/g++ -- works
│ -- Detecting CXX compiler ABI info
│ -- Detecting CXX compiler ABI info - done
│ -- Detecting CXX compile features
│ -- Detecting CXX compile features - done
│ -- Performing Test HAS_CPP14_FLAG
│ -- Performing Test HAS_CPP14_FLAG - Success
│ -- Found Julia executable: /home/chriselrod/Documents/languages/julia/usr/bin/julia
│ -- Julia_VERSION_STRING: 1.3.0-- Julia_INCLUDE_DIRS:   /home/chriselrod/Documents/languages/julia/usr/include/julia
│ -- Julia_LIBRARY_DIR:    /home/chriselrod/Documents/languages/julia/usr/lib
│ -- Julia_LIBRARY:        /home/chriselrod/Documents/languages/julia/usr/lib/libjulia.so
│ -- JULIA_HOME:           /home/chriselrod/Documents/languages/julia/usr/bin
│ -- Julia_LLVM_VERSION:   v8.0.0-- Julia_WORD_SIZE:      64-- Found Julia: /home/chriselrod/Documents/languages/julia/usr/lib/libjulia.so (found version "1.3.0") 
│ -- Configuring done
│ -- Generating done
│ -- Build files have been written to: /home/chriselrod/.julia/packages/Xtensor/7Cfvz/builds/xtensor-julia-examples
│ Scanning dependencies of target tensors
│ [ 50%] Building CXX object CMakeFiles/tensors.dir/tensors.cpp.o
│ In file included from /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/xtensor-julia-examples/tensors.cpp:16:/home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/jlarray.hpp: In static member function ‘static jl_datatype_t* jlcxx::static_type_mapping<xt::jlarray<T> >::julia_type()’:
│ /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/usr/include/xtensor-julia/jlarray.hpp:459:31: error: ‘jl_current_module’ was not declared in this scope; did you mean ‘jl_core_module’?
│   459 |                 jl_get_global(jl_current_module, jl_symbol("Array")),
│       |                               ^~~~~~~~~~~~~~~~~|                               jl_core_module
│ gmake[2]: *** [CMakeFiles/tensors.dir/build.make:63: CMakeFiles/tensors.dir/tensors.cpp.o] Error 1
│ gmake[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/tensors.dir/all] Error 2
│ gmake: *** [Makefile:130: all] Error 2
│ [ Info: Attempting to create directory /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtl
│ [ Info: Changing directory to /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtl
│ [ Info: Attempting to create directory /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtensor
│ [ Info: Changing directory to /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtensor
│ [ Info: Attempting to create directory /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtensor-julia
│ [ Info: Changing directory to /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtensor-julia
│ [ Info: Attempting to create directory /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtensor-julia-examples
│ [ Info: Changing directory to /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/../builds/xtensor-julia-examples
│ ERROR: Error while loading expression starting at /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/build.jl:112
│ caused by [exception 1]
│ failed process: Process(`cmake --build . --config Release --target install`, ProcessExited(2)) [2]
│ 
│ Stacktrace:
│  [1] pipeline_error at ./process.jl:819 [inlined]
│  [2] #run#541(::Bool, ::typeof(run), ::Cmd) at ./process.jl:734
│  [3] run(::Cmd) at ./process.jl:732
│  [4] run(::BinDeps.SynchronousStepCollection) at /home/chriselrod/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:521 (repeats 3 times)
│  [5] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /home/chriselrod/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
│  [6] satisfy!(::BinDeps.LibraryDependency) at /home/chriselrod/.julia/packages/BinDeps/ZEval/src/dependencies.jl:922
│  [7] top-level scope at /home/chriselrod/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
│  [8] include at ./boot.jl:328 [inlined]
│  [9] include_relative(::Module, ::String) at ./loading.jl:1094
│  [10] include(::Module, ::String) at ./Base.jl:31
│  [11] include(::String) at ./client.jl:431
│  [12] top-level scope at none:5
│ Building xtl
│ Building xtensor
│ Building xtensor-julia
│ Building xtensor-julia-examples
│ 
│ Full log at /home/chriselrod/.julia/packages/Xtensor/7Cfvz/deps/build.log
└ @ Pkg.Operations ~/Documents/languages/julia/usr/share/julia/stdlib/v1.3/Pkg/src/backwards_compatible_isolation.jl:626

C++ repo split

I am thinking of separating the content of deps/xtensor-julia into its own repository, which would be named xtensor-julia, that would have the same usual directory structure as other C++ packages.

Then Xtensor.jl would only comprise the examples, and build.jl would get the xtensor-julia headers in the same way it gets the xtensor headers.

Documentation

Is it possible to add some examples and documentation?

Clean created directories when building

When I try to do Pkg.build("Xtensor") I get the following error:

INFO: Attempting to Create directory /Users/sglyon/.julia/v0.6/Xtensor/builds/xtensor
INFO: Directory /Users/sglyon/.julia/v0.6/Xtensor/builds/xtensor already created
INFO: Changing Directory to /Users/sglyon/.julia/v0.6/Xtensor/builds/xtensor
fatal: destination path '/Users/sglyon/.julia/v0.6/Xtensor/deos/xtensor' already exists and is not an empty directory.
=============================================================================================================[ ERROR: Xtensor ]==============================================================================================================

LoadError: failed process: Process(`git clone -b 0.9.0 --single-branch https://github.com/QuantStack/xtensor /Users/sglyon/.julia/v0.6/Xtensor/deos/xtensor`, ProcessExited(128)) [128]
while loading /Users/sglyon/.julia/v0.6/Xtensor/deps/build.jl, in expression starting on line 84

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

I think this indicates that we should just delete that directory (if it exists) before starting to build

Release roadmap

Missing for a 0.1.0 release

  • Wait for CxxWrap 0.4 with new directory structure
  • Migrate from jlbuffer_adaptor to xbuffer_adaptor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.