Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
12748 Discussions

Trouble compiling Syslib of NIOS2 App

Altera_Forum
Honored Contributor II
1,295 Views

Hi, 

 

a while ago I created a little design containing a NIOS 2 and some peripherals (using Quartus II 9.0 and the SOPC Builder on Windows XP Pro / 32 Bit) . I also wrote some programs to learn how to access the hardware (hello world, letting some LEDs blink, etc.). Everything just worked fine (using NIOS II 9.0 IDE). 

Now (a couple of months later) I got back to this project and tried to compile my (once running) apps (using the same Software). The only thing I get now from the IDE, is an error during the build process (of the Syslib): 

"Compiling crt0.S... 

nios2-elf-gcc: argument to `-I' is missing" 

 

Using the Nios II Command Shell, I was able to get some more information 

echo Compiling crt0.S... mkdir -p ./ nios2-elf-gcc -MD -c -DSYSTEM_BUS_WIDTH=32 -DALT_NO_INSTRUCTION_EMULATION -I.. -Isystem_description -I I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip ... It seems that the second "-I" option does not have an argument (obviously the problem). 

But how can I fix that? At the moment it seems to me, that this is hidden somewhere in some makefile (or a problem with an environment variable?!), but I'm lost tracking this issue down... 

I tried to understand the build process, but I'm no expert when it comes to makefiles and all the things used to build the executable. 

 

I also tried uninstalling the whole thing (Nios 2 IDE, Quartus, etc.), cleaning the Registry and reinstalling. Still it doesn't compile... 

I would really appreciate some help. 

 

Thanks...
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
567 Views

Hi eligs, 

-I must be followed by a directory name. 

Maybe you move some files of your project to a different directory? I read somewhere that directory names with spaces are not allowed.
0 Kudos
Altera_Forum
Honored Contributor II
567 Views

Thanks for your answer, Cris72. 

I considered this, but unfortunatly there are no spaces in the path of the project or the altera installation. 

These locations would be "d:\projekte\axe_work\sw\ etc..." for the project files and "d:\altera\90\ etc..." for the altera environment. 

 

If there was a space in the path name, wouldn't the process attempt to access a part of a path instead of nothing (e.g. "/path toproject/" could become "-Ipath -Itoproject") ? 

As I see now, the 3rd -I argument doesn't seem to have the "-" in front of it ... how does that fit at all?
0 Kudos
Altera_Forum
Honored Contributor II
567 Views

Sorry eligs, I thought your problem was with the -I.. option. 

I missed that point because the one which generates your problem is exacly at the beginning of the line in my display, so I didn't recognize there was no "-". 

Anyway I see there is a line break between the previous -I (which has no path specified) and the problematic "I" without "-". 

Is this line break normal or it simply occurred during copy and paste? 

Could the problem be due to the previous -I without path? 

 

Cris
0 Kudos
Altera_Forum
Honored Contributor II
567 Views

What I posted is the 1:1 ouput of "make -n" 

The linebreak is already in there. 

It is also there for the following commands (which are not executed due to the error): 

echo Compiling alt_alarm_start.c... mkdir -p obj/ nios2-elf-gcc -xc -MD -c -DSYSTEM_BUS_WIDTH=32 -DALT_NO_INSTRUCTION_EMULATION -I.. -Isystem_description -I I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_pio/inc -I/cygdrive/d/projekte/axe_work/rtl/eth_ocm/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/eth_ocm/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25int/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25int/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_epcs_flash_controller/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_epcs_flash_controller/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25ext/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25ext/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_uart/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_uart/inc -I/cygdrive/d/altera/90/ip/altera/nios2_ip/altera_nios2/HAL/inc -I/cygdrive/d/altera/90/nios2eds/components/altera_hal/HAL/inc -DALT_SINGLE_THREADED -DALTERA_TRIPLE_SPEED_MAC -D__hal__ -pipe -DALT_DEBUG -O0 -g -Wall -mhw-mul -mno-hw-mulx -mno-hw-div -o obj/alt_alarm_start.o /cygdrive/d/altera/90/nios2eds/components/altera_hal/HAL/src/alt_alarm_start.c echo Compiling alt_busy_sleep.c... mkdir -p obj/ nios2-elf-gcc -xc -MD -c -DSYSTEM_BUS_WIDTH=32 -DALT_NO_INSTRUCTION_EMULATION -I.. -Isystem_description -I I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_pio/inc -I/cygdrive/d/projekte/axe_work/rtl/eth_ocm/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/eth_ocm/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25int/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25int/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_epcs_flash_controller/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_epcs_flash_controller/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25ext/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25ext/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_uart/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_uart/inc -I/cygdrive/d/altera/90/ip/altera/nios2_ip/altera_nios2/HAL/inc -I/cygdrive/d/altera/90/nios2eds/components/altera_hal/HAL/inc -DALT_SINGLE_THREADED -DALTERA_TRIPLE_SPEED_MAC -D__hal__ -pipe -DALT_DEBUG -O0 -g -Wall -mhw-mul -mno-hw-mulx -mno-hw-div -o obj/alt_busy_sleep.o /cygdrive/d/altera/90/ip/altera/nios2_ip/altera_nios2/HAL/src/alt_busy_sleep.c echo Compiling alt_close.c... mkdir -p obj/ nios2-elf-gcc -xc -MD -c -DSYSTEM_BUS_WIDTH=32 -DALT_NO_INSTRUCTION_EMULATION -I.. -Isystem_description -I I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_timer/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_pio/inc -I/cygdrive/d/projekte/axe_work/rtl/eth_ocm/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/eth_ocm/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25int/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25int/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_epcs_flash_controller/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_epcs_flash_controller/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25ext/HAL/inc -I/cygdrive/d/projekte/axe_work/rtl/AX25ext/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_uart/HAL/inc -I/cygdrive/d/altera/90/ip/altera/sopc_builder_ip/altera_avalon_uart/inc -I/cygdrive/d/altera/90/ip/altera/nios2_ip/altera_nios2/HAL/inc -I/cygdrive/d/altera/90/nios2eds/components/altera_hal/HAL/inc -DALT_SINGLE_THREADED -DALTERA_TRIPLE_SPEED_MAC -D__hal__ -pipe -DALT_DEBUG -O0 -g -Wall -mhw-mul -mno-hw-mulx -mno-hw-div -o obj/alt_close.o /cygdrive/d/altera/90/nios2eds/components/altera_hal/HAL/src/alt_close.c echo Compiling alt_dcache_flush.c... and so on... Could it be connected to the files being included for accessing the HAL ? 

Where does this "search and generate the nios-elf-gcc command"-process take place?
0 Kudos
Altera_Forum
Honored Contributor II
567 Views

Ok, I think I solved it. 

The problem was a hardware component added to the design (whose VHDL code compiles without problems). But there was an error in the makefile (of the HAL library) of that component, adding " \ " to the include path. 

I did not think of this at first because adding this hw component was one of the last things I did before abandoning the project some months ago. Even if there was no change to the C sourcecode, this thing really screwed it up. 

 

Anyway thanks for scrutinizing the make dump I posted, it helped me to begin searching in the right place!
0 Kudos
Reply