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

Can't configure where local picotool binary is #2081

Open
cinderblock opened this issue Nov 21, 2024 · 5 comments
Open

Can't configure where local picotool binary is #2081

cinderblock opened this issue Nov 21, 2024 · 5 comments
Assignees

Comments

@cinderblock
Copy link

I have the picotool binary on my path. cmake (and Findpicotool.cmake) still somehow can't seem to find picotool.

They try to build it, but that fails for other reasons. I don't need to build it. I have a working binary. Why can't it just use it?

I have also tried following picotool's instructions on telling the SDK where the single shared picotool is by setting the picotool_DIR environment variable to the folder that contains the binary (or with -D... to cmake`) and it still tries to build.

I must be doing something silly...

@will-v-pi
Copy link
Contributor

Have you followed the instructions to install picotool in your custom location? The SDK is not actually looking for the picotool binary, it’s looking for the picotoolConfig.cmake file which only gets created when you install picotool.

The develop branch of picotool also has a more fleshed out README on this, so might be worth looking at instead of master if you’re having issues.

Also, as a side note, Findpicotool.cmake isn’t actually used to find picotool, it’s used to build it if it can’t be found - the actual finding is done by the CMake find_package function.

@cinderblock
Copy link
Author

cinderblock commented Nov 21, 2024

I downloaded the binary for my system from github and put it on my path. Yes, that is not the default install instruction, but I didn't want to build picotool for my system because that's broken for other reasons and I just wanted to use a binary. Figured that should be easy.

In the interim, it looks like the default install instructions might automatically download a binary instead of building (if available) so I should give that another go I guess. Still, I feel like being more clear about how picotool's location can be configured should be a little more obvious, no? Are we ignoring the path too?

The picotoolConfig.cmake pointer, and note about the purpose of Findpicotool.cmake (what a name!), is very helpful. I'll take a look at my options. Thank you.

@will-v-pi
Copy link
Contributor

Yes, the binary in the path is not used - CMake’s find_package is just looking for the picotoolConfig.cmake file which then points at the picotoolTarget.cmake file, which points at the picotool binary. Hopefully whatever you downloaded came with those files, so if you just use that downloaded directory as-is and set picotool_DIR to that directory it should work - no need to touch the PATH.

@cinderblock
Copy link
Author

I see those files now. I downloaded this from raspberry pi's repo: https://github.com/raspberrypi/pico-sdk-tools/releases

I'm not seeing how then to put picotool on the path and supporting what cmake expects. I guess I could symlink to the binary, but that gets weird on non-linux systems.

I still think the original requests here stands - or at least to get error messages that more helpfully point to the solution.

Is there some reason we couldn't just specify the binary directly?

@will-v-pi
Copy link
Contributor

If you just add that directory you downloaded to your PATH variable (eg in .bashrc on Linux) then that’s the easiest way to add picotool to your path - you could also symlink it as you suggest.

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