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

macOS support + update code to fetch and build llvm #1239

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

Jakobeha
Copy link
Collaborator

@Jakobeha Jakobeha commented May 24, 2023

  • specifically looking at macOS ARM, with homebrew (where library code is in /opt/homebrew)

R_ENABLE_JIT=0 works

PIR_DEBUG=PrintEarlyPir,PrintFinalPir,... seem to create more issues
PIR_DEBUG=DryRun hasn't produced issues so far though some of the tests take a really long time, so they might be hanging

Here are log snippets of some of the test failures:

> for (i in 1:10) {
+     f12()
+ }

 *** caught segfault ***
address 0x100000020, cause 'invalid permissions'

Traceback:
 1: make.names(vnames, unique = TRUE)
 2: data.frame(x = ts(c(41, 42, 43)), y = c(61, 62, 63))
 3: f12()
An irrecoverable exception occurred. R is aborting now ...
*************************************************************************************
***  end log pir_regression2.R
*************************************************************************************
*
> dyn.load('/Users/jakobeha/Documents/grad/research/rir/build/librir.dylib')
> source('/Users/jakobeha/Documents/grad/research/rir/tools/../rir/R/rir.R')
> library(Matrix)
Error: package or namespace load failed for ‘Matrix’ in loadNamespace(package, lib.loc):
 bad target context--should NEVER happen if R was called correctly
Execution halted
*************************************************************************************
***  end log regression_spModel.matrix.R
*************************************************************************************
*************************************************************************************
xargs: bash: exited with status 255; aborting
> utils::str(allinfoNS("stats"))
List of 9
 $ DLLs          :List of 1
  ..$ stats:List of 5
  .. ..$ name         : chr "stats"
  .. ..$ path         : chr "/Users/jakobeha/Documents/grad/research/rir/external/custom-r/library/stats/libs/stats.so"
  .. ..$ dynamicLookup: logi FALSE
  .. ..$ handle       :
 *** caught segfault ***
address 0x10, cause 'invalid permissions'

Traceback:
 1: do.call(function(...) str(obj, ...), c(aList, list(...)), quote = TRUE)
 2: strSub(object[[i]], give.length = give.length, nest.lev = nest.lev +     1, indent.str = paste(indent.str, ".."))
 3: str.default(obj, ...)
 4: str(obj, ...)
 5: (function (...) str(obj, ...))(max.level = base::quote(NA), vec.len = base::quote(4L),     digits.d = base::quote(3L), nchar.max = base::quote(128),     give.attr = base::quote(TRUE), drop.deparse.attr = base::quote(TRUE),     give.head = base::quote(TRUE), width = base::quote(80L),     envir = base::quote(NULL), strict.width = base::quote("no"),     formatNum = base::quote(function (x, ...)     format(x, trim = TRUE, drop0trailing = TRUE, ...)), list.len = base::quote(99L),     deparse.lines = base::quote(NULL), give.length = base::quote(TRUE),     nest.lev = base::quote(2), indent.str = base::quote("  .. .."))
 6: do.call(function(...) str(obj, ...), c(aList, list(...)), quote = TRUE)
 7: strSub(object[[i]], give.length = give.length, nest.lev = nest.lev +     1, indent.str = paste(indent.str, ".."))
 8: str.default(obj, ...)
 9: str(obj, ...)
10: (function (...) str(obj, ...))(max.level = base::quote(NA), vec.len = base::quote(4L),     digits.d = base::quote(3L), nchar.max = base::quote(128),     give.attr = base::quote(TRUE), drop.deparse.attr = base::quote(TRUE),     give.head = base::quote(TRUE), width = base::quote(80L),     envir = base::quote(NULL), strict.width = base::quote("no"),     formatNum = base::quote(function (x, ...)     format(x, trim = TRUE, drop0trailing = TRUE, ...)), list.len = base::quote(99L),     deparse.lines = base::quote(NULL), give.length = base::quote(TRUE),     nest.lev = base::quote(1), indent.str = base::quote("  .."))
11: do.call(function(...) str(obj, ...), c(aList, list(...)), quote = TRUE)
12: strSub(object[[i]], give.length = give.length, nest.lev = nest.lev +     1, indent.str = paste(indent.str, ".."))
13: str.default(allinfoNS("stats"))
14: utils::str(allinfoNS("stats"))
An irrecoverable exception occurred. R is aborting now ...
*************************************************************************************
***  end log pir_regression6.R
*************************************************************************************
*************************************************************************************
xargs: bash: exited with status 255; aborting
> dyn.load('/Users/jakobeha/Documents/grad/research/rir/build/librir.dylib')
> source('/Users/jakobeha/Documents/grad/research/rir/tools/../rir/R/rir.R')
>   a <- b <- 0
>   plot(a, b    
+        )
> example(glm )
Error in loadNamespace(x) : 
  bad target context--should NEVER happen if R was called correctly
Calls: example -> loadNamespace
Execution halted
*************************************************************************************
***  end log regression_stats.R
*************************************************************************************
*************************************************************************************
xargs: bash: exited with status 255; aborting
> mkDend <- function(n, lab, method = "complete",
+                    ## gives *ties* often:
+                  rGen = function(n) 1+round(16*abs(rnorm(n)))) {
+     stopifnot(is.numeric(n), length(n) == 1, n >= 1, is.character(lab))
+     a <- matrix(rGen(n*n), n, n)
+     colnames(a) <- rownames(a) <- paste0(lab, 1:n)
+     .HC. <<- hclust(as.dist(a + t(a)), method=method)
+     as.dendrogram(.HC.)
+ }
> 
> ## recursive dendrogram methods and deeply nested dendrograms
> op <- options(expressions = 999)# , verbose = 2) # -> max. depth= 961
> set.seed(11); d <- mkDend(1500, "A", method="single")
> rd <- reorder(d, nobs(d):1)

 *** caught segfault ***
address 0x1, cause 'invalid permissions'

Traceback:
 1: match.arg(method)
 2: order(x, na.last = na.last, decreasing = decreasing, method = "radix")
 3: sort.list(vals)
 4: oV(x, wts)
 5: stopifnot(inherits(x, "dendrogram"))
 6: midcache.dendrogram(oV(x, wts))
 7: reorder.dendrogram(d, nobs(d):1)
 8: reorder(d, nobs(d):1)
An irrecoverable exception occurred. R is aborting now ...
*************************************************************************************
***  end log reg-tests-1c.R
*************************************************************************************
*************************************************************************************
xargs: bash: exited with status 255; aborting

#1193

JIT session error: Symbols not found: [ _ept_60000346b6c0, _ept_60000346be40, _ept_60000346bdb0, _ept_60000346b900, _efn_10252c0c0, _ept_10273d898, _ept_10273dd20, _ept_11a823e28, _ept_11a823f08, _ept_139812080, _ept_139812438, _ept_139812470, _ept_1398124e0, _ept_13981e690, _ept_13984b900, _ept_1712214d3, _ept_171221544, _ept_17122168c, _ept_171221781, _ept_171221794, _ept_171221aea, _ept_171222e24, _ept_600002f44c80, _ept_600002f453c0, _ept_600002f45f00, _ept_600002f46400, _ept_600002f4a480, _ept_600002f4e200, _ept_600002f4ed00, _ept_600002f4f700, _ept_600002f4fcc0, _ept_600002f4ff40, _ept_60000344a340, _ept_60000344a670, _ept_60000344a850, _ept_60000344ab80, _ept_60000344abb0, _ept_60000344af70, _ept_60000344b0f0, _ept_60000344b390, _ept_60000344b510, _ept_60000344b570, _ept_60000344b6f0, _ept_60000344b870, _ept_60000344b8d0, _ept_60000344ba50, _ept_60000344bae0, _ept_60000344bb70, _ept_60000344bd50, _ept_60000344bed0, _ept_60000346b480, _ept_60000346b540, _ept_60000346b570, _ept_60000346b600, _ept_60000346b630 ]
manually re-triggering wasn't working, and test-sanitize failure seems random unless it's a formatting issue
@o-
Copy link
Contributor

o- commented May 30, 2023

Here are some stats for your PR:

  • WARNING: the longest CI job test_release_2 took 2.41h
  • are-we-fast-r suite regressed by 0.96
  • Bounce_nonames_simple regressed by 0.94
  • fasta_naive regressed by 0.91
  • emptyFor regressed by 0.83
  • Overall benchmarks regressed by 1.0

Please find your performance results at https://rir-benchmarks.prl.fit.cvut.cz/diff?job_ids[]=4369453822&job_ids[]=4371607270&selection=all

@Jakobeha Jakobeha marked this pull request as ready for review May 30, 2023 18:23
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

Successfully merging this pull request may close these issues.

2 participants