Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Alternative compilers (suncc/intel cc)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
jabol
Apprentice
Apprentice


Joined: 05 Oct 2005
Posts: 269

PostPosted: Tue May 06, 2008 7:58 pm    Post subject: Alternative compilers (suncc/intel cc) Reply with quote

Hi,
I've been wandering if it's possible to deploy other compilers as system compilers. Now, as it turns out it is possible (ok, not for the system itself, but for many packages). I'd like to start a thread, maybe some of you would find it interesting to play around a bit.
I started with deploying icc, as described in: http://gentoo-wiki.com/HOWTO_Intel_C%2B%2B_Compiler
Then, I thought how about suncc (downloadable for free as sun studio). Well, it seems, it's also possible. Now, here is my version of bashrc:
Code:
[ -r ${ROOT}/etc/portage/package.Xcc ] || return 0
while read -a target; do
  if [ "`echo $target | awk -F : '{print $2}'`" = "${CATEGORY}/${PN}" ]; then
    if [ "`echo $target | awk -F : '{print $1}'`" = "sun" ]; then
      export OCC="suncc"
      export OCXX="suncc"
      export CFLAGS=${SUNCCCFLAGS}
      export CXXFLAGS=${SUNCCCXXFLAGS}
    fi
    if [ "`echo $target | awk -F : '{print $1}'`" = "icc" ]; then
      export OCC="icc"
      export OCXX="icpc"
      export CFLAGS=${ICCCFLAGS}
      export CXXFLAGS=${ICCCXXFLAGS}
    fi
    if [ -r ${ROOT}/etc/portage/package.Xcc-cflags ]; then
      while read target flags; do
        if [ "${target}" = "${CATEGORY}/${PN}" ]; then
          export CFLAGS="$flags"
          export CXXFLAGS="$CFLAGS"
          break
        fi
      done < ${ROOT}/etc/portage/package.Xcc-cflags
    fi

    break
  fi
done < ${ROOT}/etc/portage/package.Xcc

if [ -r ${ROOT}/etc/portage/package.Xcc-cflags ]; then
  while read target flags; do
    if [ "${target}" = "${CATEGORY}/${PN}" ]; then
      export CFLAGS="$flags"
      export CXXFLAGS="$CFLAGS"
      break
    fi
  done < ${ROOT}/etc/portage/package.Xcc-cflags
fi

export CC_FOR_BUILD="${OCC}" # workaround gcc detection function in toolchain-funcs.eclass

package.Xcc looks this way:
Code:
icc:app-office/openoffice
icc:app-arch/unzip
sun:dev-lang/python


now, before running suncc (as you see, I extracted sunstudio in /opt/sunstudio):
Code:
(laptop-awi:~) adam% cat /etc/env.d/05suncc
PATH=/opt/sunstudio/sunstudioceres/bin
ROOTPATH=/opt/sunstudio/sunstudioceres/bin
LDPATH=/opt/sunstudio/sunstudioceres/rtlibs
MANPATH=/opt/sunstudio/sunstudioceres/man


Now the negatives. With suncc you have to disable sandboxing.

I know python works with both icc and suncc, unzip only with icc and I'm just trying openoffice with icc. Well, I'm curious. I've got core2, so possibly icc could do better optimization.

How do you like it?

Maybe after someone already done Gentoo/Opensolaris, now it's time to run opensolaris on top of a linux kernel?


Last edited by jabol on Tue May 06, 2008 8:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43072
Location: 56N 3W

PostPosted: Tue May 06, 2008 8:01 pm    Post subject: Reply with quote

Moved from Portage & Programming to Unsupported Software.

As alternative compilers are not supported by Gentoo
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
mattst88
Developer
Developer


Joined: 28 Oct 2004
Posts: 376

PostPosted: Fri May 09, 2008 11:04 pm    Post subject: Reply with quote

icc cannot compile openoffice. Face it, openoffice can't even compile with -O2 under gcc.

Good to see someone using my Intel Compiler Guide.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum