Skip to content
This repository was archived by the owner on Apr 13, 2021. It is now read-only.

Conversation

@imh
Copy link
Contributor

@imh imh commented Jul 10, 2015

They still error if called, but now they'll error in a way that says "Hey look at me. I'm a stupid function that allocates a few dozen kB of stack even though I hardly need any of it."

@imh
Copy link
Contributor Author

imh commented Jul 10, 2015

does this seem like a reasonable thing to do while we think about a better long term solution?

@fnoble @kovach @mookerji

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libswiftnav%20Pull%20Requests/234/
Test PASSed.

@mookerji
Copy link
Contributor

Hmmmm, my vote would be a compiler macro for controlling this, probably based on compiler architecture. My concern is that this makes libswiftnav less portable, and also isn't configurable. I currently I don't exactly know what the conventions are within lapack (or similar libraries), for this sort of thing, but I'm sure @fnoble @henryhallam @gsmcmullin have good ideas.

@henryhallam
Copy link
Contributor

agreed that this should be controlled by a compiler macro via #ifdef / #else but I would prefer that that macro be explicitly defined in our makefile rather than based on compiler architecture. That way we could still build the stack-hogging version for ARM if we had an ARM with more RAM, and we can also build the small-stack version for x86 for SITL testing.

@mookerji
Copy link
Contributor

Does chibiOS have a notion of a ulimit? If chibiOS (or whatever we're using) has a memory management control that'll death scream if a function allocates insane memory, that could also work #DoesNotKnowAnythingAboutRTOSes.

@henryhallam
Copy link
Contributor

unfortunately not, there's no proper memory management unit on the Cortex-M4. There is a memory protection unit but its capabilities are limited and we aren't using it at all at the moment.

@imh
Copy link
Contributor Author

imh commented Jul 10, 2015

After talking with @fnoble, I think we should just move away from lapack altogether for embedded linear algebra, since the constraints of an embedded environment are different from what lapack was written for and and now we know which functionality we really need. (We can still build off of BLAS if we need. It doesn't really allocate anything anywhere).

In the meantime, we should just do it more or less the way I did in this PR. I'll change it to using an #ifdef / #else and throw something in the makefile as @henryhallam suggested.

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libswiftnav%20Pull%20Requests/237/
Test PASSed.

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libswiftnav%20Pull%20Requests/239/
Test PASSed.

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libswiftnav%20Pull%20Requests/240/
Test PASSed.

@swiftnav-jenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
http://zazu.ci.swiftnav.com/job/libswiftnav%20Pull%20Requests/283/
Test PASSed.

denniszollo added a commit that referenced this pull request Jul 27, 2015
Disabled the LAPACK functions that take too much memory
@denniszollo denniszollo merged commit 01ff809 into swift-nav:master Jul 27, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants