tgvaughan / MultiTypeTree

BEAST 2 package which provides support for multi-type trees: phylogenetic trees on structured populations.
http://tgvaughan.github.io/MultiTypeTree
GNU General Public License v3.0
21 stars 16 forks source link

jblas causes UnsatisfiedLinkError on aarch64 (m1) mac #21

Open sirno opened 1 year ago

sirno commented 1 year ago

jblas doesn't support m1 (jblas-project/jblas#134 )as @tgvaughan mentioned in CompEvol/beast2#1047

This results in the following errror.

java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
    at java.base/java.lang.reflect.Method.invoke(Method.java:577)
    at beast.app.beastapp.BeastLauncher.run(Unknown Source)
    at beast.app.beastapp.BeastLauncher.main(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: 'void org.jblas.NativeBlas.dgemm(char, char, int, int, int, double, double[], int, int, double[], int, int, double, double[], int, int)'
    at org.jblas.NativeBlas.dgemm(Native Method)
    at org.jblas.SimpleBlas.gemm(SimpleBlas.java:247)
    at org.jblas.DoubleMatrix.mmuli(DoubleMatrix.java:1781)
    at org.jblas.DoubleMatrix.mmul(DoubleMatrix.java:3138)
    at org.jblas.MatrixFunctions.expm(MatrixFunctions.java:428)
    at multitypetree.operators.UniformizationRetypeOperator.getBranchTypeProb(Unknown Source)
    at multitypetree.operators.NodeShiftRetype.nonRootProposal(Unknown Source)
    at multitypetree.operators.NodeShiftRetype.proposal(Unknown Source)
    at beast.core.Operator.proposal(Unknown Source)
    at beast.core.MCMC.propagateState(Unknown Source)
    at beast.core.MCMC.doLoop(Unknown Source)
    at beast.core.MCMC.run(Unknown Source)
    at beast.app.BeastMCMC.run(Unknown Source)
    at beast.app.beastapp.BeastMain.<init>(Unknown Source)
    at beast.app.beastapp.BeastMain.main(Unknown Source)
    at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
    ... 3 more
-- org.jblas INFO Deleting /var/folders/sl/b99vml7s45q3zx3wb1fqvq240000gp/T/jblas15640803248391520753
tgvaughan commented 1 year ago

Thanks Nicolas :)

sirno commented 1 year ago

Actually I just checked again, and it looks like version 1.2.5 should work on arm64, which is one minor version higher than what is packaged with mtt. https://github.com/jblas-project/jblas/pull/118

triple-jay commented 8 months ago

Actually I just checked again, and it looks like version 1.2.5 should work on arm64, which is one minor version higher than what is packaged with mtt. jblas-project/jblas#118

Hi, I'm running into the same issue—were you able to solve this? I tried replacing the jblas 1.2.4 jar file with jblas 1.2.5 and still ran into the same issue.

tgvaughan commented 7 months ago

Hi @triple-jay, I've just released a new version of MTT which includes (and is compiled against) the new jblas. Maybe this helps get things working on your system?

triple-jay commented 7 months ago

Thank you for your quick response and help! Unfortunately, it still is giving the same error 🥲

Screen Shot 2023-11-30 at 3 17 46 PM

tgvaughan commented 7 months ago

Sorry to hear this. :-/ I think we're a bit stuck in this case then as far as apple silicon goes. Unless somebody has time to port MTT to a new linear algebra library which is supported on that hardware, or to include a Java-only implementation of the matrix computations. (This latter approach would probably incur quite a speed penalty.)

For now it seems that MTT will have to remain an intel-only package :-(

triple-jay commented 7 months ago

Got it thank you so much for your help :)