{"action":"closed","issue":{"url":"https://api.github.com/repos/tensor-compiler/taco/issues/104","repository_url":"https://api.github.com/repos/tensor-compiler/taco","labels_url":"https://api.github.com/repos/tensor-compiler/taco/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/tensor-compiler/taco/issues/104/comments","events_url":"https://api.github.com/repos/tensor-compiler/taco/issues/104/events","html_url":"https://github.com/tensor-compiler/taco/issues/104","id":244431504,"node_id":"MDU6SXNzdWUyNDQ0MzE1MDQ=","number":104,"title":"Adding an Access to itself using Julia makes taco redefine variables in generated code","user":{"login":"peterahrens","id":5770255,"node_id":"MDQ6VXNlcjU3NzAyNTU=","avatar_url":"https://avatars3.githubusercontent.com/u/5770255?v=4","gravatar_id":"","url":"https://api.github.com/users/peterahrens","html_url":"https://github.com/peterahrens","followers_url":"https://api.github.com/users/peterahrens/followers","following_url":"https://api.github.com/users/peterahrens/following{/other_user}","gists_url":"https://api.github.com/users/peterahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/peterahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/peterahrens/subscriptions","organizations_url":"https://api.github.com/users/peterahrens/orgs","repos_url":"https://api.github.com/users/peterahrens/repos","events_url":"https://api.github.com/users/peterahrens/events{/privacy}","received_events_url":"https://api.github.com/users/peterahrens/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-20T16:58:41Z","updated_at":"2018-06-27T17:00:03Z","closed_at":"2018-06-27T17:00:03Z","author_association":"CONTRIBUTOR","body":"The following Julia code\r\n```\r\nENV[\"JULIA_CXX_RTTI\"] = 1\r\nusing Cxx\r\nLibdl.dlopen(\"/usr/local/lib/libtaco\", Libdl.RTLD_GLOBAL)\r\naddHeaderDir(\"/usr/local/include\")\r\ncxxinclude(\"taco.h\")\r\ncxxinclude(\"iostream\")\r\ncxxinclude(joinpath(\"taco\", \"expr_nodes\", \"expr_nodes.h\"))\r\n\r\nrecycled = icxx\"\"\"\r\n  taco::Tensor<double> A({3}, taco::Format({taco::Sparse}, {0}));\r\n  A.insert({0}, 4.0);\r\n  A.insert({2}, 5.0);\r\n\r\n  // Pack data as described by the formats\r\n  A.pack();\r\n  taco::Access recycled = A(i);\r\n  recycled;\r\n\"\"\"\r\n\r\nicxx\"\"\"\r\n  B(i) = $(recycled) + $(recycled);\r\n  B.compile();\r\n  B.assemble();\r\n  B.compute();\r\n  std::cout << B.getStorage().getValues() << std::endl;\r\n\"\"\"\r\n```\r\nproduces the following error\r\n```\r\nIn file included from :1:\r\n:8:29: error: use of undeclared identifier 'i'\r\n  taco::Access recycled = A(i);\r\n                            ^\r\n:8:29: error: use of undeclared identifier 'i'\r\n  taco::Access recycled = A(i);\r\n                            ^\r\nERROR: LoadError: Tried to Emit Invalid Decl\r\nStacktrace:\r\n [1] EmitTopLevelDecl(::Cxx.ClangCompiler, ::Cxx.CppPtr{Cxx.CxxQualType{Cxx.CppBaseType{Symbol(\"clang::Decl\")},(false, false, false)},(false, false, false)}) at /Users/Peter/.julia/v0.6/Cxx/src/cxxstr.jl:263\r\n [2] cxxstr_impl(...) at /Users/Peter/.julia/v0.6/Cxx/src/cxxstr.jl:701\r\n [3] include_from_node1(::String) at ./loading.jl:569\r\n [4] include(::String) at ./sysimg.jl:14\r\n [5] process_options(::Base.JLOptions) at ./client.jl:305\r\n [6] _start() at ./client.jl:371\r\nwhile loading /Users/Peter/Projects/Tortilla/julia_taco_fail.jl, in expression starting on line 9\r\n```\r\n\r\nThis is not an issue in my critical path, but I think that it is worth logging both for understanding how Julia interacts with C++ and understanding taco behavior."}}
{"actor":{"display_login":"fredrikbk"}}