From 99fdde39d3fe43a40e765335c6443dc04a01b1ee Mon Sep 17 00:00:00 2001 From: pradal Date: Tue, 16 Sep 2025 11:36:44 +0200 Subject: [PATCH] Add options for flang --- conda/conda_build_config.yaml | 2 -- conda/meta.yaml | 6 +++--- native.ini | 3 +++ src/openalea/ratp/meson.build | 7 +++++++ 4 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 conda/conda_build_config.yaml create mode 100644 native.ini diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml deleted file mode 100644 index 543eff2d..00000000 --- a/conda/conda_build_config.yaml +++ /dev/null @@ -1,2 +0,0 @@ -c_compiler: - - m2w64-toolchain # [win] \ No newline at end of file diff --git a/conda/meta.yaml b/conda/meta.yaml index 82c13768..2ba78bc6 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -19,8 +19,8 @@ source: build: number: 0 string: py{{ PY_VER }} - script_env: - - CC=gcc # [win] + #script_env: + # - CC=gcc # [win] preserve_egg_dir: True script: {{ PYTHON }} -m pip install . --no-deps --ignore-installed --no-build-isolation -vv @@ -35,7 +35,7 @@ requirements: {% for dep in build_deps %} - {{ dep }} {% endfor %} - - {{ compiler('fortran') }} # [not win] + - {{ compiler('fortran') }} - {{ compiler('c') }} - charset-normalizer run: diff --git a/native.ini b/native.ini new file mode 100644 index 00000000..f5f6b62e --- /dev/null +++ b/native.ini @@ -0,0 +1,3 @@ +[binaries] +fortran = 'flang' + diff --git a/src/openalea/ratp/meson.build b/src/openalea/ratp/meson.build index 0362fda5..d786034a 100644 --- a/src/openalea/ratp/meson.build +++ b/src/openalea/ratp/meson.build @@ -4,6 +4,13 @@ py_mod = import('python') py = py_mod.find_installation(pure: false) py_dep = py.dependency() + + +# Conditionally add Flang runtime linker flags only on Windows +if host_machine.system() == 'windows' + add_project_link_arguments(['-lFortranRuntime', '-lFortranDecimal'], language : 'fortran') +endif + sources = files([ '../../f90/mod_Constant_ValuesF2PY.f90', '../../f90/mod_Grid3DF2PY_64bit.f90',