Boost logo

Boost-Build :

From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2004-11-08 07:06:52


Vladimir,

I started to add a gfortran.jam into boost/tools/build/v2/tools to add
support for gnu fortran (other fortran's coming soon) but have a problem
that, although I get no error from the bjam engine, it does not compile
the fortran sources. I must be missing soth.... but what ;-? Any ideas
would be appreciated.

In attachment are gfortran.jam and fortran.jam which should go into
boost/tools/build/v2/tools (and once they work I would like your
approval to check them in) and fortran_test which contains some files
that need to be compiled. In this project the c source is compiled and
linked into a shared library. There is no error reported about the
fortran source but it also not compiled.

toon

PS. I have a mimial toolset setup because I want to understand how it
works instead of just trying to change an existing toolset and just
hoping that it works (without understanding what is under the hood).
 --------------000805090307040901020603 Content-Type: application/octet-stream;
name="fortran_test.tgz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="fortran_test.tgz"

[Attachment content not displayed.] --------------000805090307040901020603 Content-Type: text/plain;
name="gfortran.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="gfortran.jam"

# Copyright (C) 2004 Toon Knapen
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)

import toolset : flags ;
import feature ;
import fortran ;

rule init ( version ? : command * : options * )
{
}

rule compile.fortran
{
ECHO "compiling fortran" ;
}

actions compile.fortran
{
gcc -Wall -c -o "$(<)" "$(>)"
}

fortran.register-fortran-compiler gfortran.compile.fortran : FORTRAN : OBJ : <toolset>gfortran ;
 --------------000805090307040901020603 Content-Type: text/plain;
name="fortran.jam"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="fortran.jam"

# Copyright (C) 2004 Toon Knapen
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
# http://www.boost.org/LICENSE_1_0.txt)

import "class" : new ;

import type ;
import generators ;

type.register FORTRAN : f ;

class fortran-compiling-generator : generator
{
rule __init__ ( id : source-types + : target-types + : requirements * : optional-properties * )
{
generator.__init__ $(id) : $(source-types) : $(target-types) : $(requirements) : $(optional-properties) ;
}

rule action-class ( )
{
return compile-action ;
}
}

rule register-fortran-compiler ( id : source-types + : target-types + : requirements * : optional-properties * )
{
local g = [ new fortran-compiling-generator $(id) : $(source-types) : $(target-types) : $(requirements) : $(optional-properties) ] ;
generators.register $(g) ;
}

 --------------000805090307040901020603--


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk