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

Importing math32 for TinyGo on RP2040/arm32 missing methods for Sqrt Log and Exp #44

Closed
djthorpe opened this issue May 28, 2022 · 2 comments

Comments

@djthorpe
Copy link

I am importing your great float32 package for the following environment:

tinygo version 0.23.0 linux/arm (using go version go1.18.1 and LLVM version 14.0.0)
Target: Raspberry Pi Pico RP2040 (arm32)

Linking is failing as per message below.

tinygo:ld.lld: error: undefined symbol: github.com/chewxy/math32.Sqrt
tinygo:ld.lld: error: undefined symbol: github.com/chewxy/math32.Log
tinygo:ld.lld: error: undefined symbol: github.com/chewxy/math32.Exp

I think this is because some sort of architechture nuance here means it does or doesn't have the in-built architecture dependent versions. Sorry not sure of the exact flags, happy to help debug some more.

The workaround for me is to comment out missing "haveArchExp" symbol (for example):

func Exp(x float32) float32 {
	/*	if haveArchExp {
		return archExp(x)
	}*/
	return exp(x)
}
@soypat soypat closed this as completed in 8e68659 Jul 17, 2022
@soypat
Copy link
Collaborator

soypat commented Jul 17, 2022

Hey sorry for the long wait, not sure how this slipped my radar. I've added a fix to exclude all assembly from tinygo builds. Let me know if this solves your issue!

@soypat soypat reopened this Jul 17, 2022
@soypat
Copy link
Collaborator

soypat commented Aug 19, 2024

Fixed in latest version v1.11.0- the Go tool was not picking up v1.11 tag because it was missing the minor version to qualify as semantic versioning. Running go get -u gihub.com/chewxy/math32@latest in a project should bring it this latest version.

@soypat soypat closed this as completed Aug 19, 2024
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