Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subsetting shenanigans #2

Closed
PeteHaitch opened this issue Jul 28, 2017 · 6 comments
Closed

Subsetting shenanigans #2

PeteHaitch opened this issue Jul 28, 2017 · 6 comments

Comments

@PeteHaitch
Copy link

Something funky seems to be going on with subsetting:

library(spm)
m <- 10000
n <- 2500
x <- matrix(rnorm(m*n), m, n)
xs = mat2spm(x)
xs[1:10, 1:5] # works
xs[1:5, 1:10] # works
xs[1:10, 1:10] # wut?
# An spm (single precision matrix): 10x10
Error in dim(submat) <- c(toprow, topcol) :
  dims [product 50] do not match the length of object [100]

Any ideas?

@wrathematics
Copy link
Owner

I think it's the print method. It's a bit of a mess. I'll take a look soon.

@wrathematics
Copy link
Owner

Should be fixed in the latest push. Still a bit of a mess though 🙂

@PeteHaitch
Copy link
Author

PeteHaitch commented Jul 28, 2017

Having some troubles installing after update, sorry

> install_github("wrathematics/spm")
Using GitHub PAT from envvar GITHUB_PAT
Downloading GitHub repo wrathematics/spm@master
from URL https://api.github.com/repos/wrathematics/spm/zipball/master
Installing spm
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ  \
  --no-save --no-restore --quiet CMD INSTALL  \
  '/private/var/folders/f1/6pjy5xbn0_9_7xwq6l7fj2yc0000gn/T/Rtmp8jIoQu/devtools167ce13f57ad/wrathematics-spm-b8c071d'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library'  \
  --install-tests

* installing *source* packagespm...
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for gcc option to accept ISO C99... none needed
** libs
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c bracket.c -o bracket.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c chol.c -o chol.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c converters.c -o converters.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c crossprod.c -o crossprod.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c diag.c -o diag.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c dims.c -o dims.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c isSymmetric.c -o isSymmetric.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c matmult.c -o matmult.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c solve.c -o solve.o
/usr/local/clang4/bin/clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG   -I/usr/local/include  -fopenmp -fPIC  -Wall -g -O2  -c xpose.c -o xpose.o
/usr/local/clang4/bin/clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/clang4/lib -o spm.so bracket.o chol.o converters.o crossprod.o diag.o dims.o isSymmetric.o matmult.o solve.o xpose.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -fopenmp -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin15/6.1.0'
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/spm/libs
** R
** tests
** byte-compile and prepare package for lazy loading
Creating a generic function forcrossprodfrom packagebasein packagespmCreating a generic function fortcrossprodfrom packagebasein packagespmCreating a generic function fordiagfrom packagebasein packagespmCreating a generic function fornrowfrom packagebasein packagespmCreating a generic function forncolfrom packagebasein packagespmCreating a generic function forobject.sizefrom packageutilsin packagespm** help
No man pages found in packagespm*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed forspmin FUN(X[[i]], ...):
 no such symbol R_numbytes_spm in package /Library/Frameworks/R.framework/Versions/3.4/Resources/library/spm/libs/spm.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing/Library/Frameworks/R.framework/Versions/3.4/Resources/library/spm* restoring previous/Library/Frameworks/R.framework/Versions/3.4/Resources/library/spmInstallation failed: Command failed (1)

> sessionInfo()
> sessionInfo()
R version 3.4.0 (2017-04-21)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.5

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] colorout_1.1-2    repete_0.0.0.9008 devtools_1.13.2

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.12            XVector_0.17.0          magrittr_1.5
 [4] GenomicRanges_1.29.10   BiocGenerics_0.23.0     zlibbioc_1.23.0
 [7] IRanges_2.11.12         munsell_0.4.3           colorspace_1.3-2
[10] R6_2.2.2                httr_1.2.1.9000         stringr_1.2.0
[13] GenomeInfoDb_1.13.4     plyr_1.8.4              tools_3.4.0
[16] parallel_3.4.0          git2r_0.19.0            withr_1.0.2
[19] fortunes_1.5-4          digest_0.6.12           GenomeInfoDbData_0.99.1
[22] pryr_0.1.2              S4Vectors_0.15.5        bitops_1.0-6
[25] codetools_0.2-15        curl_2.8.1              RCurl_1.95-4.8
[28] memoise_1.1.0           stringi_1.1.5           compiler_3.4.0
[31] scales_0.4.1            stats4_3.4.0

@wrathematics
Copy link
Owner

Sorry about that; forgot to add a file in the commit. Have too many uncommitted changes in the repo at the moment.

I think it should be fixed now. Travis currently shows the build erroring, but it's from R CMD check warnings. Let me know if it doesn't compile.

@PeteHaitch
Copy link
Author

Thanks, back in business with successful compilation. I did get several gfortran warnings (macOS) but no idea if they matter. Can post details if you'd like

@wrathematics
Copy link
Owner

wrathematics commented Jul 31, 2017

Please do! If you could paste your whole output starting from checking for gcc... (in a new issue?) that would be helpful.

I suspect it's compiling single precision blas/lapack for you (finally added this morning), but you didn't need it before, so that's really a bug...

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants