cschwan / sage-on-gentoo

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

sci-mathematics/singular-4.0.3_p3 fails to build in Prefix #436

Closed strogdon closed 7 years ago

strogdon commented 8 years ago

So I have the following

/storage/strogdon/gentoo-rap/bin/bash ./libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.  -I./include -I./include -I. -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3 -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3     -DSING_NDEBUG -DOM_NDEBUG   -march=native -O0 -pipe -g -ggdb -fPIC -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks -c -o cfGcdAlgExt.lo cfGcdAlgExt.cc
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I./include -I./include -I. -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3 -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3 -DSING_NDEBUG -DOM_NDEBUG -march=native -O0 -pipe -g -ggdb -fPIC -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks -c cfGcdAlgExt.cc  -fPIC -DPIC -o .libs/cfGcdAlgExt.o
cfGcdAlgExt.cc: In function ‘void tryExtgcd(const CanonicalForm&, const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, CanonicalForm&, bool&)’:
cfGcdAlgExt.cc:955:173: error: ‘void tryExtgcd(const CanonicalForm&, const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, CanonicalForm&, bool&)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
 static void tryExtgcd( const CanonicalForm & F, const CanonicalForm & G, const CanonicalForm & M, CanonicalForm & result, CanonicalForm & s, CanonicalForm & t, bool & fail )
                                                                                                                                                                             ^
In file included from cfGcdAlgExt.cc:27:0:
cfGcdAlgExt.h:29:6: note: previous declaration of ‘void tryExtgcd(const CanonicalForm&, const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, CanonicalForm&, bool&)’
 void tryExtgcd( const CanonicalForm & F, const CanonicalForm & G, const CanonicalForm& M, CanonicalForm & result, CanonicalForm & s, CanonicalForm & t, bool & fail );
      ^
make[4]: *** [Makefile:1205: cfGcdAlgExt.lo] Error 1
make[4]: Leaving directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3/factory'
make[3]: *** [Makefile:1289: all-recursive] Error 1
make[3]: Leaving directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3/factory'
make[2]: *** [Makefile:975: all] Error 2
make[2]: Leaving directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3/factory'
make[1]: *** [Makefile:652: all-recursive] Error 1
make[1]: Leaving directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3'
make: *** [Makefile:462: all] Error 2

This was with MAKEOPTS=-j1 to rule out parallel building. Builds fine on Gentoo. Is there a syntax problem?

kiwifb commented 8 years ago

Sort of. I am guessing the gcc you have on prefix is less permissive by default. You have 5.4.0? It works here with 5.3.0 but I should move on to at least 5.4.0. The build indicate that adding -fpermissive to CXXFLAGS should solve that particular problem. Do you think I should add it by default? Considering I am more or less working on getting things compiled with clang that's a new red flag.

strogdon commented 8 years ago

Yes I have 5.4.0. Let me try it with -fpermissive to see if that fixes things.

strogdon commented 8 years ago

Adding -fpermissive to CXXFLAGS allowed it to build. I think I remember a Sage ticket where -fpermissive had to be added. I think the givaro, fflas-ffpack, linbox ticket. It's your call as to whether to add it as default. I can always fix it up here. If not fixed then the issue will be here in case a Gentoo user ventures to gcc-5.4.0.

strogdon commented 8 years ago

Unless one knows how to fix the code?

kiwifb commented 8 years ago

Fixing the code is upstream problem. I guess I can pass it on. I should check first if they took care of this in master.

kiwifb commented 8 years ago

"static" keyword introduced here https://github.com/Singular/Sources/commit/c7afbd34f1aae46fbf47925ff2246e5f42f4ca08 I am guessing they forgot to touch the header at the same time.

strogdon commented 8 years ago

Yes, fixing the header is what's needed.

kiwifb commented 8 years ago

And in other news, the ebuild install fine with clang-3.7.1 on Gentoo. Let's see what upstream make of it.

kiwifb commented 8 years ago

There must be something else helping to trigger this (it still needs to be fixed I think). singular just build without so much as a warning for me in Gentoo with gcc-5.4.0. The only difference is in CXXFLAGS where I adopt a non-debug profile for singular (since building a debugging version of singular is more complicated than that). So I have -O2 -march=native instead of -O0 -g -ggdb.

strogdon commented 8 years ago

I have the same failure without the debugging profile

/storage/strogdon/gentoo-rap/bin/bash ./libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I.  -I./include -I./include -I. -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3 -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3     -DSING_NDEBUG -DOM_NDEBUG   -march=native -O2 -pipe -fPIC -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks -c -o cfGcdAlgExt.lo cfGcdAlgExt.cc
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I./include -I./include -I. -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3 -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/singular-4.0.3_p3/work/singular-4.0.3 -DSING_NDEBUG -DOM_NDEBUG -march=native -O2 -pipe -fPIC -fno-common -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-rtti -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks -c cfGcdAlgExt.cc  -fPIC -DPIC -o .libs/cfGcdAlgExt.o
cfGcdAlgExt.cc: In function ‘void tryExtgcd(const CanonicalForm&, const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, CanonicalForm&, bool&)’:
cfGcdAlgExt.cc:955:173: error: ‘void tryExtgcd(const CanonicalForm&, const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, CanonicalForm&, bool&)’ was declared ‘extern’ and later ‘static’ [-fpermissive]
 static void tryExtgcd( const CanonicalForm & F, const CanonicalForm & G, const CanonicalForm & M, CanonicalForm & result, CanonicalForm & s, CanonicalForm & t, bool & fail )
                                                                                                                                                                             ^
In file included from cfGcdAlgExt.cc:27:0:
cfGcdAlgExt.h:29:6: note: previous declaration of ‘void tryExtgcd(const CanonicalForm&, const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm&, CanonicalForm&, bool&)’
 void tryExtgcd( const CanonicalForm & F, const CanonicalForm & G, const CanonicalForm& M, CanonicalForm & result, CanonicalForm & s, CanonicalForm & t, bool & fail );
      ^
make[4]: *** [Makefile:1205: cfGcdAlgExt.lo] Error 1

Now of course my gcc was built using the debugging profile.

strogdon commented 8 years ago

I reverted to gcc-4.9.3 in my prefix and the failure is still there. Perhaps it is due to how my gcc was built. 4.9.3 was also built with debugging turned on.

kiwifb commented 8 years ago

Possible I have checked and my own gcc was build without debugging.

strogdon commented 8 years ago

Hmm. Rebuilt gcc-5.4.0 without debugging and I still get the failure when building singular. No debugging in singular either. I think there is definitely a syntax problem in singular but I don't see why there's a problem only in prefix?

strogdon commented 7 years ago

I just noticed that I have singular-4.0.3_p4 installed and there were no build issues. singular-4.0.3_p5 also builds without issue. It's not clear to me what has changed. The factory/cfGcdAlgExt.h header is unchanged. singular-4.0.3_p3 still fails. There must be something very subtle.

kiwifb commented 7 years ago

Must be. 4.1.0 is coming and hopefully, without any issues.

kiwifb commented 7 years ago

Is this still a problem?

strogdon commented 7 years ago

I now have singular-4.1.0_p1-r1 from the overlay installed and 4.1.0_p2 builds without issue. So I would say this is safe to close.