Minh Nguyen wrote: > Hi folks, > > When reviewing or updating packages on t2.math, I source the compiler > as GCC 4.4.1 with the Sun linker by putting the following line in my > ".profile": > > source /usr/local/gcc-4.4.1-sun-linker/gcc441sun # Sun linker/asembler > > But if I'm porting packages to Solaris, is there an equivalent > sourcing line I can put in my ".profile" that picks up the Sun > compiler? I would like to know if there's a way to switch between > compiling with GCC and the Sun compiler on t2.math. > There are two answers to this - a short one and a long one.
SHORT ANSWER ************* Simply having: export PATH=/opt/SUNWspro/bin:/usr/local/bin2:/usr/bin:/usr/ccs/bin:/usr/local/bin:/usr/sfw/bin:/bin:/usr/sbin unset SAGE_FORTRAN unset SAGE_FORTRAN_LIB would probably work. That would replace the path to gcc with the path to the Sun compiler. There should be no need for any of this SAGE_FORTRAN and SAGE_FORTRAN_LIB. LONG ANSWER ************* When an account is created on 't2', the paths and environment variables are set up to make building Sage as easy as possible. Michael had set these up before and I was a bit reluctant to change them, so things suddenly stopped working for people. However, the default setup on 't2' is nothing like what a user would get if he installed Solaris on his own machine. My personal preference would that there was no default path other than the one set up when Solaris is installed, which I think is probably just /usr/bin. So if a user logged in and typed 'gcc' he would get 'command not found' In other words, an intelligent user set up everything for himself, which would give him ultimate control, BUT would require ultimate understanding. But users are going to need to do this on Solaris machines, as the default setup is not as 'friendly' as linux. Sun have always considered backward compatibility very important, which means some of the commands a bit dumb compared to what linux users are used to. Some common commands are not in the default path, since they never were in Solaris 20 years ago. There are a few things done on 't2' to make building Sage a bit easier, which would not be done by default, and which I think would be best removed. There are several problems which would hit someone trying to build Sage on a 'virgin' Solaris machine. (I set such a machine of my own up for Juanjo so he could test ECL on it. He managed to work around a limitation in Sun's 'make' command, so ECL does not need GNU make). 1) There is no 'make' of any sort in the path, but there is a 'make' on the disk. That 'make' command (in /usr/ccs/bin/) is not a GNU make and would not be any use for building Sage. 2) There is no C compiler on the system in ones path, though there is an old version of gcc in /usr/sfw/bin 3) The version of tar supplied by Sun would not be suitable, as a few bits of the Sage tarball are making use of GNU extensions to tar. Though there is a version of GNU tar called /usr/sfw/bin/gtar, which is suitable. 4) The 'patch' command would probably not do what you want. It would not understand the patches linux users produce. I've carefully tweaked the paths and environment variables (things like SAGE_FORTRAN etc) to make life easier. In many ways it would be better if people manually set up their own paths as needed. A list (possibly not exhaustive) of things they would need to do would be: * Add the path to a compiler of some sort in their path (/opt/SUNWspro/bin would be needed for the Sun compiler) * Get a copy of 'make' suitable for building Sage (there is one, called /usr/sfw/bin/gmake, which comes with Solaris) * Get a copy of 'tar' suitable for building Sage (there is one /usr/sfw/bin/gtar on a default install of Solaris). * Add the paths to programs like 'ar', nm etc they will need. These are in /usr/ccs/bin Most open-source programs will not build with Sun's 'make' command, so I normally just type 'gmake' instead, since /usr/sfw/bin/ is in my path. That will not work in Sage, as there are bits in Sage which call 'make' directly. How do people feel about I change the config on 't2' to be like a standard 'virgin' install of Solaris? I'd leave all the programs you need on the disk, (nothing deleted) but they would not be in your path. So you would need to add them manually. Note in particular, the programs in /usr/local/bin2 are links to GNU versions of the tools, which would not normally be found under this name. By default, when a user is created on a Solaris machine, his shell is /bin/sh which is not bash. They would need to type 'bash' to get a bash shell, I certainly see some advantages in making 't2' more like a standard Solaris system, but it would present some hurdles people would have to overcome. I would of course respond to any queries. Dave --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---