bertiniteam / b2

Bertini 2.0: The redevelopment of Bertini in C++.
88 stars 34 forks source link

installation error in configure #162

Closed derandomization closed 2 years ago

derandomization commented 2 years ago

Hello, I am trying to install your cool library.

I am installing it via WSL on windows.

I am getting the following error when running configure: configure: error: unable to find include/bertini2 directory at standard locations (/usr /usr/local /opt /opt/local)

Background:

  1. I am using apt as a package manager (and anaconda for python stuff).
  2. I cloned the git into /opt (so that I have /opt/b2)
  3. I got the error described above. I do have the folder include just inside b2/core, so I copied it from there to /opt to try and solve this, but then got a new error: configure: error: unable to find lib directory for bertini2 symmetric to include directory /opt/include/bertini2

Could you help me solve this?

PS: A step before I got

Testsuite summary for b2 2.0-alpha6 ============================================================================ # TOTAL: 10 # PASS: 9 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 ============================================================================ See ./test-suite.log Please report to amethyst@uwec.edu

but ignored it and kept going (leading the errors I described above)

derandomization commented 2 years ago

The content of test-suite.log is:

Running 393 test cases... test/classes/boost_multiprecision_test.cpp(137): error: in "boost_multiprecision/precision_complex_rational_add": check c.precision() == 30 has failed [646392383 != 30] test/classes/boost_multiprecision_test.cpp(243): error: in "boost_multiprecision/precision_complex_longlong_div_set_float_16digits": check result.precision() == 16 has failed [19 != 16]

*** 2 failures are detected in the test module "Bertini 2 Class Testing" FAIL b2_class_test (exit status: 201)

ofloveandhate commented 2 years ago

Thanks for your comment.

Does this answer your question?

ofloveandhate commented 2 years ago

It's also possible that you need to adjust the LD_RUN_PATH and LD_LIBRARY_PATH variables to include the location you've installed bertini2 to.

ofloveandhate commented 2 years ago

also, thanks for trying my software. i hope we (i) can find a way to make it useful for you. it's definitely not as mature as bertini1 is, so if you're looking for a mature software for solving polynomial systems, bertini 1 may be a better bet. Otherwise, if you're into experimentation, maybe b2 is a cool option. certainly, there aren't python bindings for b1.

derandomization commented 2 years ago

Wow thanks for the quick reply! I was feeling hopeless. I would like to solve polynomial equations but preferably access it via sage\python, so if your library does this it's precisely what I want (are there disadvantages I should be aware of? What I'm trying to do is find all real solutions for a system of polynomial equations).

I was using the fast summary, now I tried to go through the precise guide. Apparently already ./configure in b2/core fails on my end by not finding Boost multiprecision, so it's certainly a problem on my end, my bad (Error: checking for Boost.Multiprecision as part of the found Boost installation: -I/usr/include... configure: error: unable to find).

I am attempting to fix it (sorry I am slightly new to linux, I switched in order to use your program); I used apt-install libboost-all-dev and libboost-python-dev to have all the boost libraries. I have a folder /usr/include/boost/multiprecision, and my boost version is 107100.

I am not sure about the following influential variables that appear in config --help which feel relevant and those you commented on. These are what I set them to:

  1. LD_LIBRARY_PATH='/opt/b2; /usr/include/boost'
  2. LD_RUN_PATH='/opt/b2; /usr/include/boost'
  3. LT_SYS_LIBRARY_PATH='/opt/b2; /usr/include/boost'

Could you tell me what I'm doing wrong?

derandomization commented 2 years ago

I can compile a c++ program containing boost multi precision by running g++ with no flags on my shell (the program you have in ./configure, that just includes the library and does using).

ofloveandhate commented 2 years ago

I'm not immediately sure what the problem with finding boost is.

derandomization commented 2 years ago

Thanks, I changed but am still getting the error. I am attaching the config.log config.log g

Noteably BOOST_CPPFLAGS='-I/usr/include'

ofloveandhate commented 2 years ago

I extracted the relevant part of config.log:

configure:13683: checking for Boost.Multiprecision as part of the found Boost installation: -I/usr/include
configure:13701: /opt/anaconda/anaconda3/envs/sage/bin/x86_64-conda-linux-gnu-c++ -c -fvisibility-inlines-hidden -std=c++17 -fmessage-length=0 -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /opt/anaconda/anaconda3/envs/sage/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /opt/anaconda/anaconda3/envs/sage/include -I/usr/include conftest.cpp >&5
In file included from /usr/include/boost/config/stdlib/libstdcpp3.hpp:78,
                 from /usr/include/boost/config.hpp:49,
                 from /usr/include/boost/multiprecision/cpp_dec_float.hpp:19,
                 from conftest.cpp:28:
/usr/include/unistd.h:869:11: fatal error: bits/getopt_posix.h: No such file or directory
  869 | # include <bits/getopt_posix.h>
      |           ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
configure:13701: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "b2"
| #define PACKAGE_TARNAME "b2"
| #define PACKAGE_VERSION "2.0-alpha6"
| #define PACKAGE_STRING "b2 2.0-alpha6"
| #define PACKAGE_BUGREPORT "amethyst@uwec.edu"
| #define PACKAGE_URL "http://github.com/bertiniteam/b2"
| #define PACKAGE "b2"
| #define VERSION "2.0-alpha6"
| #define HAVE_CXX14 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_DLFCN_H 1
| #define LT_OBJDIR ".libs/"
| #define BMP_EXPRESSION_TEMPLATES 1
| #define HAVE_EIGEN_DENSE 1
| #define HAVE_BOOST /**/
| /* end confdefs.h.  */
| 
|              #include <boost/multiprecision/cpp_dec_float.hpp>
| int
| main ()
| {
| using boost::multiprecision::cpp_dec_float_50;
|                    return 0;
|   ;
|   return 0;
| }
configure:13716: error: unable to find Boost Multiprecision.  See `config.log`.

I think the most important part is this:

/usr/include/unistd.h:869:11: fatal error: bits/getopt_posix.h: No such file or directory
  869 | # include <bits/getopt_posix.h>
ofloveandhate commented 2 years ago

The core succeeded, but this didn't? Hmm. Can you please post config.log from the core, so we can compare?

ofloveandhate commented 2 years ago

for the record, I've never tried compiling the way you are (Windows subsystem and anaconda). I do not currently have a windows box for me to try this, either.

I do know that mixing Python from Anaconda and apt is likely to break. I suspect that if you want to use Python from Anaconda, you should compile boost and boost-python using the same set of tools. Otherwise, we're likely to get version mismatches / binary incompatibilities, unless magically the Anaconda tools are built from the same versions as apt provides.

ofloveandhate commented 2 years ago

this thread indicates that anaconda could possibly provide Boost and Boost-python. The only extras we'd need on top would be gmp/mpfr/mpc. I suspect that the gmpy package might bring those.

derandomization commented 2 years ago

The core succeeded, but this didn't? Hmm. Can you please post config.log from the core, so we can compare?

No, this is all happening in the core.

for the record, I've never tried compiling the way you are (Windows subsystem and anaconda). I do not currently have a windows box for me to try this, either.

I do know that mixing Python from Anaconda and apt is likely to break. I suspect that if you want to use Python from Anaconda, you should compile boost and boost-python using the same set of tools. Otherwise, we're likely to get version mismatches / binary incompatibilities, unless magically the Anaconda tools are built from the same versions as apt provides.

Interesting, I thought anaconda is for python packages and apt for system ones, but boost-python does sound suspiciously like a python library. I'll try using anaconda to install them like you suggest

ofloveandhate commented 2 years ago

I'm trying to get a working c++ compilation environment using conda packages.

ofloveandhate commented 2 years ago

Are you hoping to call Bertini 2 from Sage? It looks like you have a sage env in conda.

ofloveandhate commented 2 years ago

The more I look at your logfile, the more I think

Despite an hour of effort, I have not yet gotten through even the first level of ./configure for the core, so I'm not sure how to help. I wish it was easier to spin up a virtual windows machine. I see this option, but don't have the time to go down that road at the moment.

Let me know what you find, @derandomization . I'm hoping that you succeed in compiling against Anaconda, so that you can import into sage or jupyter or whatever. I'd much rather support you in running code and adding features than in compiling/building, ha.

derandomization commented 2 years ago

I'm trying to get a working c++ compilation environment using conda packages.

Yes

The more I look at your logfile, the more I think

  • you already have compilers installed through anaconda
  • the version of Boost through apt is fighting with the Anaconda compilers.
  • You can install boost, boost-python, and gmp/mpfr/mpc through anaconda, and things may just work.

Despite an hour of effort, I have not yet gotten through even the first level of ./configure for the core, so I'm not sure how to help. I wish it was easier to spin up a virtual windows machine. I see this option, but don't have the time to go down that road at the moment.

Let me know what you find, @derandomization . I'm hoping that you succeed in compiling against Anaconda, so that you can import into sage or jupyter or whatever. I'd much rather support you in running code and adding features than in compiling/building, ha.

Okay I'll try this. I will probably give up fast if it doesn't work though since I lack a fighting spirit. Would you have a recommendation in this case for a program callable from sage that solves polynomial equations?

I'd also love to reach the stage after compiling haha, it's so frustrating. I don't think I've successfully installed a library.

ofloveandhate commented 2 years ago

Would you have a recommendation in this case for a program callable from sage that solves polynomial equations?

I don't know of a library. I poked around, and was hoping that maybe PHCpack would offer bindings for Sage, as members of that research group had talked about writing them. I didn't find them -- maybe I just didn't look in the right places.

I suggest you try googling around, see if you can find Sage / Python interfaces for PHCpack, Hom4PS, etc. If that doesn't yield what you want, and you don't want to write an interface yourself, you should consider using Macaulay 2, which has interfaces to a number of polynomial solvers, and an active community of developers and users.

I'll say that I have automated much of the process for working with Bertini 1 through Matlab, by writing input files, calling Bertini, and parsing output. It wouldn't be so hard to write some Python code that does the same. Just formulate your system, write to the Bertini 1 input format, and do a system call to Bertini. Then, parse the output back into Sage. I can't offer support here in this issue. But the process isn't too hard.

I'll add one more note -- a link to a repo called python-bertini. The readme says it's not ready for installation by others. Maybe you'd still be successful?

Hoping this helps!

derandomization commented 2 years ago

@ofloveandhate Hi,

I uninstalled all my Conda environment and now I am able to install bertini2 :)

I reinstalled sage manually and they now run smoothly next to each other (Although I cannot import your package in sage. But that's okay).

My question now is not an issue, since everything was compiled perfectly, and I cannot find it in the documentation, is there a standard plotter inside or should I use mathplotlib?

ofloveandhate commented 2 years ago

There are no plotters provided as part of pybertini / bertini2. Use matplotlib.

ofloveandhate commented 2 years ago

I'm going to close this issue, as it seems like you were able to get things compiled. If you have usage questions, start a new issue please.