As you know, I believe the current sage-env could do with a bit of improving in places. William agrees with that too. I have updated it and whilst I don't think its a good idea to print the following out every time sage-env is run, it needs to be documented. One can print it out easily, by changing a character in the script.
Anyway, what do you think of the following, for a set of enviroment variables. If you think there are any extra ones needed, let me know. If you can think of one that can be removed, let me know. My aim would be to set CFLAGS appropriately in each case, so a lot can be removed for spkg-install. Those that only use linux, might not appreciate the need for some of these, but I believe they are all needed to cater for the unusual platforms. If you can view it with a fixed width font, all the better. All lines are less than 80 characters in length Dave ------------------------------ The following environment variables can be set by the user We attempt to set these to sensible values, but especially if using non-GNU tools and/or unsupported operating systems, they may need changing. If you wish to override any then please use: setenv NAME_OF_ENVIROMENT_VARIABLE value_of_environment_variable (if you use tcsh, csh or a similar shell) If you use sh, bash or a similar shell NAME_OF_ENVIROMENT_VARIABLE=value_of_environment_variable export NAME_OF_ENVIROMENT_VARIABLE Unfortunately, currently not all parts of Sage respect these flags, so you may find if you set CC to some compiler, a package will ignore that, and use gcc anyway. Such instances are considered bugs in Sage, and will be addressed as and we are aware of them, and have time to fix them. If you find one, please check the Sage tracker at http://sagetrac.org/sage_trac to see if the bug is known if not, or if you think it needs fixing more urgently please email sage-support, after joining at http://groups.google.co.uk/group/sage-support AR The archiver (e.g. ar, /usr/ccs/bin/ar) (defaults to 'ar') AS The assembler (e.g. as, /usr/ccs/bin/as) (defaults to 'as') CC The C compiler (e.g cc, /opt/SUNWspro/bin/cc etc) (defaults to 'gcc') CXX The C++ compiler (e.g CC, /opt/SUNWspro/bin/CC) (defaults to 'g++') FPIC_FLAG Compiler flag to Generate position-independent code (defaults to '-fPIC' if using GNU tools) INCLUDE_MPFR_PATCH Include a patch which will ensure Sage works on sun4v (i.e. CoolThreads) computers even with a Solaris memset bug - Sun reference CR6507249. See http://sagetrac.org/sage_trac/ticket/6453 (defaults to adding the patch on sun4v machines only) LD The linker (e.g. ld, /usr/ccs/bin/ld or /usr/bin/ld) (defaults to 'ld') LDFLAGS Linker flag(s) (e.g. -D token) (There is no default) LINKER The producer of the linker This will be one of: * GNU * Sun_Solaris * IBM_AIX * HP_HP-UX (This defaults to what is considered correct, but this might not be determined correctly in all cases) The build process MUST know what linker is used as it changes the flags needed, especially those for building shared libraries. When this is correct the values for SHARED_FLAG, S0NAME_FLAG, WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG should be automatically set correctly for you. On Linux systems, there should be no problem and so this will be set correctly for you. On systems such as Solaris, AIX, HP-UX, Tru64 etc GCC can be built many ways and LINKER may be wrong. Please ensure this variable was correctly determined. If you are unsure, please ask on sage-support http://groups.google.co.uk/group/sage-support MAKE The make program (e.g. make or /usr/local/bin/gmake) (defaults to 'make') MAKEFLAGS Flag(s) to make (e.g. -j4). (There is no default) NO_WHOLE_ARCHIVE_FLAG Linker flag to turn off the effects of the WHOLE_ARCHIVE_FLAG linker flag (defaults to '--with-whole-archive' if using GNU tools) OPTIMIZATION_FLAG Compiler flag(s) for optimization. (Defaults to what are considered sensible values given the compiler in use. Note, if you wish to set different flags for the C, C++ and Fortran compilers, then you can use the following three environment variables: * OPTIMIZATION_CFLAG - for the C compiler * OPTIMIZATION_CXXFLAG - for the C++ compiler * OPTIMIZATION_FFLAG - for the Fortran compiler RANLIB Archiver ranlib (e.g. ranlib, /usr/ccs/bin/ranlib etc) (Defaults to 'ranlib') SAGE64 Set to "yes" to build a 64-bit binary (Defaults to "no", but some platforms always build 64-bit binaries, in which case the variable is ignored SAGE_DEBUG Whether debugging informaition is built or not. Set to "yes" or "no". The default is "yes". SAGE64_FLAG Flag for the compilers to build 64-bit binararies (Defaults to '-m64' with Sun or GNU compilers SAGE_FAT_BINARY Make a binary which will run on the widest range of platforms. Usually impacts performance. NOT CURRENTLY IMPLEMENTED. (Defaults to 'no' but is not currently implemented.) SAGE_FORTRAN Path to Fortran compiler (Defaults to 'gfortran') SAGE_FORTRAN_LIB Path to Fortan compilers library (libgfortran.so) if needed. (There is no default) SHARED_FLAG Linker flag for producing a shared object. This is often accepted by compiler and passed to the linker (Defaults to '-shared' if using GNU tools) Often accepted by compiler and passed to the linker Assuming LINKER was correctly determined, this should be correct. SONAME_FLAG Linker flag when creating an ELF shared object, sets the internal name (Defaults to '-soname' if using GNU tools) Assuming LINKER was correctly determined, this should be correct. WHOLE_ARCHIVE_FLAG Linker flag to include every object file in the archive in the link (often accepted by compiler too) (Defaults to '--whole-archieve' if using GNU tools) Assuming LINKER was correctly determined, this should be correct. Notes: 1) For compilers like the Sun compiler on linux, IBM's compiler on linux Intels' on Linux and OS X, which aim to be GNU-like, then the GNU flags will be chosen. Any compiler which #define's __GNUC__ will be considered such a compiler. 2) SHARED_FLAG, S0NAME_FLAG, WHOLE_ARCHIVE_FLAG, NO_WHOLE_ARCHIVE_FLAG and FPIC_FLAG default to -shared, -soname=, --whole-archive, --no-whole-archive and -fPIC with all GNU tools. See the documentation of GCC and the GNU linker (part of binutils) for complete definitions. If any of the above are wrong, or are not optimal, override them by setting the appropiate enviroment variable. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---