Permalink
Browse files

linux info from fib

  • Loading branch information...
1 parent 1734e7b commit 9f2ae443094c0fc8bbc13497d5fa22868410b3c5 @duncantl committed Apr 29, 2013
Showing with 40 additions and 67 deletions.
  1. +27 −0 FAQ.xml
  2. +2 −2 R/targets.R
  3. +7 −2 explorations/fib.R
  4. +3 −0 src/Function.cpp
  5. +1 −1 src/Makevars
  6. +0 −62 src/Target.cpp
View
27 FAQ.xml
@@ -44,4 +44,31 @@ export DYLD_LIBRARY_PATH=~/LLVM/build/lib/
</a>
</q>
+<q>
+I am getting error messages of the form
+<sh:output>
+/usr/local/include/llvm/Use.h:43: error: redefinition of ‘class llvm::PointerLikeTypeTraits<llvm::Use**>’
+/usr/local/include/llvm/IR/Use.h:43: error: previous definition of ‘class llvm::PointerLikeTypeTraits<llvm::Use**>’
+</sh:output>
+What's the problem?
+<a>
+One likely explanation is that you had installed a version of the llvm libraries
+and then install llvm 3.3. The layout/organization of the header
+files changed in that development branch and now we have the old and
+new headers mixed together. I would suggest
+moving the llvm header directory (e.g. in /usr/local/include/) aside
+and then re-installing llvm 3.3 (or higher).
+</a>
+</q>
+
+<q>
+I get error messages when compiling and/or loading Rllvm's DSO/DLL.
+It complains that some symbols are not found.
+<a>
+One possible explanation of this is that you are using a locally installed
+version of LLVM but linking against a different centrally installed set of LLVM libraries.
+This happens because R puts -L/usr/local/lib ahead of package link options.
+</a>
+</q>
+
</faq>
View
@@ -1,7 +1,7 @@
-LLVMVersion = c(major = 3, minor = 2)
+LLVMVersion = c(major = 3, minor = 3)
-LLVMTargets = strsplit('X86 Sparc PowerPC ARM Mips CellSPU XCore MSP430 CppBackend MBlaze NVPTX Hexagon', '[[:space:]]+')[[1]]
+LLVMTargets = strsplit('X86 Sparc PowerPC AArch64 ARM Mips XCore MSP430 CppBackend MBlaze NVPTX Hexagon', '[[:space:]]+')[[1]]
getLLVMTargets =
function()
View
@@ -27,10 +27,15 @@ tm.30 = time(30)
apply(tm.30, 2, function(x) x/min(x))
-#t(apply(tm.30, 1, function(x) x/apply(tm.30, 2, min)))
-
+# OS X
# user.self sys.self elapsed
# ll 1.0000 1.0 1.0000
# fibc 461.9535 18.0 442.1778
# fib 464.0465 18.5 444.3333
+# Linux
+# user.self sys.self elapsed
+#ll 1.0000 Inf 1.0000
+#fibc 234.8908 Inf 229.9615
+#fib 236.8297 NaN 231.8034
+
View
@@ -1,4 +1,5 @@
#include "Rllvm.h"
+#include <llvm/IR/Attributes.h>
extern "C"
SEXP
@@ -142,6 +143,7 @@ R_Function_getReturnType(SEXP r_func)
}
+#if 0
extern "C"
SEXP
R_Function_setAttributes(SEXP r_func, SEXP r_vals)
@@ -153,6 +155,7 @@ R_Function_setAttributes(SEXP r_func, SEXP r_vals)
return(ScalarLogical(TRUE));
}
+#endif
#if 0
extern "C"
View
@@ -1,6 +1,6 @@
LLVM_CONFIG=/usr/local/bin/llvm-config
-PKG_CPPFLAGS= -DLLVM_VERSION=3 -DLLVM_MINOR_VERSION=2 $(shell $(LLVM_CONFIG) --cxxflags | sed -e 's/-O[0-9]//g') -fexceptions -DLLVM_VERSION_NUMER=3.2
+PKG_CPPFLAGS= -DLLVM_VERSION=3 -DLLVM_MINOR_VERSION=3 $(shell $(LLVM_CONFIG) --cxxflags | sed -e 's/-O[0-9]//g') -fexceptions -DLLVM_VERSION_NUMER=3.3
ALL_LIBS:= $(shell $(LLVM_CONFIG) --ldflags) $(ALL_LIBS)
PKG_LIBS=$(shell $(LLVM_CONFIG) --ldflags --libs)
SHLIB_CXXLDFLAGS:=$(shell $(LLVM_CONFIG) --ldflags) $(SHLIB_CXXLDFLAGS)
View
@@ -1,62 +0,0 @@
-#include "Rllvm.h"
-#include <llvm/Support/TargetRegistry.h>
-#include <llvm/Target/TargetLibraryInfo.h>
-#include <llvm/Target/TargetMachine.h>
-
-#include <llvm/DataLayout.h>
-
-extern "C"
-SEXP
-R_TargetRegistry_lookupTarget(SEXP r_triple)
-{
- std::string err;
- const llvm::Target *ans;
- std::string triple(CHAR(STRING_ELT(r_triple, 0)));
- ans = llvm::TargetRegistry::lookupTarget(triple, err);
- return(R_createRef(ans, "Target"));
-}
-
-
-#include <llvm/Target/TargetOptions.h>
-
-extern "C"
-SEXP
-R_Target_createTargetMachine(SEXP r_target, SEXP r_triple, SEXP r_cpu, SEXP r_features, SEXP r_opts)
-{
- const llvm::Target *tgt = GET_REF(r_target, Target);
-// llvm::Module *mod = GET_REF(r_module, Module);
- std::string triple(CHAR(STRING_ELT(r_triple, 0)));
- llvm::TargetOptions *opts = NULL, defaultOpts;
- llvm::TargetMachine *ans;
-
- if(Rf_length(r_opts))
- opts = GET_REF(r_opts, TargetOptions);
- else {
- opts = &defaultOpts; //XXX initialize these.
- }
-
- ans = tgt->createTargetMachine(triple, std::string(CHAR(STRING_ELT(r_cpu, 0))),
- std::string(CHAR(STRING_ELT(r_features, 0))), *opts);
- return(R_createRef(ans, "TargetMachine"));
-}
-
-extern "C"
-SEXP
-R_TargetLibraryInfo_new(SEXP r_triple)
-{
-// std::string triple(CHAR(STRING_ELT(r_triple, 0)));
- llvm::Triple triple(CHAR(STRING_ELT(r_triple, 0)));
- llvm::TargetLibraryInfo *ans = new llvm::TargetLibraryInfo(triple);
- return(R_createRef(ans, "TargetLibraryInfo"));
-}
-
-
-
-extern "C"
-SEXP
-R_TargetMachine_getDataLayout(SEXP r_tm)
-{
- llvm::TargetMachine *tm = GET_REF(r_tm, TargetMachine);
- const llvm::DataLayout *ans = tm->getDataLayout();
- return(R_createRef(ans, "DataLayout"));
-}

0 comments on commit 9f2ae44

Please sign in to comment.