Forum Discussion
Altera_Forum
Honored Contributor
21 years agoabout compilers
I'm using the nios1 for a mp3-player,I'm building the software, I use the MAD-0.11.0b software package from the internet! when I want to compile it... http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/dry.gif
here is the message: [SOPC Builder]$ ./configure loading cache ./config.cache checking host system type...i686-pc-cygwin checking whether make sets $<MAKE>...<cached> yes checking for gcc...<cached> gcc checking whether the C comiler <gcc >works... no configure: error: installation or configuration problem: C compiler cannot create executables. Does anyone know what should I do next? Thanks very much! Huck11 Replies
- Altera_Forum
Honored Contributor
I think your problem is that you're trying to build this with an x86 compiler (i.e. one targetted at producing PC instructions) which you don't have installed properly, the line
checking host system type...i686-pc-cygwin implies this - Altera_Forum
Honored Contributor
Hi Huck,
> I think your problem is that you're trying to build this with an x86 compiler When you cross-compile and use a vanilla GNU "configure" script, you will normally need to configure with the --host option: $ ./configure --host=nios2-elf But this wil likely cause an error during configuration ... as "nios2" is rarely supported. See the following thread for some ideas: http://www.niosforum.com/forum/index.php?a...=st&f=18&t=2422 (http://www.niosforum.com/forum/index.php?act=st&f=18&t=2422) Regards, --Scott - Altera_Forum
Honored Contributor
Hi Scott,thank you for your help,but I use the nios1 not the nios2!!
So if there is an --host option :./configure --host=nios-elf Now I'm trying to install the "gcc compiler "on my pc,an I right ? Thank you! huck - Altera_Forum
Honored Contributor
If you're using Nios/Classic Nios, you may have better luck finding what you want here (http://sourceforge.net/projects/cdk4nios/).
Regards, - Brendan - Altera_Forum
Honored Contributor
Hi Huck,
> So if there is an --host option :./configure --host=nios-elf Yes, this is the option you will need. The concept is the same: you need to add a "nios" entry to the config.sub script. This is what configure will use when is checks for all of those magic options ;-) Basically, it will attempt to use nios-elf-xxx when performing its tests. E.g. nios-elf-gcc, nios-elf-ld, etc. Once the configure script knows what "basic machine" it's using (and therefore what prefix to use for the binutils/gcc excutables), it will need to know the correct include and library paths. This is the reason you need to set CPPFLAGS and LDFLAGS in your environment. For other architectures, such as powerpc-linux, you normally don't need to do this, but for nios, you most likely will. Since you're using Nios-32 (rather than Nios II), you will probably do well to use the cdk4nios as Brendan suggested ... or bite the bullet and upgrade to Nios II ;-) Good Luck, --Scott - Altera_Forum
Honored Contributor
Hello all my friends:
Thank you for all your helps!~ CDK4NIOS stands for Cross Development Kit for Altera's soft core processor NIOS and should you support with a comprehensive Assembler and C/C++ development environment under Linux. But now I'm using the windows operating system!!! Can I use the CDK4NIOS all the same? - Altera_Forum
Honored Contributor
hi Scott!
>Yes, this is the option you will need. The concept is the same: you need to >add a "nios" entry to the config.sub script. This is the text from the config.sub file: amigaos | amigados) basic_machine=m68k-cbm os=-amigaos ;; amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv The first question is:I dare not to edit the file easily! How can I made the configure script knows what "basic machine" it's using ? >reason you need to set CPPFLAGS and LDFLAGS in your environment Excuse me to ask you:how can I do this? - Altera_Forum
Honored Contributor
Hi Huke,
> How can I made the configure script knows what "basic machine" it's using ? There are three basic things configure needs to know: 1. What cross-tools (e.g.: nios-elf, rather than powerpc-eabi, or arm-thumb-elf, etc) 2. What is the include path for .h files. 3. What is the library path (or libc, etc). To modify the configuration scripts, you may have to do some hard work ... it's not always as straight-forward as the the libosip source tree. Basically, you must read and understand how the configure scripts work, then modify the scripts to support your target environment. > > reason you need to set CPPFLAGS and LDFLAGS in your environment > Excuse me to ask you:how can I do this? Please see the link in my earlier post. > But now I'm using the windows operating system!!! I'm a bit confused here: You want your code to run on a Nios-32 processor that is running uClinux, correct? If this is the case, you surely have uClinux running, no? ... and this means you have a development environment (with headers, libraries, etc) under windows. Regards, --Scott - Altera_Forum
Honored Contributor
Hi scott!
>Add an entry for nios2 for the basic_machine variable. All you need is "nios2" in there ;-) The origin text is amigaunix | amix) basic_machine=m68k-cbm os=-sysv4 then I edit it to: amigaunix | amix) basic_machine=nios os=-sysv4 Am I right?? >I'm a bit confused here: You want your code to run on a Nios-32 processor that >is running uClinux, correct? >If this is the case, you surely have uClinux running, no? ... and this means you >have a development environment (with headers, libraries, etc) under windows I do not have any development environment under windows in fact,I only have the sopc builder shell!! huke regards - Altera_Forum
Honored Contributor
Hi scott!
It seems I must install a uClinux operating system on my windows XP! The nios1 is not running uClinux on itself! I saw the document and they do not said any thing about uClinux. But I get the package from a linux organization,so I need to install the uClinux on my windows XP! Am I right? Thank you very much! huke regard