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

jblas causes UnsatisfiedLinkError on aarch64 (m1) mac #1047

Closed
sirno opened this issue Sep 12, 2022 · 7 comments
Closed

jblas causes UnsatisfiedLinkError on aarch64 (m1) mac #1047

sirno opened this issue Sep 12, 2022 · 7 comments
Labels

Comments

@sirno
Copy link

sirno commented Sep 12, 2022

On BEAST v2.6.7 the following issue arises with the MultiTypeTree Package on a fully updated M1 Mac.

I suppose the best shot at fixing this would be upgrading to version 2.7.0, but the packages are not yet available there.

Note that the same xml runs fine on the cluster.

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
Copy link
Member

Hi @sirno , this is a MultiTypeTree-specific problem, so I'll mark this as invalid but feel free to raise the issue on that repository. The error is because JBLAS is a wrapper around BLAS compiled to native code for a number of systems. Sadly ARM-support isn't (yet) available. We need to wait until it is. Sorry!

@tgvaughan tgvaughan closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2022
@sirno
Copy link
Author

sirno commented Sep 12, 2022

Sure, I will reopen it there. It seemed likely that the package is not the only place where JBLAS is used.

OpenBlas is already available on M1 for at least two years 😅

@tgvaughan
Copy link
Member

tgvaughan commented Sep 12, 2022

@sirno Oh dear, sorry! I had completely forgotten that for several years now jblas has been bundled with beast. (My MTT package was merely the first use of this.) I've reopened the issue. Again, sorry for the mix-up!

@tgvaughan tgvaughan reopened this Sep 12, 2022
@rbouckaert
Copy link
Member

@tgvaughan just to clarify, jblas is bundled with a number of packages (like MultiTypeTree and Mascot) but not with BEAST.base. Shouldn't this issue be opened for the corresponding packages?

@tgvaughan
Copy link
Member

Wow, I really dropped the ball here. Sorry for the noise, @rbouckaert. If this is the case, then my initial comments were correct. The issue is already open on the MTT tracker (thanks @sirno), so we can close this here.

@sirno
Copy link
Author

sirno commented Sep 13, 2022

I think it makes sense to track it here, so people can find the issue when the encounter it in any package. aarch64 systems get more and more common. also a new version shouldn't be too far away. there are already working build scripts in the jblas prs.

@tochsner
Copy link

tochsner commented May 5, 2024

I had the same issue with another Beast 2 package on my M2 mac.

I got it to work by cloning the fork from this jblas PR. Then I rebuilt jblas locally on my M2 macbook using mvn clean install. Note that I had to replace the <tasks> tag with a <target> tag in the pom.xml file for my version of Maven (see this changelog). In the end I used the generated .jar file to rebuild the BEAST package myself.

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

No branches or pull requests

4 participants