SPARK icon indicating copy to clipboard operation
SPARK copied to clipboard

Build failed on x64

Open caxapexac opened this issue 2 years ago • 7 comments

Library is making an assumtions that sizeof(size_t) == sizeof(unsigned int) (i.e. SPK_Group::373) which isn't true on x64 (sizeof(size_t) == 8)

Fixed by adding TYPE_SIZE_T, into SPK_Types::61 and spk_basetype( size_t, TYPE_SIZE_T, meta::PassByValue ); into SPK_Types::308

But its still won't build because of some kind of error in SPK::meta::Counter (its using sizeof inside contrution of type system so Im almost sure this is the root of the problem). Anybody came with the soultion?

Error sample: spk_attribute(bool, loop, enableLooping, isLoopingEnabled); (SPK_GraphInterpolator::244)

error: redefinition of 'spkAttr<((sizeof (_spk_count_Attr(SPK::meta::Counter<64 + 1>())) / sizeof(bool)) - 1), b>'
            struct spkAttr<((sizeof(_spk_count_Attr(SPK::meta::Counter<64 + 1>())) / sizeof(bool)) - 1), b>
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SPK_GraphInterpolator.h:422:20: note: previous definition is here
            struct spkAttr<((sizeof(_spk_count_Attr(SPK::meta::Counter<64 + 1>())) / sizeof(bool)) - 1), b>
                   ^
SPK_GraphInterpolator.h:464:119: error: class member cannot be redeclared
            static SPK::meta::Count<((sizeof(_spk_count_Attr(SPK::meta::Counter<64 + 1>())) / sizeof(bool)) - 1) + 2> _spk_count_Attr (SPK::meta::Counter<((
                                                                                                                      ^
SPK_GraphInterpolator.h:427:119: note: previous declaration is here
            static SPK::meta::Count<((sizeof(_spk_count_Attr(SPK::meta::Counter<64 + 1>())) / sizeof(bool)) - 1) + 2> _spk_count_Attr (SPK::meta::Counter<((

caxapexac avatar Sep 11 '22 08:09 caxapexac

Btw https://github.com/Synxis/SPARK/pull/18 with a bit different solution of size_t

caxapexac avatar Sep 11 '22 08:09 caxapexac

@kingscallop do you have an working x64 branch?

caxapexac avatar Sep 11 '22 08:09 caxapexac

Found promising forks: https://github.com/gitLongjie/SPARK - changed size_t to unsigned int https://github.com/fredakilla/SPARK - seems like huge changes

caxapexac avatar Sep 11 '22 08:09 caxapexac

Hi @caxapexac, This branch should work: https://github.com/kingscallop/SPARK/tree/spark2-ks-all-patches It has all the patches I submitted upstream. The readme has instructions on how to build.

kingscallop avatar Sep 11 '22 19:09 kingscallop

@kingscallop yeah thanks, applying almost all of your PRs (with additional changing all size_t to unsigned int) fixed the build issues What about https://github.com/fredakilla/spkgen? Have you tried it out? Is it the decent one?

caxapexac avatar Sep 11 '22 20:09 caxapexac

@caxapexac Hi, that fork is based on an old version, before some rather big changes to the codebase made by Synxis. So I don't really know what features it lacks, or what bugs that fork might have. From what I can remember when last I tried it, it doesn't work on all platforms. I think Linux works at least. More than that I really don't know, sorry. By the way, the branch 'spark2-ks-all-patches' should work out of the box without any extra patches.

kingscallop avatar Sep 18 '22 20:09 kingscallop

@kingscallop I mean visual node editor for this library, which is the most actual (if something except spkgen exists)?

caxapexac avatar Sep 18 '22 20:09 caxapexac