cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

error: ‘mzd_to_png’ was not declared in this scope; did you mean ‘mzd_copy’? #563

Closed WGH- closed 4 years ago

WGH- commented 4 years ago

Encountered this during emerging sage-9.0:

[449/500] x86_64-pc-linux-gnu-g++ -march=core-avx2 -O2 -pipe -msahf -mmovbe --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=3072 -mtune=core-avx2 -fstack-protector -fPIC -I./sage/cpython -I./sage/rings -I/usr/lib64/python3.6/site-packages/cysignals -I./sage/libs/ntl -Isage/cpython -I/usr/include/m4ri -I/usr/include/libpng16 -I/usr/include -I/var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6 -I/var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/sage/ext -I/usr/include/python3.6m -I/usr/lib64/python3.6/site-packages/numpy/core/include -I/var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/build/cythonized -I/usr/include/python3.6m -c /var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/build/cythonized/sage/rings/polynomial/pbori.cpp -o /var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/build/temp.linux-x86_64-3.6/var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/build/cythonized/sage/rings/polynomial/pbori.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c++11 -march=core-avx2 -O2 -pipe -msahf -mmovbe --param=l1-cache-size=32 --param=l1-cache-line-size=64 --param=l2-cache-size=3072 -mtune=core-avx2 -fstack-protector -mmmx -msse -msse2 -msse3 -fopenmp -I/usr/include/m4ri
In file included from /usr/include/polybori/groebner/linear_algebra_step.h:23,
                 from /var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/sage/libs/polybori/pb_wrap.h:10,
                 from /var/tmp/portage/sci-mathematics/sage-9.0/work/sage-9.0/src-python3_6/build/cythonized/sage/rings/polynomial/pbori.cpp:703:
/usr/include/polybori/groebner/draw_matrix.h: In function ‘void polybori::groebner::draw_matrix(mzd_t*, const char*)’:
/usr/include/polybori/groebner/draw_matrix.h:45:13: error: ‘mzd_to_png’ was not declared in this scope; did you mean ‘mzd_copy’?
   45 |   int err = mzd_to_png(mat, filename, 9, "Generated by PolyBoRi", 0);
      |             ^~~~~~~~~~
      |             mzd_copy

These lines are #ifdefed with PBORI_HAVE_M4RI_PNG, and /usr/include/polybori/config.h contained #define PBORI_HAVE_M4RI_PNG /**/.

sci-libs/m4ri-20140914::gentoo was built with the following:
USE="openmp -debug -png -static-libs -test" ABI_X86="(64)" CPU_FLAGS_X86="sse2"
FEATURES="news unmerge-orphans unknown-features-warn ipc-sandbox userfetch binpkg-dostrip preserve-libs pid-sandbox xattr usersandbox strict binpkg-docompress unmerge-logs distlocks sandbox protect-owned multilib-strict usersync parallel-fetch fixlafiles binpkg-logs config-protect-if-modified sfperms distcc metadata-transfer ebuild-locks merge-sync assume-digests userpriv"

The ::sage-on-gentoo version of m4ri doesn't have png USE flag altogether, so it seems I used to have ::sage-on-gentoo version which has been always built with png support unconditionally, and it got downgraded to upstream ::gentoo with disabled USE flag png, and PNG support went away. sci-libs/brial (which owns /usr/include/polybori/) wasn't rebuilt, and the config file with aforementioned definitions went out of sync.

I rebuilt sci-libs/brial manually, #define PBORI_HAVE_M4RI_PNG went away, and now everything is fine.

I'm not portage expert, but can dependencies be configured in such way that any version/USE change of dependency would cause rebuild of dependent packages?

kiwifb commented 4 years ago

That's an interesting question. We can have dependency on a flag but not really on a flag unless it changes the library name I think. The problem is that you cannot tell apart the library built with and without the flag.

The only safe thing would be to rebuild all dependencies on flag, change which may be overkill for better designed libraries.

kiwifb commented 4 years ago

I may introduce a png flag in brial at the next version bump that would depend on the flag in m4ri. The next version bump will probably next week, once I have released a new brial. Since png support is no longer automatic, it should be made into a useflag.

kiwifb commented 4 years ago

OK new brial ebuild from this morning has a new png useflag that is in sync with m4ri one. So the issue should happen in the future - cross fingers.