Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
975 Views

Where setup compiler mode (e.g. -std=C99 or -std=C11)

Hello, 

 

Where is location in Eclipse NIOS II settings, where compiler mode can be set. 

For example I want to change for more advanced mode (c99 or c11) in order to allow internal loop variable declaration, e.g. 

 

for (int i = 0; i < 10; i++) {} 

 

instead of 

int i; for (i = 0; i < 10; i++) {} 

 

Thanks in advance.
0 Kudos
3 Replies
Highlighted
Valued Contributor III
23 Views

I advanced in my exploration of this issue. 

Here are key points of my investigations: 

  1. Setting, where the compiler options can be specified is located here: Project Properties --> Nios II Application Properties --> User flags: 

  2. Options that contain the '=' sign (e.g. -std=c99) can't be set via GUI ... as interface merely reject such options !!! Perhaps tool bug 

  3. The only location where it can be done (at least I've found only this way) is corresponding section in the makefile (fragment below) 

 

 

# Common arguments for ALT_CFLAGSs 

APP_CFLAGS_DEFINED_SYMBOLS := 

APP_CFLAGS_UNDEFINED_SYMBOLS := 

APP_CFLAGS_OPTIMIZATION := -O0 

APP_CFLAGS_DEBUG_LEVEL := -g 

APP_CFLAGS_WARNINGS := -Wall 

APP_CFLAGS_USER_FLAGS := -std=c99
0 Kudos
Highlighted
Valued Contributor III
23 Views

Below are the basic steps for the IPOPT compilation that should work on most systems. For special compilations and for some troubleshooting see Appendix 2.9 and consult the generic COIN-OR help page https://projects.coin-or.org/coinhelp before submitting a ticket or sending a message to the mailing list. 

 

Create a directory where you want to compile IPOPT, for example  

$ mkdir $IPOPTDIR/build  

and go into this direcrory  

$ cd $IPOPTDIR/build 

Note: You can choose any location, including $IPOPTDIR itself, as the location of your compilation. However, on COIN-OR we recommend to keep the source and compiled files separate. 

 

Run the configure script  

$ $IPOPTDIR/configure 

One might have to give options to the configure script, e.g., in order to choose a non-default compiler, or to tell it where some third party code is installed, see Appendix 2.9. 

 

If the last output line reads ``configure: Main configuration of Ipopt successful'' then everything worked fine. Otherwise, look at the screen output, have a look at the config.log output files and/or consult Appendix 2.9. 

 

The default configure (without any options) is sufficient for most users that downloaded the source code for the linear solver. 

 

----
0 Kudos
Highlighted
Valued Contributor III
23 Views

 

--- Quote Start ---  

Below are the basic steps for the IPOPT compilation that should work on most systems. For special compilations and for some troubleshooting see Appendix 2.9 and consult the generic COIN-OR help page https://projects.coin-or.org/coinhelp before submitting a ticket or sending a message to the mailing list .... 

--- Quote End ---  

 

 

Are you sure you aren't mistaken with thread ? 

The question was on how to set compiler options for nios2-elf-g++ compiler that is part of "Nios II Software Build Tools for Eclipse". 

The last one contain already all necessary tools for generating code for nios ii softprocessor. 

What do you mean exactly ? Abandon "Nios II Software Build Tools for Eclipse" and use 3rd part tools ?
0 Kudos