Closed ArtPoon closed 8 years ago
Right now the build script is not working:
Undefined symbols for architecture x86_64:
"_R_SEXP_to_igraph", referenced from:
_R_igraph_test in test-f09788.o
"_Rf_allocVector", referenced from:
_R_igraph_test in test-f09788.o
"_Rf_protect", referenced from:
_R_igraph_test in test-f09788.o
"_Rf_unprotect", referenced from:
_R_igraph_test in test-f09788.o
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Duh, needed to set a -c
flag or specify a main()
function in test.c
. Now need to compile this in a way that we can call it from R.
Still having trouble:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Kaphi/libs/Kaphi.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Kaphi/libs/Kaphi.so, 6): Symbol not found: _igraph_destroy
Referenced from: /Library/Frameworks/R.framework/Versions/3.2/Resources/library/Kaphi/libs/Kaphi.so
StackOverflow suggests that I've forgotten to compile with the igraph library.
Okay, I've given up on compiling igraph and am using MacPorts for now (see issue #3).
The above error has been resolved, but we're onto another one:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Kaphi/libs/Kaphi.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.2/Resources/library/Kaphi/libs/Kaphi.so, 6): Symbol not found: _R_igraph_add_env
Well, I've gutted rinterface.c
of all functions that gave complaints at compilation, and this now appears to compile. Hopefully we now have a basis for testing code.
Making sure the igraph
and rigraph
sources are the same version helps avoid the errors that arose in compiling. I'm using 0.7.1 for both. However, I'm still running into this problem:
** preparing package for lazy loading
Error in .Call("treekernel", graph, PACKAGE = "Kaphi") :
"treekernel" not available for .Call() for package "Kaphi"
Error : unable to load R code in package ‘Kaphi’
ERROR: lazy loading failed for package ‘Kaphi’
Removing the .Call()
to treekernel
in the test script test.R
makes it possible to install the package, but of course this is not very useful.
This is largely an issue with NAMESPACE:
export
statement in the NAMESPACE file.Close by 21ba93f07801ecce9bf9e3e963aa2f347249f86a
Writing a simple bit of C code
test.c
and an R scripttest.R
that will create an igraph object from a phylogeny and then pass it to C. Working off therinterface.c
code from rigraph as a template. There seem to be some versioning issues with Rosemary's fork of igraph and function calls inrinterface.c
that I've temporarily resolved by stripping out the offending functions in the latter.