cschwan / sage-on-gentoo

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

media-gfx/tachyon-0.98.9-r2 #466

Closed Alessandro-Barbieri closed 7 years ago

Alessandro-Barbieri commented 7 years ago

Just got this error


gcc -Os -pipe -march=native -mtune=native  -mfpmath=sse -Wl,-O1 -Wl,--as-needed -Wl,-O2 -Wl,-z,now -Wl,-z,relro -lpthread -lgomp -fweb -fgcse-after-reload -fivopts -fopenmp -Wno-error=implicit-function-declaration -pthread -D_REENTRANT -Wall    -DLinux -DTHR -D_REENTRANT -DUSEJPEG -DUSEPNG    -I/usr/include/libpng16   -DUSEOPENGL -I/usr/X11R6/include -c ../src/trace.c -o ../compile/linux-thr-ogl/libtachyon/trace.o
../src/trace.c: In function ‘thread_trace’:
../src/trace.c:65:67: error: ‘scenedef {aka struct <anonymous>}’ has no member named ‘numobjects’
   local_mbox = (unsigned long *)calloc(sizeof(unsigned long)*scene->numobjects, 1);
                                                                   ^
make[2]: *** [Makefile:278: ../compile/linux-thr-ogl/libtachyon/trace.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/var/tmp/portage/media-gfx/tachyon-0.98.9-r2/work/tachyon/unix'
make[1]: *** [Makefile:84: all] Error 2
make[1]: Leaving directory '/var/tmp/portage/media-gfx/tachyon-0.98.9-r2/work/tachyon/unix'
make: *** [Make-arch:1180: linux-thr-ogl] Error 2
 * ERROR: media-gfx/tachyon-0.98.9-r2::sage-on-gentoo failed (compile phase):
 *   emake failed
kiwifb commented 7 years ago

Hum... version of gcc and useflags for tachyon please.

Alessandro-Barbieri commented 7 years ago

gcc version 5.4.0 (Gentoo Hardened 5.4.0-r3 p1.3, pie-0.6.5)

emerge -pqv '=media-gfx/tachyon-0.98.9-r2::sage-on-gentoo'
[ebuild  N    ] media-gfx/tachyon-0.98.9-r2  USE="examples jpeg opengl png threads -doc -mpi"
kiwifb commented 7 years ago

Ha! Our friend Hardened. That may require some digging.

kiwifb commented 7 years ago

Out of curiousity, can you tell me if 0.99_beta6-r1 from the main tree installs? We cannot use it for sage because of some incompatibilities (I tried before) but if it compiles and install we may get some clues. If it doesn't we can also fill a bug for the main tree version where someone may figure it out.

kiwifb commented 7 years ago

Also very strange list of flags. It looks like your LDFLAGS have been merged with your CFLAGS too, which is not very useful but makes the log very messy. Finally how come your compiler is gcc and not x86_64-pc-linux-gnu-gcc?

Alessandro-Barbieri commented 7 years ago

I am sorry, it was -fopenmp. I wrote a patch but I cant apply (through /etc/portage/patches) without modifying the ebuild too.

kiwifb commented 7 years ago

Right I should have the proper stuff to accept your patch at least. But to be clear, are you meaning that -fopenmp should be filtered from the {C,LD}FLAGS?

Alessandro-Barbieri commented 7 years ago

I patched the faulty c code

--- src/trace.c 2010-01-18 07:13:18.000000000 +0100
+++ /tmp/trace.c        2017-05-10 04:46:20.536523010 +0200
@@ -62,7 +62,7 @@
 #if !defined(DISABLEMBOX)
    /* allocate mailbox array per thread... */
 #if defined(_OPENMP)
-  local_mbox = (unsigned long *)calloc(sizeof(unsigned long)*scene->numobjects, 1);
+  local_mbox = (unsigned long *)calloc(sizeof(unsigned long)*scene->objgroup.numobjects, 1);
 #else
   if (t->local_mbox == NULL)
     local_mbox = (unsigned long *)calloc(sizeof(unsigned long)*scene->objgroup.numobjects, 1);

Since S is in work/tachyon/unix/ the automatic patching won't work because I need to patch work/tachyon/src/trace.c and relative paths with ../ (../src/trace.c) are forbidden by patch

Patching with the /etc/portage/patches needs patches relative to S

kiwifb commented 7 years ago

Well, I migrated to EAPI 6 so eapply_user should work. As far as I understand the patch should work like other patches in the eapply format. The previous ebuild didn't have the stuff in src_prepare to allow you to bring your own patches.

Should the ebuild have an openmp useflag?

Alessandro-Barbieri commented 7 years ago

If you can move https://github.com/cschwan/sage-on-gentoo/blob/master/media-gfx/tachyon/tachyon-0.98.9-r2.ebuild#L28 to S="${WORKDIR}/${PN} all problems will be solved

Alessandro-Barbieri commented 7 years ago

About the useflag, I don't know, in the makefile it cites openmp for a particular architecture but did not specify a flag for it. Openmp seems always forgotten, this is the third package with unused openmp code that I encounter (the others being mesa and zpaq)

kiwifb commented 7 years ago

Hum, I think you are wrong about the patching but I will conduct a test to double check.

For openmp, I think you shouldn't just have -fopenmp in your default cflags. Yes there may be openmp path in some code and as an end user you may not easily know if they are actively maintained or abandoned cruft. But if openmp can be supported in tachyon I can do something about it to do it properly. Otherwise I may just filter the compiler flag to avoid the problem altogether.

kiwifb commented 7 years ago

I may move everything to the main tree tachyon ebuild soon. When that happens it will probably make this issue obsolete.

kiwifb commented 7 years ago

tachyon gone from the overlay. New bugs should go to bugzilla.