Page 1 of 1

Develop with Intel C++ Compiler

Posted: Mon Nov 11, 2013 1:48 pm
by accounttodelete5123
Hello all :)

I'm a newbie in OS development.
I would like to develop my OS with the Intel C++ Compiler but I have several questions.
How compile my kernel with the Intel compiler ?
Is there a cross compiling mode ?
Else what are the arguments to pass to the compiler ?

Thanks for answer :D

Re: Develop with Intel C++ Compiler

Posted: Mon Nov 11, 2013 6:14 pm
by sortie
I'd like to know your motivation for using the Intel C++ compiler, rather than one of the more suited compilers like GCC. I have a feeling some of your rationale might be misguided.

Re: Develop with Intel C++ Compiler

Posted: Tue Nov 12, 2013 12:08 am
by bwat
sortie wrote:I'd like to know your motivation for using the Intel C++ compiler, rather than one of the more suited compilers like GCC. I have a feeling some of your rationale might be misguided.
Which means the OP didn't ask the question you wanted to answer.

If you can state that GCC is "more suited" then you know the answers to at least some of the OP's questions. Couldn't you please answer them? There's others interested in the answers as well.

Re: Develop with Intel C++ Compiler

Posted: Tue Nov 12, 2013 11:43 am
by Gigasoft
Compiler options are listed here: http://software.intel.com/sites/product ... r/cpp-lin/

Use /Gs with a high value to prevent calls to __chkstk. /Qfreestanding (Windows) or -ffreestanding (Linux) will prevent all standard library calls. For linking, you can use the same procedure as you would use for GCC. The object files are compatible with the GNU linker.

Re: Develop with Intel C++ Compiler

Posted: Tue Nov 12, 2013 3:36 pm
by accounttodelete5123
Thanks for the link and info.
But I have many question... #-o

How to tell the compiler what platform (IA-32, Intel 64...) I am building for ?
/Gs and /Qfreestanding are the only parameter that I need ?
When using the compiler like this (with above flags), it is not cross-compiling, true ?
Are there the same problems that gcc when is not in "cross-compiling mode" ?

I am waiting for answer nd reading the intel compiler doc :D

Thanks for all :)

Re: Develop with Intel C++ Compiler

Posted: Tue Nov 12, 2013 6:17 pm
by sortie
I think you can safely assume that you are not cross-compiling whenever you use the Intel compiler - unless you do some magic. As far as I know, you can't rebuild the compiler and select another target, though perhaps there is some command line option for that. You can probably beat it into submission (like gcc) by passing a bunch of compile options to suppress the undesired behavior, though that's not really cross-compiling.

Unless you have a good reason for using this compiler, I'd recommend against using it because it's a dead end. Unless you have some deal with Intel, you can't retarget the compiler and teach it what your OS is and you can't port it to your OS. This will create an artificial barrier against going self-hosting, which is certainly something to avoid. The fact that the compiler is not free software also means you might make things harder for potential contributors.

Personally, I'd recommend using GCC for osdev work unless you have a good reason not to. :)

@bwat: Dude, what the ****? It's always important to understand someone’s motivation when you are trying to help them.

Re: Develop with Intel C++ Compiler

Posted: Tue Nov 12, 2013 11:47 pm
by bwat
sortie wrote: @bwat: Dude, what the ****? It's always important to understand someone’s motivation when you are trying to help them.
Without knowing the OP's motiviation, you managed to make a clear statement on the relative suitability of GCC and ICC, so it couldn't have been that important.

Re: Develop with Intel C++ Compiler

Posted: Wed Nov 13, 2013 3:03 pm
by accounttodelete5123
At the start, I wanted to use the intel compiler because I think that the intel compiler is the better optimised compiler regard the fact that intel know more than anyone their processors.

Also, I don't plan to make an Unix-like and I think that gcc is less or more linked with the "Unix world".
But, maybe is a bad thing to think that ? #-o

But finally, after reflection, I think that I will use gcc. :mrgreen:

Re: Develop with Intel C++ Compiler

Posted: Wed Nov 13, 2013 3:11 pm
by sortie
If you are willing to accept a minimal number of Unix-isms such as fork and execve and you implement a reasonable subset of the C API, then you can port older GCC versions to your OS. If you also support C++ in addition, then you can port newer GCC versions to your OS. It's actually not that hard to port, compared to other things. Indeed, if you go ahead and modify gcc more heavily, then you don't even need these Unix-isms.

Re: Develop with Intel C++ Compiler

Posted: Sun Dec 01, 2013 4:11 pm
by accounttodelete5123
Thanks for all response :)
I will use gcc as compiler and I will port it to my OS later (if I arrive thus far :D)