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

Compile using cpp backend #506

Open
jerous86 opened this issue Sep 7, 2022 · 5 comments
Open

Compile using cpp backend #506

jerous86 opened this issue Sep 7, 2022 · 5 comments

Comments

@jerous86
Copy link

jerous86 commented Sep 7, 2022

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@[email protected]: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?

@iffy
Copy link
Contributor

iffy commented Oct 13, 2022

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

@amaank404
Copy link

Why wouldn't SIMD instructions work on C++? Just Curious

@guzba
Copy link
Collaborator

guzba commented Apr 13, 2023

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.

@guzba
Copy link
Collaborator

guzba commented Apr 13, 2023

Yeah this is something Mac specific.

@guzba
Copy link
Collaborator

guzba commented Apr 13, 2023

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.

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

No branches or pull requests

4 participants