Comments (4)
Thanks for this report!
I think this is not about the file, but it's about the flags, from the command line:
-ftree-vectorize true -mavx512bw
I think this is caused by running cmake with:
-DBLEND2D_CFLAGS_AVX512=true
BLEND2D_CFLAGS_AVX512
cannot actually be a boolean value, it's internally set to contain compiler flags that enable AVX-512 compilation. You should not need to set that manually.
If you want to force Blend2D to be built with AVX-512 flags by default (which would imply it would not be able to run on machines without AVX-512), you would have to use the actual flags, like:
cmake <options> -DCMAKE_CXX_FLAGS=-mavx512vl
Can you retry?
from blend2d.
Ah yes, I see my mistake. For the benefit of people skimming this issue, the following error message was confusing (to me):
c++.exe: warning: true: linker input file unused because linking not done
The "true" in this error, as you pointed out @kobalicek, is relating to the bad cmake argument -DBLEND2D_CFLAGS_AVX512=true
making it all the way to the build line.
The build works perfectly fine without this flag 👍. My initial motivation was to ensure that we get all the nice SIMD/AVX codepaths when compiling under MinGW-w64, and I wasn't sure if that would be the case by default. Looking again at CMakeLists.txt
it seems that you have dedicated logic for this in the fallback case when the compiler isn't MSVC.
MinGW-w64 support is vital for people like me who want to build their projects for Windows, Linux (and Mac) while also targetting a single compiler like GCC or Clang. Targetting GCC/Clang as well as MSVC in a single codebase leads to some highly unpleasant workaraounds for the differences in C++ dialect supported by each compiler. Would you be persuaded to explicitly support MinGW-w64, and to make a note to this effect in your build instructions?
Thanks for this epic library, I'm looking forward to really getting stuck in!
from blend2d.
@squrky The build system has two cases - MSVC and GCC/Clang, but there is no preference in terms of which compiler to use (I prefer clang, but you can use any of GCC, clang, and MSVC). So GCC should be perfectly fine across platforms and you should get all the optimizations that Blend2D provides with GCC. In your case the flags detection works:
-- Performing Test __CxxFlag__mavx
-- Performing Test __CxxFlag__mavx - Success
-- Performing Test __CxxFlag__mavx2
-- Performing Test __CxxFlag__mavx2 - Success
-- Performing Test __CxxFlag__mavx512bw__mavx512dq__mavx512cd__mavx512vl
-- Performing Test __CxxFlag__mavx512bw__mavx512dq__mavx512cd__mavx512vl - Success
These will be used by SIMD accelerated functions, but these only affect C++ code. JIT always uses the best extensions, so even if C++ code is not compiled with AVX-512 support, JIT will still use it if detected.
So, this leads to my question - what is currently not supported when using MinGW? Or maybe, what do you think should be added to build instructions?
I agree that when compiling with GCC there is a bunch of warnings that I don't like. In master branch I have disabled loop annotations when compiling with GCC so you won't get the "warning: ignoring loop annotation" (this warning for some reason cannot be just turned off). The other warnings look like GCC has a problem in diagnostics in this case as the code is not using uninitialized values (and clang doesn't report these).
I think the best would be to add MINGW to CI, but I didn't want to spend much time on that myself.
from blend2d.
So, this leads to my question - what is currently not supported when using MinGW? Or maybe, what do you think should be added to build instructions?
I have a better understanding of how the build logic works now: You lump MinGW in with any other Clang/GCC platform and thus it should work without any special handling. That sounds like the right approach 👍. It wasn't totally clear from the build instructions when SIMD/AVX acceleration would be compiled in, I assumed (incorrectly) that I would need to explicitly enable those so that I would get the best possible performance out of the box. Thanks for clarifying.
I agree that when compiling with GCC there is a bunch of warnings that I don't like
This was just for reference, I didn't see anything nasty in the code.
I think the best would be to add MINGW to CI, but I didn't want to spend much time on that myself.
Totally fair. I have no idea what that entails, maybe someone will come along and submit a PR for that, maybe I will one day 🤷
I'm taking the liberty to close this issue because you have completely explained the problem I was having. Thanks again.
from blend2d.
Related Issues (20)
- composition operator not work on macOS MPB with Apple m1 HOT 2
- [Portable Pipeline] Composition operators not working (only SrcCopy and SrcOver) HOT 11
- Rendering bug with BLContext for certain image sizes HOT 2
- Wish: Android support HOT 2
- Raspberry Pi 2B rev1.1 compilation failed HOT 3
- about BLFont question HOT 12
- strokedPath error HOT 1
- Can bled2d be easily ported to rtos? HOT 3
- Rendering of fonts in various national languages HOT 2
- clipToRect not correctly applied to fillGlyphRun within rotated context HOT 4
- crash with gcc (Debian 12.2.0-14) 12.2.0 HOT 4
- build errors on Fedora s390x HOT 1
- Crash on blitImage with different image format HOT 4
- ctest of bl_test_unit failed on fedora s390x HOT 5
- Support 8-bit (s)RGBA BLImages? HOT 5
- Unexpected results with BLPattern HOT 3
- close() on path doesn't interact with stroking as expected. HOT 3
- how to do offscreen rendering in qt? HOT 4
- Please, provide tags in Github HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blend2d.