-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented build using meson backend (#189)
- Loading branch information
Showing
22 changed files
with
487 additions
and
358 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.github/* export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ fsps_version.py | |
.vscode | ||
*.dll | ||
.libs | ||
demos/figures | ||
demos/figures | ||
.mesonpy* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
project( | ||
'fsps', | ||
'c', 'cpp', 'fortran', | ||
version: run_command( | ||
['python3', 'tools/version.py'], | ||
check : true | ||
).stdout().strip(), | ||
default_options: ['warning_level=0', 'optimization=3'], | ||
meson_version: '>=0.63.0' | ||
) | ||
|
||
# Enable fortran and check arguments | ||
# add_languages('fortran', native: false) | ||
ff = meson.get_compiler('fortran') | ||
f_args = ff.get_supported_arguments('-Wno-conversion', '-cpp', '-fPIC') | ||
add_project_arguments(f_args, language: 'fortran') | ||
|
||
# Find and link the quadmath library on Windows | ||
if host_machine.system() == 'windows' | ||
cc = meson.get_compiler('c') | ||
quadmath_dep = cc.find_library('quadmath', required: false) | ||
if quadmath_dep.found() | ||
add_project_link_arguments('-lquadmath', language: ['c', 'cpp', 'fortran']) | ||
endif | ||
endif | ||
|
||
# Check to see if the submodule is initialized | ||
fs = import('fs') | ||
if not fs.exists('src/fsps/libfsps/src/sps_vars.f90') | ||
error('It looks like FSPS is not included in your source distribution. If you\'re installing using git, don\'t forget to include the submodules using a recursive clone or by running: \ngit submodule update --init') | ||
endif | ||
|
||
# Python setup | ||
py_mod = import('python') | ||
py3 = py_mod.find_installation('python3') | ||
|
||
# Handle distribution | ||
meson.add_dist_script('tools/dist.py') | ||
|
||
subdir('src/fsps') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import nox | ||
|
||
ALL_PYTHON_VS = ["3.8", "3.9", "3.10"] | ||
|
||
|
||
def _run_with_sps_home(session, *args, **kwargs): | ||
sps_home = os.environ.get( | ||
"SPS_HOME", Path(__file__).parent / "src" / "fsps" / "libfsps" | ||
) | ||
kwargs["env"] = dict(kwargs.get("env", {}), SPS_HOME=str(sps_home)) | ||
return session.run(*args, **kwargs) | ||
|
||
|
||
@nox.session(python=ALL_PYTHON_VS) | ||
def tests(session): | ||
session.install(".[test]") | ||
_run_with_sps_home(session, "python", "tests/simple.py") | ||
_run_with_sps_home( | ||
session, | ||
"python", | ||
"-m", | ||
"pytest", | ||
"-n", | ||
"2", | ||
"--durations=0", | ||
"-v", | ||
"tests/tests.py", | ||
) | ||
|
||
|
||
@nox.session(python=ALL_PYTHON_VS) | ||
def options(session): | ||
session.install( | ||
".[test]", env={"FFLAGS": "-DMIST=0 -DPADOVA=1 -DMILES=0 -DBASEL=1"} | ||
) | ||
_run_with_sps_home(session, "python", "tests/options.py") |
Oops, something went wrong.