cschwan / sage-on-gentoo

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

sci-libs/fflas-ffpack-2.2.2-r1 fail to build #435

Closed strogdon closed 7 years ago

strogdon commented 8 years ago

From build.log:

Making all in libs
make[4]: Entering directory '/var/tmp/portage/sci-libs/fflas-ffpack-2.2.2-r1/work/fflas-ffpack-2.2.2/fflas-ffpack/interfaces/libs'
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L1_inst.lo fflas_L1_inst.C
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L2_inst.lo fflas_L2_inst.C
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L3_inst.lo fflas_L3_inst.C
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o ffpack_inst.lo ffpack_inst.C
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_lvl1.lo fflas_lvl1.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L2_inst.C  -fPIC -DPIC -o .libs/fflas_L2_inst.o
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_lvl1.C  -fPIC -DPIC -o .libs/fflas_lvl1.o
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L3_inst.C  -fPIC -DPIC -o .libs/fflas_L3_inst.o
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c ffpack_inst.C  -fPIC -DPIC -o .libs/ffpack_inst.o
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L1_inst.C  -fPIC -DPIC -o .libs/fflas_L1_inst.o
In file included from ../../../fflas-ffpack/field/rns-double.h:457:0,
                 from ../../../fflas-ffpack/field/rns-integer.h:38,
                 from ../../../fflas-ffpack/fflas/fflas_fscal_mp.inl:33,
                 from ../../../fflas-ffpack/fflas/fflas.h:129,
                 from fflas_lvl1.C:36:
../../../fflas-ffpack/field/rns-double-recint.inl:86:2: error: stray ‘#’ in program
     PAR_BLOCK{
  ^
In file included from ../../../fflas-ffpack/field/rns-double.h:457:0,
                 from ../../../fflas-ffpack/field/rns-integer.h:38,
                 from ../../../fflas-ffpack/fflas/fflas_fscal_mp.inl:33,
                 from ../../../fflas-ffpack/fflas/fflas.h:129,
                 from fflas_lvl1.C:36:
../../../fflas-ffpack/field/rns-double-recint.inl:159:2: error: stray ‘#’ in program
    PAR_BLOCK{
  ^
In file included from ../../../fflas-ffpack/field/rns-double.h:457:0,
                 from ../../../fflas-ffpack/field/rns-integer.h:38,
                 from ../../../fflas-ffpack/fflas/fflas_fscal_mp.inl:33,
                 from ../../../fflas-ffpack/fflas/fflas.h:129,
                 from fflas_lvl1.C:36:
../../../fflas-ffpack/field/rns-double-recint.inl: In member function ‘void FFPACK::rns_double::init(size_t, size_t, double*, size_t, const RecInt::ruint<K>*, size_t, size_t, bool) const’:
../../../fflas-ffpack/field/rns-double-recint.inl:86:3: error: ‘pragma’ was not declared in this scope
     PAR_BLOCK{
   ^
In file included from ../../../fflas-ffpack/field/rns-double.h:457:0,
                 from ../../../fflas-ffpack/field/rns-integer.h:38,
                 from ../../../fflas-ffpack/fflas/fflas_fscal_mp.inl:33,
                 from ../../../fflas-ffpack/fflas/fflas.h:129,
                 from fflas_lvl1.C:36:
../../../fflas-ffpack/field/rns-double-recint.inl: In member function ‘void FFPACK::rns_double::convert(size_t, size_t, FFPACK::rns_double::integer, RecInt::ruint<K>*, size_t, const double*, size_t, FFPACK::rns_double::integer, bool) const’:
../../../fflas-ffpack/field/rns-double-recint.inl:159:3: error: ‘pragma’ was not declared in this scope
    PAR_BLOCK{
   ^
Makefile:595: recipe for target 'fflas_lvl1.lo' failed
make[4]: *** [fflas_lvl1.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from ../../../fflas-ffpack/field/rns-double.h:457:0,
                 from ../../../fflas-ffpack/field/rns-integer.h:38,
                 from ../../../fflas-ffpack/fflas/fflas_fscal_mp.inl:33,
                 from ../../../fflas-ffpack/fflas/fflas.h:129,
                 from fflas_L3_inst.C:33:
../../../fflas-ffpack/field/rns-double-recint.inl:86:2: error: stray ‘#’ in program
     PAR_BLOCK{
  ^

This is on Gentoo. It does build in prefix. The only apparent difference is eselect for blas and cblas. It's almost as if something is not being parsed correctly.

kiwifb commented 8 years ago

Does your openblas have openmp?

strogdon commented 8 years ago

Yes,

eix -I openblas
[I] sci-libs/openblas [1]
     Available versions:  (~)0.2.14 (~)0.2.15 **9999 {dynamic int64 openmp static-libs threads ABI_X86="32 64"}
     Installed versions:  0.2.15(04:12:28 PM 01/16/2016)(openmp -dynamic -int64 -static-libs -threads ABI_MIPS="-n32 -n64 -o32" ABI_PPC="-32 -64" ABI_S390="-32 -64" ABI_X86="64 -32 -x32")
     Homepage:            http://xianyi.github.com/OpenBLAS/
     Description:         Optimized BLAS library based on GotoBLAS2

[1] "science" /var/lib/layman/science

In prefix I'm using blas-reference. I haven't tried that on the Gentoo box.

kiwifb commented 8 years ago

Do you also have openmp for fflas-ffpack or just openblas? I am ready to make the statement that openmp flags are at fault.

strogdon commented 8 years ago

Enabling openmp for fflas-ffpack gives the same failure.

kiwifb commented 8 years ago

I was wondering (my development box is down - probably a power cut). However I am ready to bet disabling openmp in openblas (I switched to threads some time ago because it would lead to interesting nested openmp problems) and fflas-ffpack will fix the problem.

strogdon commented 8 years ago

I removed openmp from openblas and I still have the same error. So openmp many be a problem in general.

strogdon commented 8 years ago

I meant openblas may be the problem.

kiwifb commented 8 years ago

I use openblas and I didn't have a problem while developing the ebuild. OK, version of gcc involved in both case?

strogdon commented 8 years ago

prefix: gcc version 5.4.0 (Gentoo 5.4.0 p1.0, pie-0.6.5)

Gentoo: gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4)

kiwifb commented 8 years ago

I have looked at the fflas-ffpack code on github and I can only think you get that message because there is a processing problem with the code. Which is why I asked about the compiler. That being said I think problems with 4.9.3 would have been identified already, unless there is something specific to the gentoo. pie is this a sign of a hardened gentoo install?

strogdon commented 8 years ago

This does build when building vanilla on the same machine.

strogdon commented 8 years ago

The openblas was an excursion into never never land. The problem IS with openmp. I need sci-libs/fflas-ffpack -openmp to get fflas-ffpack to build here. I thought I had tried that but apparently no. The -openmp is how vanilla builds fflas-ffpack on my machine. This is probably compiler specific since I don't need -openmp in prefix. I don't know how openblas should be built. I have it with -openmp now and to get sci-libs/linbox-1.4.2 to build I also need -openmp there as well. Sage is now building!

strogdon commented 8 years ago

If I revert the compiler in prefix to gcc version 4.9.3 (Gentoo 4.9.3 p1.5, pie-0.6.4) then I get the same failure listed under the first comment. It's shame their isn't a patch to deal with this since 4.9.3 is supposed to be openmp compatible.

kiwifb commented 8 years ago

OK, back in action what combination of useflags worked for you? openblas[openmp] + fflass-ffpack[-openmp]?

strogdon commented 8 years ago

With gcc-4.9.3 this works: openblas[openmp] fflas-ffpack[-openmp] linbox[-openmp]

With gcc-5.4.0 [openmp] works everywhere. A grep of the vanilla logs gives:

commit 5dc9f122c6646c3edef0775f4c9896e42ca0e28a
Author: Jeroen Demeyer <jdemeyer@cage.ugent.be>
Date:   Tue Mar 1 13:31:57 2016 +0100

    Disable openmp in linbox

commit 6c253a017cc54fa7c6de861d6f093f5ffc9b875c
Author: Jeroen Demeyer <jdemeyer@cage.ugent.be>
Date:   Tue Mar 1 13:30:16 2016 +0100

    Disable openmp in fflas_ffpack

So there was a problem in vanilla.

kiwifb commented 8 years ago

Yes I probably should depend on linbox[-openmp] in the ebuild. I remember why Jeroen did that. I did a lot of pushing on that ticket, including upstream fflas-ffpack and linbox.

kiwifb commented 8 years ago

I probably should cascade the openmp setting from linbox down to fflas-ffpack too, although it is unclear if it is necessary.

strogdon commented 8 years ago

Well here with 4.9.3 I needed -openmp in fflas-ffpack. Now fflas-ffpack indicates that their code should work with >=gcc-4.7. So is this a gentoo bug or a fflas-ffpack bug?

kiwifb commented 8 years ago

Hard to say, I guess 4.9.4 could be tried, but I wouldn't trust upstream making such a broad statement. In theory they are right but I am fairly sure they haven't tested all versions of gcc 4.7 and over. But I should at least put a warning in case of failure to turn openmp off.

strogdon commented 8 years ago

This sequence seems to work here. At least the libraries are created and installed in the image folder.

The most significant difference from the first post is

Making all in libs
make[4]: Entering directory '/var/tmp/portage/sci-libs/fflas-ffpack-2.2.2-r1/work/fflas-ffpack-2.2.2/fflas-ffpack/interfaces/libs'
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6   -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L1_inst.lo fflas_L1_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L1_inst.C  -fPIC -DPIC -o .libs/fflas_L1_inst.o
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6   -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L2_inst.lo fflas_L2_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L2_inst.C  -fPIC -DPIC -o .libs/fflas_L2_inst.o
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6   -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L3_inst.lo fflas_L3_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L3_inst.C  -fPIC -DPIC -o .libs/fflas_L3_inst.o
/bin/sh ../../../libtool  --tag=CXX   --mode=link x86_64-pc-linux-gnu-g++ -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -lgslcblas -lgivaro -lgmpxx -lgmp  -fopenmp -version-info 1:0:0 -no-undefined -Wl,-O1 -Wl,--as-needed -o libfflas.la -rpath /usr/lib64 fflas_L1_inst.lo fflas_L2_inst.lo fflas_L3_inst.lo
libtool: link: x86_64-pc-linux-gnu-g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbeginS.o  .libs/fflas_L1_inst.o .libs/fflas_L2_inst.o .libs/fflas_L3_inst.o   /usr/lib64/libgslcblas.so /usr/lib64/libgivaro.so -lgmpxx -lgmp -Wl,--as-needed -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/crtn.o  -O2 -march=native -O2 -mmmx -msse -msse2 -msse3 -fopenmp -Wl,-O1   -fopenmp -Wl,-soname -Wl,libfflas.so.1 -o .libs/libfflas.so.1.0.0
libtool: link: (cd ".libs" && rm -f "libfflas.so.1" && ln -s "libfflas.so.1.0.0" "libfflas.so.1")
libtool: link: (cd ".libs" && rm -f "libfflas.so" && ln -s "libfflas.so.1.0.0" "libfflas.so")
libtool: link: ( cd ".libs" && rm -f "libfflas.la" && ln -s "../libfflas.la" "libfflas.la" )
strogdon commented 8 years ago

This doesn't appear to link with OPENBLAS, so something is missing.

kiwifb commented 8 years ago

yes but it links to /usr/lib64/libgslcblas.so, are you sure openblas was eselected?

strogdon commented 8 years ago

I had blas eselected to openblas, cblas to gsl. Probably not the best. But just eselecting blas to openblas is sufficient to trigger the openblas macros and includes with a normal emerge. That's the situation in the first comment. The ebuild still fails with cblas eselected to openblas.

strogdon commented 8 years ago

I'm wrong. The first comment was with cblas eselect to openblas! Building manually with the correct cblas things look better

Making all in libs
make[4]: Entering directory '/var/tmp/portage/sci-libs/fflas-ffpack-2.2.2-r1/work/fflas-ffpack-2.2.2/fflas-ffpack/interfaces/libs'
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L1_inst.lo fflas_L1_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L1_inst.C  -fPIC -DPIC -o .libs/fflas_L1_inst.o
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L2_inst.lo fflas_L2_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L2_inst.C  -fPIC -DPIC -o .libs/fflas_L2_inst.o
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o fflas_L3_inst.lo fflas_L3_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c fflas_L3_inst.C  -fPIC -DPIC -o .libs/fflas_L3_inst.o
/bin/sh ../../../libtool  --tag=CXX   --mode=link x86_64-pc-linux-gnu-g++ -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -lopenblas_openmp -lgivaro -lgmpxx -lgmp  -fopenmp -version-info 1:0:0 -no-undefined -Wl,-O1 -Wl,--as-needed -o libfflas.la -rpath /usr/lib64 fflas_L1_inst.lo fflas_L2_inst.lo fflas_L3_inst.lo
libtool: link: x86_64-pc-linux-gnu-g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbeginS.o  .libs/fflas_L1_inst.o .libs/fflas_L2_inst.o .libs/fflas_L3_inst.o   -lopenblas_openmp /usr/lib64/libgivaro.so -lgmpxx -lgmp -Wl,--as-needed -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/../../../../lib64/crtn.o  -O2 -march=native -O2 -mmmx -msse -msse2 -msse3 -fopenmp -Wl,-O1   -fopenmp -Wl,-soname -Wl,libfflas.so.1 -o .libs/libfflas.so.1.0.0
libtool: link: (cd ".libs" && rm -f "libfflas.so.1" && ln -s "libfflas.so.1.0.0" "libfflas.so.1")
libtool: link: (cd ".libs" && rm -f "libfflas.so" && ln -s "libfflas.so.1.0.0" "libfflas.so")
libtool: link: ( cd ".libs" && rm -f "libfflas.la" && ln -s "../libfflas.la" "libfflas.la" )
/bin/sh ../../../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../..  -I../../..  -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas  -fopenmp  -O2  -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11  -mmmx -msse -msse2 -msse3 -fabi-version=6 -c -o ffpack_inst.lo ffpack_inst.C
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../.. -I../../../fflas-ffpack/utils/ -I../../../fflas-ffpack/fflas/ -I../../../fflas-ffpack/ffpack -I../../../fflas-ffpack/field -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -mfpmath=sse -fabi-version=6 -DOPENBLAS_ARCH_X86_64=1 -DOPENBLAS___64BIT__=1 -I/usr/include/openblas -fopenmp -O2 -Wall -DNDEBUG -UFFLASFFPACK_DEBUG -march=native -O2 -pipe -std=gnu++11 -mmmx -msse -msse2 -msse3 -fabi-version=6 -c ffpack_inst.C  -fPIC -DPIC -o .libs/ffpack_inst.o

But this only works when done manually and not with a normal emerge or with USE=openmp ebuild fflas-ffpack-2.2.2-r1.ebuild clean compile.

strogdon commented 8 years ago

Curiously, when built manually libfflas_c.so, libffpack.so and libffpack_c.so all have linking to gslcblas and openblas_openmp:

libffpack.so:
        linux-vdso.so.1 (0x00007ffffabff000)
        libfflas.so.1 => /usr/lib64/libfflas.so.1 (0x00007f3251de2000)
        libopenblas_openmp.so.0 => /usr/lib64/libopenblas_openmp.so.0 (0x00007f32517e4000)
        libgivaro.so.9 => /usr/lib64/libgivaro.so.9 (0x00007f325158a000)
        libgmpxx.so.4 => /usr/lib64/libgmpxx.so.4 (0x00007f3251383000)
        libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007f325110d000)
        libstdc++.so.6 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libstdc++.so.6 (0x00007f3250db6000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f3250abb000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f325071c000)
        libgcc_s.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgcc_s.so.1 (0x00007f3250504000)
        libgomp.so.1 => /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/libgomp.so.1 (0x00007f32502ed000)
        libgslcblas.so.0 => /usr/lib64/libgslcblas.so.0 (0x00007f32500b0000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f324fe93000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3252437000)

even though gslcblas appears nowhere in the build.log.

strogdon commented 8 years ago

Putting gslcblas aside for the moment, I added

src_compile() {
    emake -d
}

to fflas-ffpack-2.2.2-r1.ebuild (my MAKEOPTS=-j5) and then

USE=openmp ebuild fflas-ffpack-2.2.2-r1.ebuild clean compile

This fails and the relevant results are in https://gist.github.com/strogdon/cba4c05690e25d20a7e3cb99c479beb9. Then I did

USE=openmp ebuild fflas-ffpack-2.2.2-r1.ebuild clean configure

and then make -j5 -d manually from ${WORKDIR}/fflas-ffpack and captured the output. This works and the results are in https://gist.github.com/strogdon/4b8ed04d3e4ba38e4bc2c1e4d9f5540e. In both cases the child processes to create the .lo files are created in the same order. However, when the .o files are created they are not created in the same order. So, I'm wondering if there is some subtle dependency conflict somewhere?

kiwifb commented 8 years ago

There could be. That would be very subtle if it is a parallel make issue as your whole set up seems to point too (that or some variable in the portage environment, there is another another case where I am down to that: pari tests, runs fine out of portage, barfs in portage, very similar set up and experience).

At least parallel make could be ruled out if the fault is still there with MAKEOPTS=-j1.

strogdon commented 8 years ago

It fails both in portage and when make is entered manually with MAKEOPTS=-j1. However, I have a prefix with gcc-4.9.3 that's available and there it fails in portage but builds manually - the same MAKEOPTS. But in prefix no optimization is really done. It only goes through the motions. In prefix with MAKEOPTS=-j13 it fails in portage but builds when done manually. Go figure?

strogdon commented 8 years ago

This will enable sci-libs/fflas-ffpack-2.2.2-r1[openmp] to build

diff --git a/fflas-ffpack/field/rns-double.h b/fflas-ffpack/field/rns-double.h
index 49efd2a..1f01770 100644
--- a/fflas-ffpack/field/rns-double.h
+++ b/fflas-ffpack/field/rns-double.h
@@ -454,7 +454,7 @@ namespace FFPACK {
 } // end of namespace FFPACK

 #include "rns-double.inl"
-#include "rns-double-recint.inl"
+//#include "rns-double-recint.inl"
 namespace FFLAS {

        template<>
@@ -464,4 +464,4 @@ namespace FFLAS {

 }

-#endif // __FFPACK_rns_double_H
\ No newline at end of file
+#endif // __FFPACK_rns_double_H

with gcc-4.9.3. See https://github.com/linbox-team/fflas-ffpack/issues/48#issuecomment-247060485. The problem here seems to be with how portage + gcc-4.9.3 handles

// parallel region
#define PAR_BLOCK  PRAGMA_OMP_IMPL(omp parallel)   \
    PRAGMA_OMP_IMPL(omp single)

in fflas-ffpack/paladin/parallel.h. See https://github.com/linbox-team/fflas-ffpack/issues/48#issuecomment-247508319. I see nothing wrong with the fflas-ffpack code.

kiwifb commented 7 years ago

OK I haven't done anything about this that I can remember. I suppose the fix is still needed?

strogdon commented 7 years ago

I had forgotten about this! gcc-4.9.4 is now stable on Gentoo and with it I'm able to build fflas-ffpack-2.2.2-r1 with USE=openmp.

[I] sci-libs/fflas-ffpack
     Available versions:  [m](~)1.6.0-r1^m[2] [m](~)1.6.0-r3^m[2] (~)1.6.0-r5^m[1] (~)2.2.2-r1^m[1] [m]~2.2.3^m[2] {bindist openmp static-libs CPU_FLAGS_X86="avx avx2 sse4_1"}
     Installed versions:  2.2.2-r1^m[1](07:50:28 PM 03/27/2017)(openmp -bindist -static-libs CPU_FLAGS_X86="-avx -avx2 -sse4_1")
     Homepage:            https://linbox-team.github.io/fflas-ffpack/
     Description:         FFLAS-FFPACK is a library for dense linear algebra over word-size finite fields.

[1] "sage-on-gentoo" /var/lib/layman/sage-on-gentoo
[2] "local-overlay" /usr/local/portage
kiwifb commented 7 years ago

OK, so I can just close this.