Skip to content

How to control the precision of dependency libraries in top-level projects? #950

@zoziha

Description

@zoziha

Description

Fortran's default floating point precision is single precision, and the most used data type in scientific computing is floating point.

There are quite a few libraries (e.g. slsqp) that provide macro-based precision options, which seems very useful when developers don't want to write multiple precision versions of routines and polymorphic interfaces.

Is it possible to have macro definitions for dependency libraries in top-level projects, e.g.:

[features]
slsqp = ['REAL32']
minpack = ['REAL32']
M_stopwatch = ['_WIN32']

This also has a positive effect on the fpm library ecology.

Possible Solution

Style 1:

[dependencies]
slsqp.git = 'https://github.com/jacobwilliams/slsqp'
slsqp.tag = '1.4.1'
slsqp.features = ['REAL32']

Style 2:

[dependencies]
slsqp = { git = 'https://github.com/jacobwilliams/slsqp', tag = '1.4.1', features = ['REAL32'] }

Style 3:

[features]
slsqp = ['REAL32']

[dependencies]
slsqp.git = 'https://github.com/jacobwilliams/slsqp'
slsqp.tag = '1.4.1'

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions