Compilation error during execution

Discussions on installation issues go here.
mblanco
Posts: 2
Joined: 18 Jul 2019, 16:48

Compilation error during execution

Postby mblanco » 18 Jul 2019, 17:10

Hello,

I am trying to build the minimal version of Polymake from source and install it locally. I am using Ubuntu 18.04, GCC 7.4, and Perl 5.26. After installing all dependencies, I managed to run the following without errors:

Code: Select all

configure -prefix=/my/installation/path make make install
However, when I try to execute the polymake binary, I get the following:

Code: Select all

bzfblanc-> ../polymake-installed/bin/polymake polymake: WARNING: Recompiling in /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt, please be patient... Compilation failed; see the error log below ninja: Entering directory `/nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt' [1/3] COMPILE /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt/apps/matroid/unimodularity-test.o FAILED: /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt/apps/matroid/unimodularity-test.o g++ -c -o /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt/apps/matroid/unimodularity-test.o -MMD -MT /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt/apps/matroid/unimodularity-test.o -MF /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/build/Opt/apps/matroid/unimodularity-test.o.d -fPIC -pipe -std=c++14 -march=native -ftemplate-depth-200 -fno-strict-aliasing -Wno-parentheses -Wshadow -fopenmp -Wno-error=unused-function -DPOLYMAKE_DEBUG=0 -DNDEBUG -O3 -DPOLYMAKE_APPNAME=matroid -DPOLYMAKE_DEFINITION_SOURCE_FILE="unimodularity-test.cpp" -I/nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/include/app-wrappers -I/nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/include/apps -I/local/bzfblanc/polymake-installed/include/polymake/external -I/local/bzfblanc/polymake-installed/include /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp && : 'COMPILER_USED=7.4.0' /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp: In function 'pm::perl::Object polymake::matroid::construct_decomposition_tree(unimod::decomposed_matroid*)': /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:47:103: error: no matching function for call to 'pm::perl::Object::Object(const char*)' perl::Object result(leaf != NULL ? "MatroidDecompositionLeaf" : "MatroidDecompositionSeparation"); ^ In file included from /local/bzfblanc/polymake-installed/include/polymake/client.h:26:0, from /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:3: /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:184:4: note: candidate: pm::perl::Object::Object(pm::perl::Object&&) Object(Object&& o) noexcept ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:184:4: note: no known conversion for argument 1 from 'const char*' to 'pm::perl::Object&&' /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:182:4: note: candidate: pm::perl::Object::Object(const pm::perl::Object&) Object(const Object& o); ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:182:4: note: no known conversion for argument 1 from 'const char*' to 'const pm::perl::Object&' /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:175:4: note: candidate: template<class ... Params> pm::perl::Object::Object(const polymake::AnyString&, polymake::mlist<T ...>, const pm::perl::Object&) Object(const AnyString& type_name, mlist<Params...> params, const Object& src) ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:175:4: note: template argument deduction/substitution failed: /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:47:103: note: candidate expects 3 arguments, 1 provided perl::Object result(leaf != NULL ? "MatroidDecompositionLeaf" : "MatroidDecompositionSeparation"); ^ In file included from /local/bzfblanc/polymake-installed/include/polymake/client.h:26:0, from /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:3: /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:171:4: note: candidate: pm::perl::Object::Object(const polymake::AnyString&, const pm::perl::Object&) Object(const AnyString& type_name, const Object& src) ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:171:4: note: candidate expects 2 arguments, 1 provided /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:169:4: note: candidate: pm::perl::Object::Object(const pm::perl::ObjectType&, const pm::perl::Object&) Object(const ObjectType& type, const Object& src); ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:169:4: note: candidate expects 2 arguments, 1 provided /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:165:4: note: candidate: template<class ... Params> pm::perl::Object::Object(const polymake::AnyString&, polymake::mlist<T ...>, const polymake::AnyString&) Object(const AnyString& type_name, mlist<Params...> params, const AnyString& name=AnyString()) ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:165:4: note: template argument deduction/substitution failed: /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:47:103: note: candidate expects 3 arguments, 1 provided perl::Object result(leaf != NULL ? "MatroidDecompositionLeaf" : "MatroidDecompositionSeparation"); ^ In file included from /local/bzfblanc/polymake-installed/include/polymake/client.h:26:0, from /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:3: /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:160:13: note: candidate: pm::perl::Object::Object(const polymake::AnyString&, const polymake::AnyString&) explicit Object(const AnyString& type_name, const AnyString& name=AnyString()) ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:160:13: note: no known conversion for argument 1 from 'const char*' to 'const polymake::AnyString&' /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:157:13: note: candidate: pm::perl::Object::Object(const pm::perl::ObjectType&, const polymake::AnyString&) explicit Object(const ObjectType& type, const AnyString& name=AnyString()); ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:157:13: note: no known conversion for argument 1 from 'const char*' to 'const pm::perl::ObjectType&' /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:154:4: note: candidate: pm::perl::Object::Object() Object() : obj_ref(nullptr) {} ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:154:4: note: candidate expects 0 arguments, 1 provided /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:147:13: note: candidate: pm::perl::Object::Object(sv*) explicit Object(SV* ref_arg) ^~~~~~ /local/bzfblanc/polymake-installed/include/polymake/perl/Object.h:147:13: note: no known conversion for argument 1 from 'const char*' to 'sv*' /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp: In function 'pm::perl::ListReturn polymake::matroid::is_totally_unimodular(const pm::Matrix<pm::Integer>&, pm::perl::OptionSet)': /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:82:45: error: 'const class pm::Integer' has no member named 'to_int' input_matrix(r, c) = matrix(r, c).to_int(); ^~~~~~ /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp: In function 'bool polymake::matroid::is_unimodular_plain(const pm::Matrix<pm::Integer>&)': /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:139:45: error: 'const class pm::Integer' has no member named 'to_int' input_matrix(r, c) = matrix(r, c).to_int(); ^~~~~~ /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp: In function 'bool polymake::matroid::is_strongly_unimodular_plain(const pm::Matrix<pm::Integer>&)': /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:154:45: error: 'const class pm::Integer' has no member named 'to_int' input_matrix(r, c) = matrix(r, c).to_int(); ^~~~~~ /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp: In function 'pm::perl::ListReturn polymake::matroid::is_k_modular_compute(const pm::Matrix<pm::Integer>&)': /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:170:45: error: 'const class pm::Integer' has no member named 'to_int' input_matrix(r, c) = matrix(r, c).to_int(); ^~~~~~ /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp: In function 'pm::perl::ListReturn polymake::matroid::is_strongly_k_modular_compute(const pm::Matrix<pm::Integer>&)': /nfs/optimi/kombadon/bzfblanc/misc/polymake/unimodularity-library-Polymake-1.1/apps/matroid/src/unimodularity-test.cpp:189:45: error: 'const class pm::Integer' has no member named 'to_int' input_matrix(r, c) = matrix(r, c).to_int(); ^~~~~~ ninja: build stopped: subcommand failed.
If it helps, I also get the following warnings during compilation:

Code: Select all

Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
I didn't find a way to add these flags, there are recognized neither by make nor by the configure script.

Any ideas on how to fix the problem?

User avatar
gawrilow
Main Author
Posts: 404
Joined: 25 Dec 2010, 17:40

Re: Compilation error during execution

Postby gawrilow » 18 Jul 2019, 19:01

I reckon, it's your own code or something contributed by your colleagues, because there is no such file "unimodularity-test.cpp" in the polymake sources.

The error is easy to fix if you follow the compiler error messages:

Code: Select all

no matching function for call to 'pm::perl::Object::Object(const char*)' ... candidate: pm::perl::Object::Object(const polymake::AnyString&, const polymake::AnyString&) explicit Object(const AnyString& type_name, const AnyString& name=AnyString()) ^~~~~~
Just wrap both string literals in AnyString:

Code: Select all

perl::Object result(leaf != nullptr ? AnyString("MatroidDecompositionLeaf") : AnyString("MatroidDecompositionSeparation"));
Regarding Java warnings about deprecated API: just ignore them. They come from jReality, not from polymake own code. There is nothing you could do about them, but they are absolutely harmless.

mblanco
Posts: 2
Joined: 18 Jul 2019, 16:48

Re: Compilation error during execution

Postby mblanco » 19 Jul 2019, 12:15

Thank for your reply. It was indeed something in my $HOME/.polymake directory, which had been there since the last time I used Polymake, 5 years ago. I deleted the directory and now everything works :)


Return to “Installing polymake”

cron