Update of /cvsroot/boost/boost/tools/build/v2/tools
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24332
Modified Files:
fortran.jam
Added Files:
pathscale.jam pgi.jam mipspro.jam
Log Message:
Add Fortran 90 support to fortran.jam. Added new pathscale, pgi and mipspro
toolsets.
--- NEW FILE: pathscale.jam ---
# Copyright 2006 Noel Belcourt
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import property ;
import generators ;
import toolset : flags ;
import feature ;
import type ;
import common ;
import fortran ;
import fortran90 ;
feature.extend toolset : pathscale ;
toolset.inherit pathscale : unix ;
generators.override pathscale.prebuilt : builtin.lib-generator ;
generators.override pathscale.searched-lib-generator : searched-lib-generator ;
# Documentation and toolchain description located
# http://www.pathscale.com/docs.html
rule init ( version ? : command * : options * )
{
# local condition = [ common.check-init-parameters pathscale : version
$(version) ] ;
command = [ common.get-invocation-command pathscale : mpicxx : $(command) ] ;
common.handle-options pathscale : $(condition) : $(command) : $(options) ;
toolset.flags pathscale.compile.fortran90 OPTIONS $(condition) :
[ feature.get-values <fflags> : $(options) ] : unchecked ;
command_c = $(command_c[1--2]) $(command[-1]:B=mpicxx) ;
toolset.flags pathscale CONFIG_C_COMMAND $(condition) : $(command_c) ;
# fortran support
local f-command = [ common.get-invocation-command pathscale : mpif77 :
$(command) ] ;
local command_f = $(command_f[1--2]) $(f-command[-1]:B=pathf77) ;
local command_f90 = $(command_f[1--2]) $(f-command[-1]:B=pathf90) ;
toolset.flags pathscale CONFIG_F_COMMAND $(condition) : $(command_f) ;
toolset.flags pathscale CONFIG_F90_COMMAND $(condition) : $(command_f90) ;
}
# Declare generators
# generators.register-c-compiler pathscale.compile.c : C : OBJ :
<toolset>pathscale ;
# generators.register-c-compiler pathscale.compile.c++ : CPP : OBJ :
<toolset>pathscale ;
# generators.register-fortran-compiler pathscale.compile.fortran : FORTRAN :
OBJ ; # : <toolset>pathscale ;
generators.register-fortran90-compiler pathscale.compile.fortran90 : FORTRAN90
: OBJ ; # : <toolset>pathscale ;
# Declare flags and actions for compilation
flags pathscale.compile OPTIONS <debug-symbols>on : -g ;
flags pathscale.compile OPTIONS <profiling>on : -pg ;
flags pathscale.compile OPTIONS <optimization>speed : -O2 ;
flags pathscale.compile OPTIONS <optimization>space : -Os ;
flags pathscale.compile OPTIONS <address-model>32 : -m32 ;
flags pathscale.compile OPTIONS <address-model>64 : -m64 ;
flags pathscale.compile OPTIONS <warnings>off : -woffall ;
flags pathscale.compile OPTIONS <warnings>on : -Wall ;
flags pathscale.compile OPTIONS <warnings>all : -Wall ;
# flags pathscale.compile OPTIONS <threading>multi : -mt ;
flags pathscale.compile.c++ OPTIONS <inlining>off : -noinline ;
flags pathscale.compile OPTIONS <cflags> ;
flags pathscale.compile.c++ OPTIONS <cxxflags> ;
flags pathscale.compile DEFINES <define> ;
flags pathscale.compile INCLUDES <include> ;
flags pathscale.compile.fortran OPTIONS <fflags> ;
flags pathscale.compile.fortran90 OPTIONS <fflags> ;
actions compile.c
{
"$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
actions compile.c++
{
"$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
actions compile.fortran
{
"$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
rule compile.fortran90 ( targets * : sources * : properties * )
{
# the space rule inserts spaces between targets and it's necessary
SPACE on $(targets) = " " ;
# Serialize execution of the compile.fortran90 action
# F90 source must be compiled in a particular order so we
# serialize the build as a parallel F90 compile might fail
JAM_SEMAPHORE on $(targets) = <s>pathscale-f90-semaphore ;
}
actions compile.fortran90
{
"$(CONFIG_F90_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -module
$(<[1]:D) -c -o "$(<)" "$(>)"
}
# Declare flags and actions for linking
flags pathscale.link OPTIONS <debug-symbols>on : -g ;
# Strip the binary when no debugging is needed
flags pathscale.link OPTIONS <debug-symbols>off : -g0 ;
flags pathscale.link OPTIONS <profiling>on : -pg ;
# flags pathscale.link OPTIONS <threading>multi : -mt ;
flags pathscale.link OPTIONS <linkflags> ;
flags pathscale.link LINKPATH <library-path> ;
flags pathscale.link FINDLIBS-ST <find-static-library> ;
flags pathscale.link FINDLIBS-SA <find-shared-library> ;
flags pathscale.link LIBRARIES <library-file> ;
flags pathscale.link LINK-RUNTIME <runtime-link>static : static ;
flags pathscale.link LINK-RUNTIME <runtime-link>shared : dynamic ;
flags pathscale.link RPATH <dll-path> ;
# On gcc, there are separate options for dll path at runtime and
# link time. On Solaris, there's only one: -R, so we have to use
# it, even though it's bad idea.
flags pathscale.link RPATH <xdll-path> ;
rule link ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
actions link bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)"
"$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST)
-B$(LINK-RUNTIME)
}
# Slight mods for dlls
rule link.dll ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
actions link.dll bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)"
-h$(<[1]:D=) -G "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic
-l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
}
# Declare action for creating static libraries
actions piecemeal archive
{
"$(CONFIG_COMMAND)" -ar -o "$(<)" "$(>)"
}
--- NEW FILE: pgi.jam ---
# Copyright Noel Belcourt 2007.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import property ;
import generators ;
import os ;
import toolset : flags ;
import feature ;
import fortran ;
import type ;
import common ;
feature.extend toolset : pgi ;
toolset.inherit pgi : unix ;
generators.override pgi.prebuilt : builtin.lib-generator ;
generators.override pgi.searched-lib-generator : searched-lib-generator ;
# Documentation and toolchain description located
# http://www.pgroup.com/resources/docs.htm
rule init ( version ? : command * : options * )
{
local condition = [ common.check-init-parameters pgi : version $(version) ] ;
local l_command = [ common.get-invocation-command pgi : pgCC : $(command) ] ;
common.handle-options pgi : $(condition) : $(l_command) : $(options) ;
command_c = $(command_c[1--2]) $(l_command[-1]:B=cc) ;
toolset.flags pgi CONFIG_C_COMMAND $(condition) : $(command_c) ;
flags pgi.compile DEFINES $(condition) :
[ feature.get-values <define> : $(options) ] : unchecked ;
# set link flags
flags pgi.link FINDLIBS-ST : [
feature.get-values <find-static-library> : $(options) ] : unchecked ;
flags pgi.link FINDLIBS-SA : [
feature.get-values <find-shared-library> : $(options) ] : unchecked ;
}
# Declare generators
generators.register-c-compiler pgi.compile.c : C : OBJ : <toolset>pgi ;
generators.register-c-compiler pgi.compile.c++ : CPP : OBJ : <toolset>pgi ;
generators.register-fortran-compiler pgi.compile.fortran : FORTRAN : OBJ :
<toolset>pgi ;
# Declare flags and actions for compilation
flags pgi.compile OPTIONS <link>shared : -shared -fpic ;
flags pgi.compile OPTIONS <debug-symbols>on : -g ;
flags pgi.compile OPTIONS <profiling>on : -xprofile=tcov ;
flags pgi.compile OPTIONS <optimization>speed : -fast -Mx,8,0x10000000 ;
flags pgi.compile OPTIONS <optimization>space : -xO2 -xspace ;
flags pgi.compile OPTIONS <threading>multi : -mt ;
flags pgi.compile OPTIONS <warnings>off : -Minform=severe ;
flags pgi.compile OPTIONS <warnings>on : -Minform=warn ;
flags pgi.compile.c++ OPTIONS <inlining>off : -INLINE:none ;
flags pgi.compile OPTIONS <cflags> ;
flags pgi.compile.c++ OPTIONS <cxxflags> ;
flags pgi.compile DEFINES <define> ;
flags pgi.compile INCLUDES <include> ;
flags pgi.compile.fortran OPTIONS <fflags> ;
actions compile.c
{
"$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
actions compile.c++
{
"$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
actions compile.fortran
{
"$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
# Declare flags and actions for linking
flags pgi.link OPTIONS <debug-symbols>on : -g ;
# Strip the binary when no debugging is needed
flags pgi.link OPTIONS <debug-symbols>off : -s ;
flags pgi.link OPTIONS <profiling>on : -xprofile=tcov ;
flags pgi.link OPTIONS <threading>multi : -mt ;
flags pgi.link OPTIONS <linkflags> ;
flags pgi.link LINKPATH <library-path> ;
flags pgi.link FINDLIBS-ST <find-static-library> ;
flags pgi.link FINDLIBS-SA <find-shared-library> ;
flags pgi.link LIBRARIES <library-file> ;
flags pgi.link LINK-RUNTIME <runtime-link>static : static ;
flags pgi.link LINK-RUNTIME <runtime-link>shared : dynamic ;
flags pgi.link RPATH <dll-path> ;
# On gcc, there are separate options for dll path at runtime and
# link time. On Solaris, there's only one: -R, so we have to use
# it, even though it's bad idea.
flags pgi.link RPATH <xdll-path> ;
rule link ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
# reddish can only link statically and, somehow, the presence of -Bdynamic on
the link line
# marks the executable as a dynamically linked exec even though no dynamic
libraries are supplied.
# Yod on redstorm refuses to load an executable that is dynamically linked.
# removing the dynamic link options should get us where we need to be on
redstorm.
# "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)" "$(>)"
"$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST)
-B$(LINK-RUNTIME)
actions link bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)"
"$(>)" "$(LIBRARIES)" -Bstatic -l$(FINDLIBS-ST)
}
# Slight mods for dlls
rule link.dll ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
# "$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)"
-h$(<[1]:D=) -G "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic
-l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
actions link.dll bind LIBRARIES
{
"$(CONFIG_COMMAND)" -shared -fpic $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)"
-o "$(<)" "$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic
-l$(FINDLIBS-ST) -B$(LINK-RUNTIME)
}
actions updated together piecemeal pgi.archive
{
ar -rc$(ARFLAGS:E=) "$(<)" "$(>)"
}
--- NEW FILE: mipspro.jam ---
# Copyright Noel Belcourt 2007.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import property ;
import generators ;
import os ;
import toolset : flags ;
import feature ;
import fortran ;
import type ;
import common ;
feature.extend toolset : mipspro ;
toolset.inherit mipspro : unix ;
generators.override mipspro.prebuilt : builtin.lib-generator ;
generators.override mipspro.searched-lib-generator : searched-lib-generator ;
# Documentation and toolchain description located
# http://www.sgi.com/products/software/irix/tools/
rule init ( version ? : command * : options * )
{
local condition = [
common.check-init-parameters mipspro : version $(version) ] ;
command = [ common.get-invocation-command mipspro : CC : $(command) ] ;
common.handle-options mipspro : $(condition) : $(command) : $(options) ;
command_c = $(command_c[1--2]) $(command[-1]:B=cc) ;
toolset.flags mipspro CONFIG_C_COMMAND $(condition) : $(command_c) ;
# fortran support
local command = [
common.get-invocation-command mipspro : f77 : $(command) : $(install_dir) ]
;
command_f = $(command_f[1--2]) $(command[-1]:B=f77) ;
toolset.flags mipspro CONFIG_F_COMMAND $(condition) : $(command_f) ;
# set link flags
flags mipspro.link FINDLIBS-ST : [
feature.get-values <find-static-library> : $(options) ] : unchecked ;
flags mipspro.link FINDLIBS-SA : [
feature.get-values <find-shared-library> : $(options) ] : unchecked ;
}
# Declare generators
generators.register-c-compiler mipspro.compile.c : C : OBJ : <toolset>mipspro ;
generators.register-c-compiler mipspro.compile.c++ : CPP : OBJ :
<toolset>mipspro ;
generators.register-fortran-compiler mipspro.compile.fortran : FORTRAN : OBJ :
<toolset>mipspro ;
cpu-arch-32 =
<architecture>/<address-model>
<architecture>/<address-model>32 ;
cpu-arch-64 =
<architecture>/<address-model>64 ;
flags mipspro.compile OPTIONS $(cpu-arch-32) : -n32 ;
flags mipspro.compile OPTIONS $(cpu-arch-64) : -64 ;
# Declare flags and actions for compilation
flags mipspro.compile OPTIONS <debug-symbols>on : -g ;
# flags mipspro.compile OPTIONS <profiling>on : -xprofile=tcov ;
flags mipspro.compile OPTIONS <warnings>off : -w ;
flags mipspro.compile OPTIONS <warnings>on : -ansiW ;
flags mipspro.compile OPTIONS <warnings>all : -fullwarn ;
flags mipspro.compile OPTIONS <optimization>speed : -Ofast ;
flags mipspro.compile OPTIONS <optimization>space : -O2 ;
flags mipspro.compile OPTIONS <threading>multi : -mt ;
flags mipspro.compile OPTIONS <cflags> : -LANG:std ;
flags mipspro.compile.c++ OPTIONS <inlining>off : -INLINE:none ;
flags mipspro.compile.c++ OPTIONS <cxxflags> ;
flags mipspro.compile DEFINES <define> ;
flags mipspro.compile INCLUDES <include> ;
flags mipspro.compile.fortran OPTIONS <fflags> ;
actions compile.c
{
"$(CONFIG_C_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
actions compile.c++
{
"$(CONFIG_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
actions compile.fortran
{
"$(CONFIG_F_COMMAND)" $(OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)"
"$(>)"
}
# Declare flags and actions for linking
flags mipspro.link OPTIONS <debug-symbols>on : -g ;
# Strip the binary when no debugging is needed
# flags mipspro.link OPTIONS <debug-symbols>off : -s ;
# flags mipspro.link OPTIONS <profiling>on : -xprofile=tcov ;
# flags mipspro.link OPTIONS <threading>multi : -mt ;
flags mipspro.link OPTIONS $(cpu-arch-32) : -n32 ;
flags mipspro.link OPTIONS $(cpu-arch-64) : -64 ;
flags mipspro.link OPTIONS <linkflags> ;
flags mipspro.link LINKPATH <library-path> ;
flags mipspro.link FINDLIBS-ST <find-static-library> ;
flags mipspro.link FINDLIBS-SA <find-shared-library> ;
flags mipspro.link LIBRARIES <library-file> ;
flags mipspro.link LINK-RUNTIME <runtime-link>static : static ;
flags mipspro.link LINK-RUNTIME <runtime-link>shared : dynamic ;
flags mipspro.link RPATH <dll-path> ;
rule link ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
actions link bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)"
"$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST)
-B$(LINK-RUNTIME)
}
# Slight mods for dlls
rule link.dll ( targets * : sources * : properties * )
{
SPACE on $(targets) = " " ;
}
actions link.dll bind LIBRARIES
{
"$(CONFIG_COMMAND)" $(OPTIONS) -L"$(LINKPATH)" -R"$(RPATH)" -o "$(<)"
"$(>)" "$(LIBRARIES)" -Bdynamic -l$(FINDLIBS-SA) -Bstatic -l$(FINDLIBS-ST)
-B$(LINK-RUNTIME)
}
# Declare action for creating static libraries
actions piecemeal archive
{
ar -cr "$(<)" "$(>)"
}
Index: fortran.jam
===================================================================
RCS file: /cvsroot/boost/boost/tools/build/v2/tools/fortran.jam,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- fortran.jam 24 May 2005 15:27:30 -0000 1.2
+++ fortran.jam 6 Jun 2007 02:46:35 -0000 1.3
@@ -9,12 +9,17 @@
#
import "class" : new ;
+import feature : feature ;
import type ;
import generators ;
import common ;
-type.register FORTRAN : f ;
+type.register FORTRAN : f F for f77 ;
+type.register FORTRAN90 : f90 F90 ;
+
+feature fortran : : free ;
+feature fortran90 : : free ;
class fortran-compiling-generator : generator
{
@@ -30,7 +35,21 @@
generators.register $(g) ;
}
+class fortran90-compiling-generator : generator
+{
+ rule __init__ ( id : source-types + : target-types + : requirements * :
optional-properties * )
+ {
+ generator.__init__ $(id) : $(source-types) : $(target-types) :
$(requirements) : $(optional-properties) ;
+ }
+}
+
+rule register-fortran90-compiler ( id : source-types + : target-types + :
requirements * : optional-properties * )
+{
+ local g = [ new fortran90-compiling-generator $(id) : $(source-types) :
$(target-types) : $(requirements) : $(optional-properties) ] ;
+ generators.register $(g) ;
+}
+
# FIXME: this is ugly, should find a better way (we'd want client code to
# register all generators as "generator.some-rule", not with
"some-module.some-rule".)
IMPORT $(__name__) : register-fortran-compiler : :
generators.register-fortran-compiler ;
-
+IMPORT $(__name__) : register-fortran90-compiler : :
generators.register-fortran90-compiler ;
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs