Skip to content

Commit

Permalink
Build option for perf and not portable
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 12, 2024
1 parent f4cf11d commit a200c0b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
13 changes: 11 additions & 2 deletions doc/build-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,16 @@ There are 3 levels:
```

````{important}
One can activate a performance oriented and not portable build using:
```sh
pip install . -v -C setup-args=-Dnative=true
```
````

````{note}
Recent versions of `pip` allow one to specify different options like so:
Expand All @@ -107,7 +117,6 @@ pip install . -v \
-C setup-args=-Duse-xsimd=false
```
````

Of course, one can also change values of
Expand Down Expand Up @@ -140,8 +149,8 @@ pip install . -v -C setup-args=-Doptimization=2
```{admonition} Advanced compilation configuration
The environment variables `CC`, `CXX`, `CFLAGS`, `CXXFLAGS` and `LDFLAGS`
are honored. So for example, one could compile with
`CXXFLAGS="-march=native -Ofast"`.
are honored. So for example, one could compile with
Note that Fluidsim builds are not sensible to the [`~/.pythranrc` file](pythranrc)!
Expand Down
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,15 @@ print(incdir)'''
)
endif


pythran_complex_hook = get_option('pythran-complex-hook')
if pythran_complex_hook == 'os-dependent'
pythran_complex_hook = host_machine.system() == 'linux'
endif

if get_option('native')
cpp_args_pythran += ['-march=native', '-Ofast']
endif

endif

subdir('fluidsim')
23 changes: 17 additions & 6 deletions meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ option(
value: 'pythran,python,numba',
description:
'pythran,python,numba (default), cython, numpy, numba; ' +
'or comma separated value representing multi-backends'
'or comma separated value representing multi-backends',
)
option(
'native',
type: 'boolean',
value: true,
description: 'Performance oriented and not portable build',
)
option(
'use-xsimd',
type: 'boolean',
value: true,
description: 'Turns on xsimd vectorization'
)
option('use-xsimd', type: 'boolean', value: true, description: 'Use xsimd')
option(
'pythran-complex-hook',
type : 'combo',
choices : ['os-dependent', 'true', 'false'],
value : 'os-dependent',
description: 'Pythran complex_hook option'
type: 'combo',
choices: ['os-dependent', 'true', 'false'],
value: 'os-dependent',
description: 'Pythran complex_hook option',
)

0 comments on commit a200c0b

Please sign in to comment.