## Problems with the installation under Ubuntu 11.04

Discussions on installation issues go here.
hampe
Developer
Posts: 45
Joined: 29 Apr 2011, 10:42

The result was

Code: Select all

~/bin/polymake/polymake-2.10/build.x86_64/external/nauty$sh -c "CC=/usr/local/bin/gcc-4.4.6 ../../../external/nauty/configure; rm Makefile" loading cache ./config.cache checking host system type... configure: error: can not guess host type; you must specify one  keilen Posts: 6 Joined: 02 Jun 2011, 15:41 ### Re: Problems with the installation under Ubuntu 11.04 Benjamins advise Code: Select all make -C build.i686/external/nauty  helped to create nauty.h and whatever was supposed to be in build.i686/external/nauty. However, I now get a new error message, which seems to be caused by javaview: Code: Select all /usr/bin/perl perl/polymake --iscript configure_java Please confirm the path to javaview start script or enter an alternative location: [program path] > /usr/share/javaview/bin/javaview polymake: ERROR: Undefined subroutine &Java::Configure::find_jni_headers called at /home/keilen/Computeralgebra/Polymake/polymake/scripts/configure_java line 25. make: *** [compile-java-native] Fehler 1  I should note, that also in the running installation of polymake javaview does not work any more and I get basically the same error message about the undefined subroutine. blorenz Developer Posts: 109 Joined: 10 Jan 2011, 17:21 ### Re: Problems with the installation under Ubuntu 11.04 Code: Select all make -C build.i686/external/nauty  helped to create nauty.h and whatever was supposed to be in build.i686/external/nauty. I don't know why they haven't been created automatically but at least this helped for you. However, I now get a new error message, which seems to be caused by javaview: Code: Select all polymake: ERROR: Undefined subroutine &Java::Configure::find_jni_headers called at /home/keilen/Computeralgebra/Polymake/polymake/scripts/configure_java line 25. This is a known bug which has been fixed in 2.10 or can be fixed by adding one line in scripts/configure_java: Change Code: Select all reconfigure("javaview.rules");  to Code: Select all reconfigure("java.rules"); reconfigure("javaview.rules");  PS: Alternatively, removing the configuration directory ~/.polymake would also resolve this issue but only until you run configure (and make) again. blorenz Developer Posts: 109 Joined: 10 Jan 2011, 17:21 ### Re: Problems with the installation under Ubuntu 11.04 The result was Code: Select all ~/bin/polymake/polymake-2.10/build.x86_64/external/nauty$ sh -c "CC=/usr/local/bin/gcc-4.4.6 ../../../external/nauty/configure; rm Makefile" loading cache ./config.cache checking host system type... configure: error: can not guess host type; you must specify one 
First, the makefile in this command was deliberately with a lower-case "m" as this configure script of nauty creates its own makefile which needs to be deleted after a successful run of this script. The Makefile with upper-case "M" is the polymake Makefile for nauty and should have been kept but can be recreated by running the main configure again.

Second, it seems that the autoconf scripts bundled with our nauty package are somewhat outdated and fail to generate a proper name for your system. What kind of CPU do you have and what is the output of /usr/local/bin/gcc-4.4.6 -v ?

Theoretically you should be able to specify your own host type by executing:

Code: Select all

sh -c "CC=/usr/local/bin/gcc-4.4.6 ../../../external/nauty/configure x86_64-unknown-linux-gnu && rm makefile" 
and/or adding this host type to the similar looking command in ext_lib/nauty/Makefile.inc:

Code: Select all

override _dummy := $(shell$(_hide) CC=$(CC) CFLAGS="$(Cflags)" $(src)/configure x86_64-unknown-linux-gnu --quiet 2>/dev/null; rm makefile$(_restore)) 
But i fear that this might not work as those script dont even accept x86_64 as architecture.

hampe
Developer
Posts: 45
Joined: 29 Apr 2011, 10:42

### Re: Problems with the installation under Ubuntu 11.04

1) cat /proc/cpuinfo yields two processors, both with the following properties:

vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T8300 @ 2.40GHz

2) ~/bin/polymake/polymake-2.10/build.x86_64/external/nauty$/usr/local/bin/gcc-4.4.6 -v Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.4.6/configure --prefix=/usr/local --program-suffix=-4.4.6 --enable-languages=c,c++ --enable-version-specific-runtime-libs Thread model: posix gcc version 4.4.6 (GCC) 3) I tried the commands and got: ~/bin/polymake/polymake-2.10/build.x86_64/external/nauty$ sh -c "CC=/usr/local/bin/gcc-4.4.6 ../../../external/nauty/configure x86_64-unknown-linux-gnu && rm makefile"
configure: warning: x86_64-unknown-linux-gnu: invalid host type
creating cache ./config.cache
checking host system type... Invalid configuration x86_64-unknown-linux-gnu': machine x86_64-unknown' not recognized

checking for gcc... /usr/local/bin/gcc-4.4.6
checking whether the C compiler (/usr/local/bin/gcc-4.4.6 ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

P.S.: Will be on vacation the next four days, so further experiments will have to wait until monday

blorenz
Developer
Posts: 109
Joined: 10 Jan 2011, 17:21

### Re: Problems with the installation under Ubuntu 11.04

Seems to be a problem with the gcc you have built.
There should be a config.log in the directory where you ran those commands, can you attach it to a post?

hampe
Developer
Posts: 45
Joined: 29 Apr 2011, 10:42

### Re: Problems with the installation under Ubuntu 11.04

Got it working!

Thanks to your hint, I looked into the config.log and found out that gcc was simply not finding libgcc, so I had to add an LDFLAGS="-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/lib64/". Afterwards, when running "sh -c ...", it still warned me that the architecture x86... was not known, but finished without an error. I added the line you posted to the Makefile.inc and ran make and make install in the main polymake dir, which finished without errors. I now run polymake 2.10 Thanks for helping me out!

The strange perl problem I mentioned earlier has, however, not vanished. I ran the same commands immediately after the installation of polymake and it actually worked. After restarting polymake because I had made some changes in an unrelated piece of code, it recompiled shared modules for common. Then, when I called the commands, I again got

Code: Select all

/tmp/poly6812Taaaa0001.cc: In static member function âstatic sv* polymake::tropical::IndirectFunctionWrapper<Fptr>::call(Fptr*, sv**, char*) [with Fptr = pm::type2type<pm::perl::Object(pm::perl::Object, pm::Vector<pm::Rational>)>]â: /tmp/poly6812Taaaa0001.cc:7: error: âfuncâ cannot be used as a function make: *** [/tmp/poly6812Taaaa0001.o] Error 1 
I know this is probably hard to diagnose from afar, but just in case someone has seen something similar or has an idea, I'm also posting the poly....cc-file mentioned in the error:

Code: Select all

#include <unistd.h> namespace { void delete_temp_file() __attribute__((destructor)); void delete_temp_file() { unlink("/tmp/poly6812N1_aaaa0001.so"); } } namespace polymake { namespace tropical { FunctionWrapper4perl( pm::type2type<perl::Object (perl::Object, pm::Vector<pm::Rational>)> ) { perl::Value arg0(stack[0]), arg1(stack[1]); IndirectWrapperReturn( arg0, arg1.get< perl::TryCanned< const Vector< Rational > > >() ); } FunctionWrapperInstance4perl( pm::type2type<perl::Object (perl::Object, pm::Vector<pm::Rational>)> ); } } 

gawrilow
Main Author
Posts: 368
Joined: 25 Dec 2010, 17:40

### Re: Problems with the installation under Ubuntu 11.04

A healthy gcc does not require such weird settings. I strongly suspect your installation is seriously corrupted, messed up, or just ill-born. I would suggest to install a clean gcc out of the box (4.3, 4.4, or 4.6) completely aside the system compiler, and then reconfigure and rebuild polymake from scratch using it:

Code: Select all

./configure CC=gcc-sane CXX=g++-sane make make install 

hampe
Developer
Posts: 45
Joined: 29 Apr 2011, 10:42

### Re: Problems with the installation under Ubuntu 11.04

I tried installing gcc-4.4.3 (which is the same I run on my office PC, where everything works) in the same manner Michael Joswig suggested. I get exactly the same problem (i.e. I have to specify LDFLAGS because it doesn't find the libgcc). I suppose I'm simply not experienced enough in compiling compilers to see what I do wrong

I can compile polymake without any problems with the native gcc-4.4 (which is actually 4.4.5), but then again I stil get the strange compilation error during runtime I mentioned before. So it does indeed seem to be a problem with the system, that probably occured during the update from lucid to natty. Since this is most probably impossible to diagnose from afar and since I don't want to reinstall my OS, I'll simply stick to working only on my office computer and not changing anything there (especially not updating...) Still, thanks for your help!

hampe
Developer
Posts: 45
Joined: 29 Apr 2011, 10:42

### Re: Problems with the installation under Ubuntu 11.04

I have to revise my position from the last post: The problem is NOT restricted to my own laptop. Thomas Markwig tried to run my extension under polymake 2.9.10 on his own Kubuntu Natty laptop and had the exact same problem. So it seems this is not a personal issue with some installation mess-up, but a general problem with the new (K)ubuntu.

Also, I seem to have localised the problem, more precisely: I know how to cause it: First of all it only appears for c++ functions that have been linked via the Function4perl macro (UserFunction4perl is fine). To reproduce it, I have to do the following:
- Assuming I have a fresh polymake installation, before importing the extension, I remove the wrap-*.cc file that corresponds to the cc-file containing my function (Also works if there is no wrap-*.cc file to begin with).
- Then, when importing the extension and calling that function, I will get the compilation error mentioned above.

In fact, the contents of the temporary file are more or less those of the wrap-*.cc file. So it seems that compiling this wrapper-file with the standard make command in the extension directory or by importing the extension is fine. However, when compiling it during runtime, this fails. Since the new gcc seems to cause so many troubles: Is it possible that polymake uses a different compiler when doing the runtime compilation of the wrappers?