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

[HELP] dafault math.h #15292

Open
1 task done
geniusdo opened this issue Dec 19, 2024 · 5 comments
Open
1 task done

[HELP] dafault math.h #15292

geniusdo opened this issue Dec 19, 2024 · 5 comments
Labels
Community: Question Further information is requested

Comments

@geniusdo
Copy link
Contributor

Description

How to replace the default math.h. I tried to use libmcs as my default math lib. I have to directly include "libmcs/math.h" to use libmcs math lib. But I want to directly include math.h in libmcs. I tried the method mentioned in #1503. However when I include math.h it still links to the math lib supplied by my toolchain. Any idea to achieve that?

Verification

  • I have verified before submitting the report.
@geniusdo geniusdo added the Community: Question Further information is requested label Dec 19, 2024
@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Dec 19, 2024

you can include math.h directly, build system already setup the search path automatically:
https://github.com/apache/nuttx/blob/master/tools/Config.mk#L760-L775

@geniusdo
Copy link
Contributor Author

I am using cxx build. It seems cmath still call math lib from my toolchain

@xiaoxiang781216
Copy link
Contributor

which phase(compe v.s. link) do you reference?

@geniusdo
Copy link
Contributor Author

During compile phase. I want cmath to use math from libmcs. Idk how it auto links to toolchain math.
image

@xiaoxiang781216
Copy link
Contributor

it's strange, you need:

  1. Issue make V=1 to extract the command line
  2. Issue the command line with -E and check the preprocessed output file to know why the wrong file get included

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants