#6559·numba

RISC-V Support

Author: advancedwebdeveloperCreated Dec 9, 2020Updated Sep 16, 2026
Labelsfeature_requestllvmISA: RISC-V

Hi. It doesn't seem that you have migrated - so I am reminding about the current situation:

$ python3 setup.py build /usr/lib/python3.8/site-packages/setuptools/dist.py:473: UserWarning: Normalizing '0.36.0dev0+8.ge0e03f3' to '0.36.0.dev0+8.ge0e03f3' warnings.warn( running build got version from VCS {'version': '0.36.0dev0+8.ge0e03f3', 'full': 'e0e03f3d8fc8f5b616381b0814bfec3cfc0769f9'} running build_ext /usr/bin/python3 /home/oceanfish81/llvmlite/ffi/build.py LLVM version... 11.0.0

The LLVM version check for supported versions has been overridden. This is unsupported behaviour, llvmlite may not work as intended. Requested LLVM version: 11.0.0

SVML not detected

static-libstdc++ avoids runtime dependencies on a

particular libstdc++ version.

g++ -shared -fPIC -I/usr/include -std=c++14 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -g -flto assembly.cpp bitcode.cpp core.cpp initfini.cpp module.cpp value.cpp executionengine.cpp transforms.cpp passmanagers.cpp targets.cpp dylib.cpp linker.cpp object_file.cpp custom_passes.cpp -o libllvmlite.so -L/usr/lib64 -flto -Wl,--exclude-libs=ALL -lLLVM

transforms.cpp:10:32: error: redefinition of ‘llvm::PassManagerBuilder* llvm::unwrap(LLVMPassManagerBuilderRef)’ 10 | inline PassManagerBuilder unwrap(LLVMPassManagerBuilderRef P) { | ^~~~~~ In file included from transforms.cpp:4: /usr/include/llvm/Transforms/IPO/PassManagerBuilder.h:255:28: note: ‘llvm::PassManagerBuilder llvm::unwrap(LLVMPassManagerBuilderRef)’ previously defined here 255 | inline PassManagerBuilder unwrap(LLVMPassManagerBuilderRef P) { | ^~~~~~ transforms.cpp:14:38: error: redefinition of ‘LLVMOpaquePassManagerBuilder llvm::wrap(llvm::PassManagerBuilder*)’ 14 | inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder P) { | ^~~~ In file included from transforms.cpp:4: /usr/include/llvm/Transforms/IPO/PassManagerBuilder.h:259:34: note: ‘LLVMOpaquePassManagerBuilder llvm::wrap(llvm::PassManagerBuilder*)’ previously defined here 259 | inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder P) { | ^~~~ custom_passes.cpp:408:2: error: #error Invalid LLVM version/LLVM_VERSION_MAJOR not defined 408 | #error Invalid LLVM version/LLVM_VERSION_MAJOR not defined | ^~~~~ custom_passes.cpp:446:9: error: expected unqualified-id before ‘return’ 446 | return mutated; | ^~~~~~ custom_passes.cpp:447:6: error: expected ‘;’ after struct definition 447 | } | ^ | ; custom_passes.cpp: In member function ‘virtual bool RefPrunePass::runOnFunction(llvm::Function&)’: custom_passes.cpp:216:34: error: ‘runFanoutPrune’ was not declared in this scope; did you mean ‘runDiamondPrune’? 216 | local_mutated |= runFanoutPrune(F, /prune_raise/false); | ^~~~~~~~~~~~~~ | runDiamondPrune custom_passes.cpp:218:34: error: ‘runFanoutPrune’ was not declared in this scope; did you mean ‘runDiamondPrune’? 218 | local_mutated |= runFanoutPrune(F, /prune_raise/true); | ^~~~~~~~~~~~~~ | runDiamondPrune custom_passes.cpp: In member function ‘bool RefPrunePass::runPerBasicBlockPrune(llvm::Function&)’: custom_passes.cpp:271:26: error: ‘isNonNullFirstArg’ was not declared in this scope 271 | if (!isNonNullFirstArg(ci)) { | ^~~~~~~~~~~~~~~~~ custom_passes.cpp:302:35: error: ‘isRelatedDecref’ was not declared in this scope 302 | if (decref && isRelatedDecref(incref, decref)) { | ^~~~~~~~~~~~~~~ custom_passes.cpp: In member function ‘bool RefPrunePass::runDiamondPrune(llvm::Function&)’: custom_passes.cpp:379:9: error: ‘listRefOps’ was not declared in this scope 379 | listRefOps(F, IsIncRef, incref_list); | ^~~~~~~~~~ custom_passes.cpp:396:22: error: ‘isRelatedDecref’ was not declared in this scope 396 | if (!isRelatedDecref(incref, decref)) continue; | ^~~~~~~~~~~~~~~ custom_passes.cpp:414:27: error: ‘verifyFanoutBackward’ was not declared in this scope 414 | if ( !verifyFanoutBackward(incref, incref->getParent(), &tail_nodes) ) | ^~~~~~~~~~~~~~~~~~~~ custom_passes.cpp:419:25: error: ‘hasDecrefBetweenGraph’ was not declared in this scope 419 | if (hasDecrefBetweenGraph(incref->getParent(), decref->getParent())) { | ^~~~~~~~~~~~~~~~~~~~~ custom_passes.cpp:445:9: warning: no return statement in function returning non-void [-Wreturn-type] 445 | } | ^ custom_passes.cpp: In function ‘bool runFanoutPrune(llvm::Function&, bool)’: custom_passes.cpp:521:9: error: ‘listRefOps’ was not declared in this scope 521 | listRefOps(F, IsIncRef, incref_list); | ^~~~~~~~~~ custom_passes.cpp:524:9: error: ‘SmallBBSet’ was not declared in this scope 524 | SmallBBSet bad_blocks; | ^~~~~~~~~~ custom_passes.cpp:528:17: error: ‘bad_blocks’ was not declared in this scope 528 | if (bad_blocks.count(incref->getParent())) { | ^~~~~~~~~~ custom_passes.cpp:534:17: error: ‘hasAnyDecrefInNode’ was not declared in this scope 534 | if (hasAnyDecrefInNode(incref->getParent())){ | ^~~~~~~~~~~~~~~~~~ custom_passes.cpp:539:23: error: expected ‘;’ before ‘decref_blocks’ 539 | SmallBBSet decref_blocks; | ^~~~~~~~~~~~~~ | ; custom_passes.cpp:541:37: error: ‘bad_blocks’ was not declared in this scope 541 | if ( findFanout(incref, bad_blocks, &decref_blocks, prune_raise_exit) ) { | ^~~~~~~~~~ custom_passes.cpp:541:50: error: ‘decref_blocks’ was not declared in this scope 541 | if ( findFanout(incref, bad_blocks, &decref_blocks, prune_raise_exit) ) { | ^~~~~~~~~~~~~ custom_passes.cpp:541:18: error: ‘findFanout’ was not declared in this scope 541 | if ( findFanout(incref, bad_blocks, &decref_blocks, prune_raise_exit) ) { | ^~~~~~~~~~ custom_passes.cpp:560:40: error: ‘isRelatedDecref’ was not declared in this scope 560 | if ( (decref = isRelatedDecref(incref, &ii)) ) { | ^~~~~~~~~~~~~~~ custom_passes.cpp:569:53: error: ‘stats_fanout_raise’ was not declared in this scope 569 | if (prune_raise_exit) stats_fanout_raise += 1; | ^~~~~~~~~~~~~~~~~~ custom_passes.cpp:570:53: error: ‘stats_fanout’ was not declared in this scope 570 | else stats_fanout += 1; | ^~~~~~~~~~~~ custom_passes.cpp:579:41: error: ‘stats_fanout_raise’ was not declared in this scope 579 | if (prune_raise_exit) stats_fanout_raise += 1; | ^~~~~~~~~~~~~~~~~~ custom_passes.cpp:580:41: error: ‘stats_fanout’ was not declared in this scope 580 | else stats_fanout += 1; | ^~~~~~~~~~~~ custom_passes.cpp: At global scope: custom_passes.cpp:607:39: error: ‘SmallBBSet’ has not been declared 607 | bool findFanout(CallInst incref, SmallBBSet &bad_blocks, SmallBBSet decref_blocks, bool prune_raise_exit) { | ^~~~~~~~~~ custom_passes.cpp:607:63: error: ‘SmallBBSet’ has not been declared 607 | bool findFanout(CallInst incref, SmallBBSet &bad_blocks, SmallBBSet decref_blocks, bool prune_raise_exit) { | ^~~~~~~~~~ custom_passes.cpp: In function ‘bool findFanout(llvm::CallInst, int&, int, bool)’: custom_passes.cpp:614:9: error: ‘SmallBBSet’ was not declared in this scope 614 | SmallBBSet raising_blocks, p_raising_blocks = NULL; | ^~~~~~~~~~ custom_passes.cpp:616:32: error: ‘p_raising_blocks’ was not declared in this scope 616 | if( prune_raise_exit ) p_raising_blocks = &raising_blocks; | ^~~~~~~~~~~~~~~~ custom_passes.cpp:616:52: error: ‘raising_blocks’ was not declared in this scope 616 | if( prune_raise_exit ) p_raising_blocks = &raising_blocks; | ^~~~~~~~~~~~~~ custom_passes.cpp:618:87: error: ‘p_raising_blocks’ was not declared in this scope 618 | if ( findFanoutDecrefCandidates(incref, head_node, bad_blocks, decref_blocks, p_raising_blocks) ) { | ^~~~~~~~~~~~~~~~ custom_passes.cpp:618:14: error: ‘findFanoutDecrefCandidates’ was not declared in this scope 618 | if ( findFanoutDecrefCandidates(incref, head_node, bad_blocks, decref_blocks, p_raising_blocks) ) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~ custom_passes.cpp:620:78: error: request for member ‘size’ in ‘ decref_blocks’, which is of non-class type ‘int’ 620 | errs() << "forward pass candids.size() = " << decref_blocks->size() << "\n"; | ^~~~ custom_passes.cpp:624:32: error: request for member ‘size’ in ‘ decref_blocks’, which is of non-class type ‘int’ 624 | if (decref_blocks->size() == 0) { | ^~~~ custom_passes.cpp:627:61: error: ‘raising_blocks’ was not declared in this scope 627 | errs() << "missing decref blocks = " << raising_blocks.size() << "\n"; | ^~~~~~~~~~~~~~ custom_passes.cpp:632:22: error: ‘raising_blocks’ was not declared in this scope 632 | if ( raising_blocks.size() == 0) { | ^~~~~~~~~~~~~~ custom_passes.cpp:636:41: error: ‘begin’ was not declared in this scope 636 | for (auto bb : decref_blocks){ | ^~~~~~~~~~~~~ custom_passes.cpp:636:41: note: suggested alternatives: In file included from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/bits/range_access.h:108:37: note: ‘std::begin’ 108 | template const _Tp begin(const valarray<_Tp>&); | ^~~~~ In file included from /usr/include/c++/10/bits/range_access.h:36, from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/initializer_list:90:5: note: ‘std::begin’ 90 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ In file included from /usr/include/llvm/Support/YAMLTraits.h:23, from /usr/include/llvm/IR/DiagnosticInfo.h:24, from /usr/include/llvm/Analysis/OptimizationRemarkEmitter.h:19, from /usr/include/llvm/Analysis/InlineCost.h:18, from /usr/include/llvm/Transforms/IPO/Attributor.h:108, from /usr/include/llvm/LinkAllPasses.h:44, from custom_passes.cpp:19: /usr/include/llvm/Support/YAMLParser.h:380:35: note: ‘llvm::yaml::begin’ 380 | typename CollectionType::iterator begin(CollectionType &C) { | ^~~~~ custom_passes.cpp:636:41: error: ‘end’ was not declared in this scope 636 | for (auto bb : decref_blocks){ | ^~~~~~~~~~~~~ custom_passes.cpp:636:41: note: suggested alternatives: In file included from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/bits/range_access.h:110:37: note: ‘std::end’ 110 | template const _Tp end(const valarray<_Tp>&); | ^~~ In file included from /usr/include/c++/10/bits/range_access.h:36, from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/initializer_list:101:5: note: ‘std::end’ 101 | end(initializer_list<_Tp> __ils) noexcept | ^~~ custom_passes.cpp:644:41: error: ‘begin’ was not declared in this scope 644 | for ( BasicBlock bb : decref_blocks ) { | ^~~~~~~~~~~~~ custom_passes.cpp:644:41: note: suggested alternatives: In file included from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/bits/range_access.h:108:37: note: ‘std::begin’ 108 | template const _Tp begin(const valarray<_Tp>&); | ^~~~~ In file included from /usr/include/c++/10/bits/range_access.h:36, from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/initializer_list:90:5: note: ‘std::begin’ 90 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ In file included from /usr/include/llvm/Support/YAMLTraits.h:23, from /usr/include/llvm/IR/DiagnosticInfo.h:24, from /usr/include/llvm/Analysis/OptimizationRemarkEmitter.h:19, from /usr/include/llvm/Analysis/InlineCost.h:18, from /usr/include/llvm/Transforms/IPO/Attributor.h:108, from /usr/include/llvm/LinkAllPasses.h:44, from custom_passes.cpp:19: /usr/include/llvm/Support/YAMLParser.h:380:35: note: ‘llvm::yaml::begin’ 380 | typename CollectionType::iterator begin(CollectionType &C) { | ^~~~~ custom_passes.cpp:644:41: error: ‘end’ was not declared in this scope 644 | for ( BasicBlock bb : decref_blocks ) { | ^~~~~~~~~~~~~ custom_passes.cpp:644:41: note: suggested alternatives: In file included from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/bits/range_access.h:110:37: note: ‘std::end’ 110 | template const _Tp end(const valarray<_Tp>&); | ^~~ In file included from /usr/include/c++/10/bits/range_access.h:36, from /usr/include/c++/10/string:54, from /usr/include/llvm/Pass.h:31, from custom_passes.cpp:5: /usr/include/c++/10/initializer_list:101:5: note: ‘std::end’ 101 | end(initializer_list<_Tp> __ils) noexcept | ^~~ custom_passes.cpp:645:21: error: ‘raising_blocks’ was not declared in this scope 645 | raising_blocks.insert(bb); | ^~~~~~~~~~~~~~ custom_passes.cpp:647:22: error: ‘verifyFanoutBackward’ was not declared in this scope 647 | if ( verifyFanoutBackward(incref, head_node, p_raising_blocks) ) | ^~~~~~~~~~~~~~~~~~~~ custom_passes.cpp:650:25: error: ‘verifyFanoutBackward’ was not declared in this scope 650 | } else if ( verifyFanoutBackward(incref, head_node, decref_blocks) ) { | ^~~~~~~~~~~~~~~~~~~~ custom_passes.cpp: At global scope: custom_passes.cpp:692:37: error: ‘SmallBBSet’ has not been declared 692 | SmallBBSet &bad_blocks, | ^~~~~~~~~~ custom_passes.cpp:693:37: error: ‘SmallBBSet’ has not been declared 693 | SmallBBSet decref_blocks, | ^~~~~~~~~~ custom_passes.cpp:694:37: error: ‘SmallBBSet’ has not been declared 694 | SmallBBSet raising_blocks) { | ^~~~~~~~~~ custom_passes.cpp: In function ‘bool findFanoutDecrefCandidates(llvm::CallInst, llvm::BasicBlock, int&, int*, int*)’: custom_passes.cpp:696:34: error: ‘FANOUT_RECURSE_DEPTH’ was not declared in this scope 696 | SmallVector<BasicBlock*, FANOUT_RECURSE_DEPTH> path_stack; | ^~~~~~~~~~~~~~~~~~~~ custom_passes.cpp:696:54: error: template argument 2 is invalid 696 | SmallVector<BasicBlock*, FANOUT_RECURSE_DEPTH> path_stack; | ^ custom_passes.cpp:703:85: error: no matching function for call to ‘raiiStack<llvm::SmallVectorImplllvm::BasicBlock* >::raiiStack(int&, llvm::BasicBlock*&)’ 703 | raiiStack<SmallVectorImpl<BasicBlock*>> raii_path_stack(path_stack, cur_node); | ^ custom_passes.cpp:97:5: note: candidate: ‘raiiStack::raiiStack(Tstack&, raiiStack::value_type&) [with Tstack = llvm::SmallVectorImplllvm::BasicBlock*; raiiStack::value_type = llvm::BasicBlock*]’ 97 | raiiStack(Tstack &stack, value_type& elem) :stack(stack) { | ^~~~~~~~~ custom_passes.cpp:97:23: note: no known conversion for argument 1 from ‘int’ to ‘llvm::SmallVectorImplllvm::BasicBlock*&’ 97 | raiiStack(Tstack &stack, value_type& elem) :stack(stack) { | ~~~~~~~~^~~~~ custom_passes.cpp:89:8: note: candidate: ‘constexpr raiiStack<llvm::SmallVectorImplllvm::BasicBlock* >::raiiStack(const raiiStack<llvm::SmallVectorImplllvm::BasicBlock* >&)’ 89 | struct raiiStack { | ^~~~~~~~~ custom_passes.cpp:89:8: note: candidate expects 1 argument, 2 provided custom_passes.cpp:713:21: error: ‘walkChildForDecref’ was not declared in this scope 713 | found = walkChildForDecref( | ^~~~~~~~~~~~~~~~~~ custom_passes.cpp: At global scope: custom_passes.cpp:746:9: error: ‘SmallBBSet’ has not been declared 746 | SmallBBSet &bad_blocks, | ^~~~~~~~~~ custom_passes.cpp:747:9: error: ‘SmallBBSet’ has not been declared 747 | SmallBBSet *decref_blocks, | ^~~~~~~~~~ custom_passes.cpp:748:9: error: ‘SmallBBSet’ has not been de