Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .cd/.conda/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@

#!/usr/bin/env bash

set -e # Abort on error.
set -x # Display executed commands

ENABLE_SSL=ON
ENABLE_PYTHON=ON
ENABLE_HTTP=ON
ENABLE_UDP=ON
ENABLE_UI=ON

# find the boost libs/includes we need
export LDFLAGS="$LDFLAGS -L$PREFIX/lib -Wl,-rpath,$PREFIX/lib"
export CFLAGS="$CFLAGS -fPIC -I$PREFIX/include"


if [[ $(uname) == Darwin && ${target_platform} == osx-64 ]]; then
# Disable use of std::aligned_alloc by boost, as this is not available on macOS 10.9
export CXXFLAGS="$CXXFLAGS -DBOOST_ASIO_DISABLE_STD_ALIGNED_ALLOC"

# https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
export CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"

# Disable ecflow_http build, as it uses C++17 features only available on macOS 10.12+
ENABLE_HTTP=OFF
# Disable ecflow_udp build, as it uses C++17 features only available on macOS 10.13+
ENABLE_UDP=OFF
fi

# Diagnostic information
${CXX} --version
${CXX} -dM -E - <<HERE
#include <sys/socket.h>
HERE

export UNDEF_LOOKUP=0
if [[ $(uname) == Darwin ]]; then
export UNDEF_LOOKUP=1
fi

mkdir build && cd build

conda info

echo "which python"
which python
echo "python version"
python --version

cmake ${CMAKE_ARGS} \
-D CMAKE_INSTALL_PREFIX=$PREFIX \
-D ENABLE_PYTHON=$ENABLE_PYTHON \
-D ENABLE_SSL=$ENABLE_SSL \
-D ENABLE_HTTP=$ENABLE_HTTP \
-D ENABLE_UDP=$ENABLE_UDP \
-D ENABLE_UI=$ENABLE_UI \
-D BOOST_ROOT=$PREFIX \
-D ECBUILD_LOG_LEVEL=DEBUG \
-D ENABLE_STATIC_BOOST_LIBS=OFF \
-D Python3_FIND_STRATEGY=LOCATION \
-D Python3_EXECUTABLE=$PYTHON \
-D ENABLE_PYTHON_UNDEF_LOOKUP=$UNDEF_LOOKUP \
-D Cereal_INCLUDE_DIRS=../3rdparty/cereal/include \
-D JSON_INCLUDE_DIRS=../3rdparty/json/include \
-D HTTPLIB_INCLUDE_DIRS=../3rdparty/cpp-httplib/include \
..

make -j $CPU_COUNT VERBOSE=1


# only run certain tests
if [[ $(uname) == Linux ]]; then
echo "1,2,3,4,5,6,7,8" > ./test_list.txt
elif [[ $(uname) == Darwin ]]; then
echo "1,2,3,4,5,6,8" > ./test_list.txt
fi

if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR}" != "" ]]; then
ctest -VV -I ./test_list.txt
fi

make install
20 changes: 20 additions & 0 deletions .cd/.conda/conda_build_config_common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
c_compiler:
- gcc
c_compiler_version:
- '15'
c_stdlib:
- sysroot
c_stdlib_version:
- '2.17'
cdt_name:
- conda
cxx_compiler:
- gxx
cxx_compiler_version:
- '15'
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
qt_main:
- '5.15'
2 changes: 2 additions & 0 deletions .cd/.conda/conda_build_config_py312.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
python:
- 3.12.* *_cpython
65 changes: 65 additions & 0 deletions .cd/.conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{% set name = "ecFlow" %}
{% set git_tag = environ.get('GIT_DESCRIBE_TAG', '0.0.0').lstrip('v') %}
{% set version = git_tag.replace('-', '') | lower %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
path: ../..

build:
number: 0
skip: true # [win]

requirements:
build:
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- cmake
- make
- ecbuild
- {{ compiler('c') }}
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- {{ cdt('mesa-libgl-devel') }} # [linux]
- {{ cdt('mesa-dri-drivers') }} # [linux]
- {{ cdt('libselinux') }} # [linux]
- {{ cdt('libxdamage') }} # [linux]
- {{ cdt('libxfixes') }} # [linux]
- {{ cdt('libxxf86vm') }} # [linux]
- {{ cdt('libxcb') }} # [linux]
- {{ cdt('libxext') }} # [linux]
- {{ cdt('libxau') }} # [linux]
host:
- python
- libboost-python-devel
- qt-main
- xorg-libxfixes # [linux]
- zlib # [linux]
- libxcrypt # [linux]
run:
- python
- qt-main
- libboost-python-devel
- zlib # [linux]
- libxcrypt # [linux]

test:
commands:
- ecflow_client --help
- ecflow_server --help
- ecflow_standalone -v

about:
home: https://ecflow.readthedocs.io/en/latest/
license: Apache-2.0
license_family: Apache
license_file: LICENSE
summary: ECMWF ecFlow

extra:
recipe-maintainers:
- marcosbento
- iainrussell
9 changes: 9 additions & 0 deletions .github/cd-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
builds:
- name: "conda-build"
type: "conda"
enabled: true
config:
conda_build_args: "-m .cd/.conda/conda_build_config_common.yaml -m .cd/.conda/conda_build_config_py312.yaml --no-anaconda-upload"

release:
enabled: true
26 changes: 26 additions & 0 deletions .github/workflows/all-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: All CD

on:
push:
tags:
- 'v?[0-9]+.[0-9]+.[0-9]+'
- 'v?[0-9]+.[0-9]+.[0-9]+-*'
branches:
- '*'
pull_request:
types: [opened, synchronize, reopened, labeled]
workflow_dispatch:

permissions:
contents: write

jobs:
build-and-release:
if: |
startsWith(github.ref, 'refs/tags/') ||
github.ref_name == github.event.repository.default_branch ||
(github.event.pull_request.base.ref == github.event.repository.default_branch && github.event.label.name == 'approved-for-cd')
uses: ecmwf/reusable-workflows/.github/workflows/main-cd.yml@debug-cd-conda
with:
ref_name: ${{ github.ref_name }}
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
- 'develop'
tags-ignore:
- '**'
paths-ignore:
- ".cd/**"

# Trigger the workflow on pull request
pull_request: ~
Expand Down
Loading