#7818: Update sage-env
------------------------+---------------------------------------------------
Reporter: drkirkby | Owner: drkirkby
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.3.1
Component: porting | Keywords:
Work_issues: | Author: David Kirkby
Upstream: N/A | Reviewer:
Merged: |
------------------------+---------------------------------------------------
Description changed by drkirkby:
Old description:
> This is an update to the sage-env file. It should allow a much improved
> build process, simplifying the code in spkg install files, as much of it
> will be taken care of. The code will also be more portable.
>
> * Little or no need for any SAGE64 rubbish in any spkg-install files.
> The appropriate flag to build 64-bit code is added if SAGE64 is set to
> use.
> * No need to add -Wall or -g, as these are added by default.
> * GNU specific compiler options can be replaced by variables with
> similar names to the GNU ones, making substitution a relatively easy
> task.
> * Will enable code to be much more portable.
>
> The changes mainly affect the 3 variables for compiler flags - CFLAGS,
> CXXFLAGS and FCFLAGS.
>
> The user may set CFLAGS, CXXFLAGS and FCFLAGS, but the following will be
> appended.
>
> == General flags ==
> * The -g option is added to enable debugging unless SAGE_DEBUG is set
> to "no".
> * -Wall is added for gcc, g++ and gfortran.
>
> == 64-bit Flags ==
> If SAGE64 is "yes"
> * -m64 is added for GCC
> * -m64 is added for Sun Studio
> * -q64 is added for IBM's compiler on AIX
> * +DA2.OW is added on HP-UX. (This will not work on Itanium processors
> running on HP-UX. I'll update when I have more information).
>
> A variable CFLAG64 is set to the correct option for building 64-bit
> binaries with the C compiler. So if -m64 is replaced by $CFLAG64, the
> code will work on any C compiler.
>
> (Some compilers may require a different option for C and C++ files. The
> names CXXFLAG64 and FCFLAG64 are reserved for this, but its not suggested
> they are used now)
>
> == C++ library flags ==
> Due to changes in the C++ standard, it is impossible for compiler vendors
> to distribute a C++ runtime library which is both compatible with the old
> standard and the new one. Both HP and Sun use the older library by
> default, and need a switch added to enable the newer libraries, which
> more closely follow the latest C++ standard. See:
>
> http://developers.sun.com/solaris/articles/cmp_stlport_libCstd.html
>
> http://docs.hp.com/en/14487/faq.htm
>
> Therefore
> * If the compiler is Sun Studio, library=stlport4 is added to CXXFLAGS.
> * If the Compiler is HP's on HP-UX, the option -AA is added to CXXFLAGS.
>
> == Shared Library Flags ==
> Five new variables are set in sage-env. These are for building shared
> libraries and take on names very similar to the GNU names for the flags.
>
> ||'''Flag name'''||'''Value with GCC'''||'''Value with Sun Studio'''||
> ||FPIC_FLAG||-fPIC||-xcode=pic32||
> ||SHARED_FLAG||-shared||-G||
> ||SONAME_FLAG||-soname||-h||
>
> A reviewer may notice two further variable names used. These options can
> be linker dependent and will be finalized once some code to detect the
> linker is in place.
>
> == Extension for shared libraries ==
> Many systems have to be linked against a library, who extension changes
> depending on what plaform one is using. A variable
> 'SHARED_LIBRARY_EXTENSION' is set to one of the following:
>
> ||'''Platform'''||'''Value'''||
> ||AIX||a||
> ||Cygwin||dll||
> ||HP-UX||sl||
> ||OS X||dylib||
> ||Anything else (Linux, Solaris etc)||so||
New description:
This is an update to the sage-env file. It should allow a much improved
build process, simplifying the code in spkg install files, as much of it
will be taken care of. The code will also be more portable.
* Little or no need for any SAGE64 rubbish in any spkg-install files. The
appropriate flag to build 64-bit code is added if SAGE64 is set to use.
* No need to add -Wall or -g, as these are added by default.
* GNU specific compiler options can be replaced by variables with similar
names to the GNU ones, making substitution a relatively easy task.
* Will enable code to be much more portable.
The changes mainly affect the 3 variables for compiler flags - CFLAGS,
CXXFLAGS and FCFLAGS.
The user may set CFLAGS, CXXFLAGS and FCFLAGS, but the following will be
appended.
== General flags ==
* The -g option is added to enable debugging unless SAGE_DEBUG is set to
"no".
* -Wall is added for gcc, g++ and gfortran.
== 64-bit Flags ==
If SAGE64 is "yes"
* -m64 is added for GCC
* -m64 is added for Sun Studio
* -q64 is added for IBM's compiler on AIX
* +DA2.OW is added for the PA-RISC architecture on HP-UX
* +DD64 is added for the Itanium architecture on HP-UX
A variable CFLAG64 is set to the correct option for building 64-bit
binaries with the C compiler. So if -m64 is replaced by $CFLAG64, the code
will work on any C compiler.
(Some compilers may require a different option for C and C++ files. The
names CXXFLAG64 and FCFLAG64 are reserved for this, but its not suggested
they are used now)
== C++ library flags ==
Due to changes in the C++ standard, it is impossible for compiler vendors
to distribute a C++ runtime library which is both compatible with the old
standard and the new one. Both HP and Sun use the older library by
default, and need a switch added to enable the newer libraries, which more
closely follow the latest C++ standard. See:
http://developers.sun.com/solaris/articles/cmp_stlport_libCstd.html
http://docs.hp.com/en/14487/faq.htm
Therefore
* If the compiler is Sun Studio, library=stlport4 is added to CXXFLAGS.
* If the Compiler is HP's on HP-UX, the option -AA is added to CXXFLAGS.
== Shared Library Flags ==
Five new variables are set in sage-env. These are for building shared
libraries and take on names very similar to the GNU names for the flags.
||'''Flag name'''||'''Value with GCC'''||'''Value with Sun Studio'''||
||FPIC_FLAG||-fPIC||-xcode=pic32||
||SHARED_FLAG||-shared||-G||
||SONAME_FLAG||-soname||-h||
A reviewer may notice two further variable names used. These options can
be linker dependent and will be finalized once some code to detect the
linker is in place.
== Extension for shared libraries ==
Many systems have to be linked against a library, who extension changes
depending on what plaform one is using. A variable
'SHARED_LIBRARY_EXTENSION' is set to one of the following:
||'''Platform'''||'''Value'''||
||AIX||a||
||Cygwin||dll||
||HP-UX||sl||
||OS X||dylib||
||Anything else (Linux, Solaris etc)||so||
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7818#comment:11>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.