Skip to content

Try to build for osx - #7

Closed
albop wants to merge 20 commits into
conda-forge:mainfrom
albop:main
Closed

albop wants to merge 20 commits into
conda-forge:mainfrom
albop:main

Conversation

@albop

@albop albop commented Sep 8, 2025 •

Copy link
Copy Markdown
Contributor

Checklist

  • Used a personal fork of the feedstock to propose changes
  • Bumped the build number (if the version is unchanged)
  • Reset the build number to 0 (if the version changed)
  • Re-rendered with the latest conda-smithy (Use the phrase @conda-forge-admin, please rerender in a comment in this PR for automated rerendering)
  • Ensured the license file is being packaged.

@albop
albop requested a review from svillemot as a code owner September 8, 2025 11:37
@albop

albop commented Sep 8, 2025

Copy link
Copy Markdown
Contributor Author

@conda-forge-admin, please rerender

@conda-forge-admin

Copy link
Copy Markdown
Contributor

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe/meta.yaml) and found it was in an excellent condition.

@svillemot

Copy link
Copy Markdown

I don’t have much to say, because this PR is mostly about technologies that I’m not familiar with. I’m just curious about why it is needed to add the build flags -pthread -nostdinc++ -nostdlib++. Maybe that could be fixed upstream.

@albop

albop commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

@svillemot : I can't claim that I have found the full solution yet.
The problem is that the SDK distributed with macos <=10.4 which is used to build, does not contain some symbols. Hence they are marked unvailable even though they should, in principle, be supplied by the conda libraries.
The error is documented here: https://conda-forge.org/docs/maintainer/knowledge_base/, section "Newer C++ features with old SDK". The solution supposedly consists in adding "CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY". I initially thought that adding it would work on all platforms should work. Then looked at https://stackoverflow.com/questions/75475265/when-using-clang-how-can-i-disable-libc-availability-checks which suggested -nostdinc++ -nostdlib++ but it doesn't have the right effect.

@albop

albop commented Sep 9, 2025

Copy link
Copy Markdown
Contributor Author

@conda-forge/help-c-cpp : I'm trying to build this recipe under macos X. The build uses meson (from upstream).

The command is in build.sh.

  • With the same call as linux I get the error : note: 'path' has been explicitly marked unavailable here
  • But if I follow the instructions from the knowledge base https://conda-forge.org/docs/maintainer/knowledge_base/ and run meson setup --buildtype=release build_preproc -Dcpp_args='-D_LIBCPP_DISABLE_AVAILABILITY -pthread' -Dcpp_link_args='-pthread', then the error states that jthread is not available

I'm thinking this might be a valid reason to increase the version of the SDK number since 10.3 doesn't seem to have jthread.
The other possibility would be to use conda's gccinstead of mac clang but I haven't found how to do that.

Could you give me some help or pointers ?

@svillemot : if I understand correctly, upstream uses homebrew instead of mac's SDK, right ?

@svillemot

Copy link
Copy Markdown

Basically the preprocessor requires GCC 12 to compile. If you are using clang or an older GCC, you will run into problems.

Comment thread recipe/conda_build_config.yaml Outdated
@@ -1,2 +1,4 @@
c_compiler:
- g++
- gcc

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actually gcc the binary is not used, since there is no C code. So this change is not strictly needed. You were already using GCC (the compiler suite).

@svillemot

svillemot commented Sep 9, 2025 •

Copy link
Copy Markdown

Regarding Homebrew, my understanding is that it uses whatever SDK is installed on the user machine. We compile our own Dynare package (for MATLAB) using Homebrew on an up-to-date macOS 15 system.

I don’t know whether an old SDK is suitable for compiling C++20 code.

@svillemot

svillemot commented Sep 9, 2025 •

Copy link
Copy Markdown

And regarding the Dynare package (for Octave) that is distributed as an official Homebrew package, I don’t know which SDK is used.

Comment thread variants.yaml Outdated
Comment thread recipe/build.sh Outdated
Print meson log

Co-authored-by: Uwe L. Korn <xhochy@users.noreply.github.com>
@albop

albop commented Sep 16, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @xhochy for the suggestion !
Apparently meson fails to configure the linker properly. Here is what I see in the output:

  • there is a first call to detect the 'Linker' which fails because it doesn't support the --version option
  • a second call to detect the 'Apple Linker' (which looks like the same exécutable) fails with '2025-09-16T07:44:04.5786790Z ld: library not found for -lc++experimental'

@albop albop closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants