Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

NIOS II library

Hello all,

well, it´s a very newbie question, so sory.

I´m doing my first software for NIOS II and I noticed that even when I do a "hello world" program the compiler builds the software with all ANSI C libraries, but I´m not using the most of them. The problem is that it consumes a lot of memory. So, can I do something for the compiler to take only the libraries the current program uses?

Thanks a lot,

Vinícius.

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I hope this puts you in the right direction. but it's not a complete answer.

    Try optimising the code, like -O3??

    Someone else can comment also. I think it's been discussed in another thread.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi vgarcia!!

    Let's try this in NiosII IDE:

    1) click right on "hello_world_syslib" project and click "Properties"

    2) in "C/C++ Build" panel, set the "Optimization Level" to "Optimize most (-O3)" and define the following symbol for the "Preprocessor": ALT_NO_INSTRUCTION_EMULATION

    3) in "System Library" panel, set "Periodic system timer" to "none"; set "Max file descriptor" to 4; uncheck "Clean exit"; check "Reduced device drivers"; check "Small C Library

    4) click right on "hello_world" project and repeat step 2

    5) build all and have fun! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif

    Bye