Skip to content

Compile using cpp backend #506

Closed
Closed

Description

@jerous86

I want to use pixie in a nim program that can only be compiled with the cpp backend.
However, pixie cannot be compiled using this cpp backend on my system (mac OS 12).

For example,
nim cpp --gc:orc -d:release -r tests/all.nim
results in multiple errors like

.cache/nim/all_r/@m..@ssrc@spixie@ssimd@savx2.nim.cpp:197:5: error: no matching function for call to '_mm256_store_si256'
                                _mm256_store_si256(((void*) (p)), colorVec);
                                ^~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/avxintrin.h:3277:1: note: candidate function not viable: cannot convert argument of incomplete type
      'void *' to '__m256i *' for 1st argument
_mm256_store_si256(__m256i *__p, __m256i __a)

Anyway to get it compiling using nim cpp?

Activity

  1. iffy commented on Oct 13, 2022

    @iffy
    Contributor

    Try nim cpp -d:pixieNoSimd -d:zippyNoSimd -r tests/all.nim

  2. guzba commented on Apr 13, 2023

    @guzba
    Collaborator

    We run all of our tests using nim cpp for every commit so I can be confident C++ is not the issue here. The real question is why does it not work on your computer which is unfortunately much harder to answer from far away.

  3. guzba commented on Apr 13, 2023

    @guzba
    Collaborator

    Yeah this is something Mac specific.

  4. guzba commented on Apr 13, 2023

    @guzba
    Collaborator

    It appears clang on Mac requires pointers to be cast to something like const __m128i_u *. This is a made-up requirement, serves no purpose and is dumb. Fortunately no other compilers require it so I'm not eager to do anything here.

  5. xTrayambak commented on Apr 18, 2025

    @xTrayambak

    It appears clang on Mac requires pointers to be cast to something like const __m128i_u *. This is a made-up requirement, serves no purpose and is dumb. Fortunately no other compilers require it so I'm not eager to do anything here.

    Sorry for the late reply but this isn't a Mac-specific issue. I'm getting the same error with Clang on Linux as well.

  6. treeform commented on May 3, 2026

    @treeform
    Owner

    Thank you for the issue. This has been fixed with #577 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions