Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C++20 r-build #246

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
4 changes: 1 addition & 3 deletions .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ cxx_compiler_version:
- '13'
docker_image:
- quay.io/condaforge/linux-anvil-x86_64:alma9
fmt:
- '11'
numpy:
- '2.0'
- '2.0'
Expand All @@ -40,7 +38,7 @@ python:
r_base:
- '4.3'
spdlog:
- '1.14'
- '1.15'
target_platform:
- linux-64
zip_keys:
Expand Down
8 changes: 3 additions & 5 deletions .ci_support/osx_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MACOSX_DEPLOYMENT_TARGET:
- '11.0'
- '13.3'
MACOSX_SDK_VERSION:
- '11.0'
- '13.3'
c_compiler:
- clang
c_compiler_version:
Expand All @@ -18,8 +18,6 @@ cxx_compiler:
- clangxx
cxx_compiler_version:
- '18'
fmt:
- '11'
macos_machine:
- x86_64-apple-darwin13.4.0
numpy:
Expand All @@ -42,7 +40,7 @@ python:
r_base:
- '4.3'
spdlog:
- '1.14'
- '1.15'
target_platform:
- osx-64
zip_keys:
Expand Down
8 changes: 3 additions & 5 deletions .ci_support/osx_arm64_.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MACOSX_DEPLOYMENT_TARGET:
- '11.0'
- '13.3'
MACOSX_SDK_VERSION:
- '11.0'
- '13.3'
c_compiler:
- clang
c_compiler_version:
Expand All @@ -18,8 +18,6 @@ cxx_compiler:
- clangxx
cxx_compiler_version:
- '18'
fmt:
- '11'
macos_machine:
- arm64-apple-darwin20.0.0
numpy:
Expand All @@ -42,7 +40,7 @@ python:
r_base:
- '4.3'
spdlog:
- '1.14'
- '1.15'
target_platform:
- osx-arm64
zip_keys:
Expand Down
3 changes: 3 additions & 0 deletions recipe/build-libtiledbsoma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -exo pipefail

# Clear default compiler flags
export CXXFLAGS=${CXXFLAGS//"-fvisibility-inlines-hidden"/}

mkdir libtiledbsoma-build && cd libtiledbsoma-build

cmake \
Expand Down
20 changes: 14 additions & 6 deletions recipe/build-r-tiledbsoma.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@ set -ex

cd apis/r

# Clear default compiler flags
export CXXFLAGS=${CXXFLAGS//"-fvisibility-inlines-hidden"/}

export DISABLE_AUTOBREW=1

# https://github.com/conda-forge/r-tiledb-feedstock/commit/29cb6816636e7b5b58545e1407a8f0c29ff9dc39
if [[ $target_platform == osx-64 ]]; then
if [[ $target_platform == osx-* ]]; then
export NN_CXX_ORIG=$CXX
export NN_CC_ORIG=$CC
export CXX=$RECIPE_DIR/cxx_wrap.sh
export CC=$RECIPE_DIR/cc_wrap.sh
mkdir -p ~/.R
echo CC=$RECIPE_DIR/cc_wrap.sh > ~/.R/Makevars
echo CXX=$RECIPE_DIR/cxx_wrap.sh >> ~/.R/Makevars
echo CXX17=$RECIPE_DIR/cxx_wrap.sh >> ~/.R/Makevars
export CXX20=$RECIPE_DIR/cxx_wrap.sh
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to define CXX20 here when it is overwritten below?

fi

export CXX17FLAGS="-Wno-deprecated-declarations -Wno-deprecated"
export CXX="$CXX -std=c++20 -fPIC"
export CXX20="$CXX"

mkdir -p ~/.R
echo CC="$CC" > ~/.R/Makevars
echo CXX="$CXX" >> ~/.R/Makevars
echo CXX20="$CXX20" >> ~/.R/Makevars

export CXX20FLAGS="-Wno-deprecated-declarations -Wno-deprecated"

# https://conda-forge.org/docs/maintainer/knowledge_base/#newer-c-features-with-old-sdk
if [[ $target_platform == osx-* ]]; then
Expand Down
3 changes: 3 additions & 0 deletions recipe/build-tiledbsoma-py.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -ex

cd apis/python

# Clear default compiler flags
export CXXFLAGS=${CXXFLAGS//"-fvisibility-inlines-hidden"/}

echo
echo "PKG_VERSION IS <<$PKG_VERSION>>"
echo
Expand Down
4 changes: 2 additions & 2 deletions recipe/cc_wrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

args="${@##-mmacosx-version-min=10.9*}"
$NN_CC_ORIG $args -mmacosx-version-min=11.0
args="${@##-mmacosx-version-min=13.3*}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the version in these 2 lines shouldn't match. My understanding of the purpose of the wrapper script is to remove the original value of -mmacosx-version-min and replace it with a new one. If the script is replacing the exact same string, we can probably remove the wrapper script all-together.

$NN_CC_ORIG $args -mmacosx-version-min=13.3
4 changes: 2 additions & 2 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://conda-forge.org/docs/maintainer/knowledge_base/#requiring-newer-macos-sdks
# https://conda-forge.org/news/2024/03/24/stdlib-migration/
MACOSX_SDK_VERSION: # [osx and x86_64]
- 11.0 # [osx and x86_64]
MACOSX_SDK_VERSION: # [osx and x86_64]
- 13.3 # [osx and x86_64]
c_stdlib_version: # [osx and x86_64]
- 11.0 # [osx and x86_64]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was concerned that these didn't match, but I think this is correct. From the conda-forge docs, we don't need to bump c_stdlib_version as long as we're not getting additional errors.

channel_sources:
Expand Down
4 changes: 2 additions & 2 deletions recipe/cxx_wrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh

args="${@##-mmacosx-version-min=10.9*}"
$NN_CXX_ORIG $args -mmacosx-version-min=11.0
args="${@##-mmacosx-version-min=13.3*}"
$NN_CXX_ORIG $args -mmacosx-version-min=13.3
8 changes: 6 additions & 2 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ package:

# Post-tag real thing:
source:
url: https://github.com/single-cell-data/TileDB-SOMA/archive/{{ version }}.tar.gz
sha256: {{ sha256 }}
# url: https://github.com/single-cell-data/TileDB-SOMA/archive/{{ version }}.tar.gz
# sha256: {{ sha256 }}
# Troubleshoot C++20 by pulling latest from main (just like the nightly builds)
git_url: https://github.com/single-cell-data/TileDB-SOMA.git
git_rev: main
git_depth: -1

# Pre-tag canary "will Conda be green if we release":
#source:
Expand Down