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

Fix soxr for Apple Silicon architecture #14489

Merged
merged 10 commits into from
Jan 25, 2023

Conversation

Linux13524
Copy link
Contributor

Specify library name and version: soxr/0.1.3

This should fix #14485. At least it is a workaround to get soxr compiled for the Apple Silicon Macs. Im not an expert with this new architecture and SIMD, but for me it seems it is not supported by Apple Silicon.


@conan-center-bot

This comment has been minimized.

@prince-chrismc
Copy link
Contributor

You'll need to update the recipe's imports to the latest version for the bot to merge 😄

@Linux13524
Copy link
Contributor Author

I updated the recipe for Conan V2 and hope the bot is happy now. :)

@conan-center-bot

This comment has been minimized.

@prince-chrismc
Copy link
Contributor

wow! amawing! you only need to change the imports but new Toolchain is 🤩

@conan-center-bot

This comment has been minimized.

@Linux13524
Copy link
Contributor Author

The CI still failes. Some jobs create shared libraries instead of static ones and I don't know why. On my local it is the same but only for Conan V1, with V2 the static libs are created as expected.

BTW: Do I see it correctly that your CI can already build for M1?

@prince-chrismc
Copy link
Contributor

Thats correct M1 is testing and the binaries are available :)

@prince-chrismc
Copy link
Contributor

Policy CMP0077 is not set: option() honors normal variables. Run "cmake
--help-policy CMP0077" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.

For compatibility with older versions of CMake, option is clearing the
normal variable 'BUILD_SHARED_LIBS'

[HOOK - conan-center.py] post_package(): ERROR: [STATIC ARTIFACTS (KB-H074)] Package with 'shared=False' option did not contain any static artifact (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H074)
ERROR: [HOOK - conan-center.py] post_package(): Some checks failed running the hook, check the output

Most likely you will need to set this to NEW for it to work

# Honor BUILD_SHARED_LIBS from conan_toolchain (see https://github.com/conan-io/conan/issues/11840)
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"

@conan-center-bot

This comment has been minimized.

@Linux13524
Copy link
Contributor Author

Thanks @prince-chrismc! I think that helped but the CI is still failing and I don't find the reason for that in the logs.

@prince-chrismc
Copy link
Contributor

You need to follow the links :) https://c3i.jfrog.io/c3i/misc/logs/pr/14489/6-linux-gcc/soxr/0.1.3//14780ca7ef11429d1c9848b4e2d92d076916cce8-test.txt

--Running------
> . "/home/conan/w/prod/BuildSingleReference/conan-center-index/recipes/soxr/all/test_package/build/generators/conanrun.sh" && ./test_package_core
-----------------
soxr version: libsoxr-0.1.3
soxr/0.1.3 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
soxr/0.1.3 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
ERROR: soxr/0.1.3 (test package): Error in test() method, line 29
	if self.dependencies[self.tested_reference_str].options.with_lsr_bindings:
	AttributeError: 'NoneType' object has no attribute 'dependencies'
********************************************************************************

@Linux13524
Copy link
Contributor Author

Now I see it. Sorry, I did look at the bottom of the log. :)

I'll have a look again, but I fear Im not sure again what the problem is.

@Linux13524
Copy link
Contributor Author

@prince-chrismc Do you know why it is using the test_package and not the test_v1_package?

@prince-chrismc
Copy link
Contributor

@prince-chrismc
Copy link
Contributor

It's a migration thing, if you look for that line you'll find it in another recipes and you'll be able to see what the new version should be.

I am flying home later so ill be around during the week to help better

@Linux13524
Copy link
Contributor Author

Actually I got that line from a different recipe, I think it was Catch2:

tc.variables["WITH_PREFIX"] = self.dependencies[self.tested_reference_str].options.with_prefix

The only difference I can see is that there it is called in generate() and I call it in test(). The documentation however does not state that it is not available in test(), but it says it should only be called from generate() and validate() so I guess it is just not implemented yet, right?

I am flying home later so ill be around during the week to help better

Thanks a lot for your help! It is very much appreciated!

@prince-chrismc
Copy link
Contributor

Me: "Oh that's an excellent question let me write some docs for it!"
Also me: (completely forgets to answer)

🤦

Sorry https://github.com/conan-io/conan-center-index/blob/master/docs/adding_packages/dependencies.md#passing-requirements-info-to-build


So this is by decision, the "complete" graph is limited to generate and validate and the idea with the new Toolchain workflow is to save the information and then load those from files are a later stage so improve the flexibility and user's options when developing locally

The docs should be good to copy past, there is also the catch2/2.x.x test_package which should be doing the same thing 😄 if you need inspiration

@Linux13524
Copy link
Contributor Author

Thanks for your answer and no worries! I had not much time to work on this anyway. :)

I took the code now from catch2/2.x.x and it works, at least locally, the CI seems to not run for some reason.

@prince-chrismc
Copy link
Contributor

CI seemed to have a random failure downloading java deps 😕

Copy link
Contributor

@prince-chrismc prince-chrismc left a comment

Choose a reason for hiding this comment

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

Just two small comments but looks super good

@conan-center-bot

This comment has been minimized.

Linux13524 and others added 2 commits January 9, 2023 08:17
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline

All green in build 11 (c591c9320e5a5bbbba7c4077e404f7c656668237):

  • soxr/0.1.3@:
    All packages built successfully! (All logs)

Conan v2 pipeline (informative, not required for merge)

Failure in build 11 (c591c9320e5a5bbbba7c4077e404f7c656668237):

  • soxr/0.1.3@:
    CI failed to create some packages (All logs)

    Logs for packageID a5508f6dc5755d37cb00622c732c9e68b42174a6:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    
    [...]
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    [conf]
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    
    Profile build:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=11
    os=Linux
    [options]
    */*:shared=False
    [conf]
    tools.system.package_manager:mode=install
    tools.system.package_manager:sudo=True
    
    
    -------- test_package: Computing dependency graph --------
    Graph root
        soxr/0.1.3 (test package): /home/conan/w/prod-v2/BuildSingleReference/conan-center-index/recipes/soxr/all/test_package/conanfile.py
    Requirements
        soxr/0.1.3#6afffd0841adb4a50348fce5ca91f893 - Cache
    
    -------- test_package: Computing necessary packages --------
    Requirements
        soxr/0.1.3#6afffd0841adb4a50348fce5ca91f893:a5508f6dc5755d37cb00622c732c9e68b42174a6#bf7ce0dd6c5030464272736a6494d618 - Cache
    
    -------- test_package: Installing packages --------
    
    -------- Installing (downloading, building) binaries... --------
    soxr/0.1.3: Already installed!
    
    -------- Testing the package --------
    soxr/0.1.3 (test package): Writing generators to /home/conan/w/prod-v2/BuildSingleReference/conan-center-index/recipes/soxr/all/test_package/test_output/build/generators
    soxr/0.1.3 (test package): Generator 'CMakeToolchain' calling 'generate()'
    soxr/0.1.3 (test package): Preset 'release' added to CMakePresets.json. Invoke it manually using 'cmake --preset release'
    soxr/0.1.3 (test package): If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake <path> -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/home/conan/w/prod-v2/BuildSingleReference/conan-center-index/recipes/soxr/all/test_package/test_output/build/generators/conan_toolchain.cmake -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Release'
    soxr/0.1.3 (test package): Generator 'CMakeDeps' calling 'generate()'
    soxr/0.1.3 (test package): Generator 'VirtualRunEnv' calling 'generate()'
    soxr/0.1.3 (test package): Calling generate()
    ERROR: soxr/0.1.3 (test package): Error in generate() method, line 28
    	with open(self._todos_filename, "w", encoding="utf-8") as file:
    	FileNotFoundError: [Errno 2] No such file or directory: '/home/conan/w/prod-v2/BuildSingleReference/conan-center-index/recipes/soxr/all/test_package/build/generators/soxr_test_to_do.yml'
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@conan-center-bot conan-center-bot merged commit 9bc07ca into conan-io:master Jan 25, 2023
StellaSmith pushed a commit to StellaSmith/conan-center-index that referenced this pull request Feb 2, 2023
* Fix soxr for Apple Silicon architecture

* Prepare for Conan v2

* Set test_type explicit for the new test_package

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

* Use `can_run` instead of `not cross_building` in the test_package

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

* Remove wrapper CMakeLists.txt

* Declare some CMake policies

* Fix test_package for  Conan v1

* Add patch descriptions and types

* Change todos filename

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

* Update minimum required Conan version

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>

Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
@flak228
Copy link

flak228 commented Mar 14, 2024

Hey!)
I'm sorry for bothering you, tried my best to find a way to use this info to compile a build of soxr on M1 Mac, but, unfortunately, still really far away from success, so can I ask you to guide me through the way how to do this?)
Will be really grateful for your help!)

@franramirez688
Copy link
Contributor

Hi @flak228

I think it'd be great to open an issue in this repository https://github.com/conan-io/conan-center-index/issues/new?assignees=&labels=question&projects=&template=question.yml&title=%5Bquestion%5D+SHORT+DESCRIPTION So we'll try our best to help you with that. Please, put all the necessary details about your use case there and how you are trying to use soxr. Thanks!

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.

[package] soxr/0.1.3: Compilation errors on M1 Mac
6 participants