diff --git a/v2/tools/fortran.jam b/v2/tools/fortran.jam index 3915aa68a..37665825e 100644 --- a/v2/tools/fortran.jam +++ b/v2/tools/fortran.jam @@ -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 @@ rule register-fortran-compiler ( id : source-types + : target-types + : requirem 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 ; diff --git a/v2/tools/mipspro.jam b/v2/tools/mipspro.jam new file mode 100644 index 000000000..cad5fc8bb --- /dev/null +++ b/v2/tools/mipspro.jam @@ -0,0 +1,142 @@ +# 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 : $(options) ] : unchecked ; + + flags mipspro.link FINDLIBS-SA : [ + feature.get-values : $(options) ] : unchecked ; +} + +# Declare generators +generators.register-c-compiler mipspro.compile.c : C : OBJ : mipspro ; +generators.register-c-compiler mipspro.compile.c++ : CPP : OBJ : mipspro ; +generators.register-fortran-compiler mipspro.compile.fortran : FORTRAN : OBJ : mipspro ; + +cpu-arch-32 = + / + /32 ; + +cpu-arch-64 = + /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 on : -g ; +# flags mipspro.compile OPTIONS on : -xprofile=tcov ; +flags mipspro.compile OPTIONS off : -w ; +flags mipspro.compile OPTIONS on : -ansiW ; +flags mipspro.compile OPTIONS all : -fullwarn ; +flags mipspro.compile OPTIONS speed : -Ofast ; +flags mipspro.compile OPTIONS space : -O2 ; +flags mipspro.compile OPTIONS multi : -mt ; +flags mipspro.compile OPTIONS : -LANG:std ; +flags mipspro.compile.c++ OPTIONS off : -INLINE:none ; +flags mipspro.compile.c++ OPTIONS ; +flags mipspro.compile DEFINES ; +flags mipspro.compile INCLUDES ; + +flags mipspro.compile.fortran OPTIONS ; + +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 on : -g ; +# Strip the binary when no debugging is needed +# flags mipspro.link OPTIONS off : -s ; +# flags mipspro.link OPTIONS on : -xprofile=tcov ; +# flags mipspro.link OPTIONS multi : -mt ; + +flags mipspro.link OPTIONS $(cpu-arch-32) : -n32 ; +flags mipspro.link OPTIONS $(cpu-arch-64) : -64 ; + +flags mipspro.link OPTIONS ; +flags mipspro.link LINKPATH ; +flags mipspro.link FINDLIBS-ST ; +flags mipspro.link FINDLIBS-SA ; +flags mipspro.link LIBRARIES ; +flags mipspro.link LINK-RUNTIME static : static ; +flags mipspro.link LINK-RUNTIME shared : dynamic ; +flags mipspro.link RPATH ; + +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 "$(<)" "$(>)" +} diff --git a/v2/tools/pathscale.jam b/v2/tools/pathscale.jam new file mode 100644 index 000000000..7921c69f7 --- /dev/null +++ b/v2/tools/pathscale.jam @@ -0,0 +1,151 @@ +# 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 : $(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 : pathscale ; +# generators.register-c-compiler pathscale.compile.c++ : CPP : OBJ : pathscale ; +# generators.register-fortran-compiler pathscale.compile.fortran : FORTRAN : OBJ ; # : pathscale ; +generators.register-fortran90-compiler pathscale.compile.fortran90 : FORTRAN90 : OBJ ; # : pathscale ; + +# Declare flags and actions for compilation +flags pathscale.compile OPTIONS on : -g ; +flags pathscale.compile OPTIONS on : -pg ; +flags pathscale.compile OPTIONS speed : -O2 ; +flags pathscale.compile OPTIONS space : -Os ; +flags pathscale.compile OPTIONS 32 : -m32 ; +flags pathscale.compile OPTIONS 64 : -m64 ; + +flags pathscale.compile OPTIONS off : -woffall ; +flags pathscale.compile OPTIONS on : -Wall ; +flags pathscale.compile OPTIONS all : -Wall ; + +# flags pathscale.compile OPTIONS multi : -mt ; + +flags pathscale.compile.c++ OPTIONS off : -noinline ; + +flags pathscale.compile OPTIONS ; +flags pathscale.compile.c++ OPTIONS ; +flags pathscale.compile DEFINES ; +flags pathscale.compile INCLUDES ; + +flags pathscale.compile.fortran OPTIONS ; +flags pathscale.compile.fortran90 OPTIONS ; + +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) = 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 on : -g ; +# Strip the binary when no debugging is needed +flags pathscale.link OPTIONS off : -g0 ; +flags pathscale.link OPTIONS on : -pg ; +# flags pathscale.link OPTIONS multi : -mt ; +flags pathscale.link OPTIONS ; +flags pathscale.link LINKPATH ; +flags pathscale.link FINDLIBS-ST ; +flags pathscale.link FINDLIBS-SA ; +flags pathscale.link LIBRARIES ; +flags pathscale.link LINK-RUNTIME static : static ; +flags pathscale.link LINK-RUNTIME shared : dynamic ; +flags pathscale.link RPATH ; +# 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 ; + +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 "$(<)" "$(>)" +} diff --git a/v2/tools/pgi.jam b/v2/tools/pgi.jam new file mode 100644 index 000000000..c27d83d48 --- /dev/null +++ b/v2/tools/pgi.jam @@ -0,0 +1,138 @@ +# 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 : $(options) ] : unchecked ; + + # set link flags + flags pgi.link FINDLIBS-ST : [ + feature.get-values : $(options) ] : unchecked ; + + flags pgi.link FINDLIBS-SA : [ + feature.get-values : $(options) ] : unchecked ; +} + +# Declare generators +generators.register-c-compiler pgi.compile.c : C : OBJ : pgi ; +generators.register-c-compiler pgi.compile.c++ : CPP : OBJ : pgi ; +generators.register-fortran-compiler pgi.compile.fortran : FORTRAN : OBJ : pgi ; + +# Declare flags and actions for compilation +flags pgi.compile OPTIONS shared : -shared -fpic ; +flags pgi.compile OPTIONS on : -g ; +flags pgi.compile OPTIONS on : -xprofile=tcov ; +flags pgi.compile OPTIONS speed : -fast -Mx,8,0x10000000 ; +flags pgi.compile OPTIONS space : -xO2 -xspace ; +flags pgi.compile OPTIONS multi : -mt ; + +flags pgi.compile OPTIONS off : -Minform=severe ; +flags pgi.compile OPTIONS on : -Minform=warn ; + +flags pgi.compile.c++ OPTIONS off : -INLINE:none ; + +flags pgi.compile OPTIONS ; +flags pgi.compile.c++ OPTIONS ; +flags pgi.compile DEFINES ; +flags pgi.compile INCLUDES ; + +flags pgi.compile.fortran OPTIONS ; + +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 on : -g ; +# Strip the binary when no debugging is needed +flags pgi.link OPTIONS off : -s ; +flags pgi.link OPTIONS on : -xprofile=tcov ; +flags pgi.link OPTIONS multi : -mt ; +flags pgi.link OPTIONS ; +flags pgi.link LINKPATH ; +flags pgi.link FINDLIBS-ST ; +flags pgi.link FINDLIBS-SA ; +flags pgi.link LIBRARIES ; +flags pgi.link LINK-RUNTIME static : static ; +flags pgi.link LINK-RUNTIME shared : dynamic ; +flags pgi.link RPATH ; + +# 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 ; + +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=) "$(<)" "$(>)" +} +