mppp icon indicating copy to clipboard operation
mppp copied to clipboard

Cannot build mp++ 0.9

Open axelvan22 opened this issue 3 years ago • 8 comments

Hi,

I'm trying to install the version 0.9 of mp++ to make piranha work but I meet some problems to build the former.

It's related to the issue https://github.com/bluescarni/piranha/issues/150?_pjax=%23js-repo-pjax-container#issuecomment-809443201 .

I had to make a cmake . command before the cmake --build . --target install because of the missing of CMakeCache.txt . And yet there are errors. Here is the one for the original cmake . command : CMake Error at C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message): Could NOT find GMP (missing: GMP_INCLUDE_DIR GMP_LIBRARY)

And here's the one for the next command : MSBUILD : error MSB1009: Project file does not exist. Switch: install.vcxproj

Can you please tell me what I'm doing wrong?

Axel

axelvan22 avatar Mar 29 '21 15:03 axelvan22

@axelvan22 Is there a specific reason why you are trying to build and install version 0.9? That version is more than 3 years old and is internally somewhat different than the most recent version 0.23 (not released). I am also not sure how well the Microsoft version of cmake deals with the old cmake files? To answer the question I don't remember even seeing such a build error. The most recent problem I ran into was an issue with linking boost.

Hartmuth

7ofNine avatar Mar 30 '21 14:03 7ofNine

Hi Hartmuth,

As jbx1 mentionned in https://github.com/bluescarni/piranha/issues/150 , I'm trying to launch this planner https://github.com/KCL-Planning/SMTPlan . It requires the version 0.9 of mp++ and jbx1 was able to make to compile it, which I need as well for the planner to work. Also I managed to link boost before having to install mp++.

Axel

axelvan22 avatar Mar 30 '21 15:03 axelvan22

O.K. good reason. I can set it up and try. I am sure I once was able to build and install it. Currently the oldest version I have, because of some old software I am in the process to move to the recent world, is version 0.13 and that works fine even with VS 2019. I'll try.

7ofNine avatar Mar 30 '21 16:03 7ofNine

Thank you for your help!

I didn't try it again today, I'll get into it once I'm done with my current work.

I'm sure it would be easier to install it on Linux but the company I work for gave me a PC...

axelvan22 avatar Mar 30 '21 16:03 axelvan22

@axelvan22 I just built (tests not benchmarks) version 0.9 and didn't encounter any problem or tweak up to the install. This was with VS2019 16.10.0 preview 1 and default setting for the language i.e. C++14. But this was using the command line cmake + cmake GUI. I only used the visual studio version a while ago and it still had a lot of problems. I'll give it a try to see how this variant behaves.

7ofNine avatar Mar 30 '21 18:03 7ofNine

@axelvan22 I just tried to generate with cmake in Visual studio and have trouble with keeping some settings but as such I have not encountered a problem with the CmakeFile.txt itself. But reading your original message I wonder if you know how to use CMAKE? I kind of get the impression from your description that you are missing some steps. On the side use CmakeGui. Much easier to handle and doesn't require remembering command line arguments. It also gives some ideas what to do next.

first : configure (creates the cache) second: generate (creates the project files)

7ofNine avatar Mar 30 '21 19:03 7ofNine

Hi,

I'm now installing it on a ubuntu 18.04 distribution. In fact I don't know how to use cmake... I've been following the steps in https://bluescarni.github.io/mppp/installation.html#installation-from-source and the first command is cmake --build . but I tried it just after installing the tar.gz file of mp++ .

How can I create the cache file?

axelvan22 avatar Apr 02 '21 14:04 axelvan22

@axelvan22 I never used the command line. Especially under windows there is a rather comfortable gui which gets installed with cmake. This tool would show you two buttons at the bottom. One saying configure and the second generate. This gives you the steps to execute. But first you have to select your build folder. That is where the cache and all the generated build files will be created. It's actually self evident after opening the gui what one needs. What is also needed are the additional header and files and libraries.Boost I think is only needed for tests but it doesn't really hurt to have it installed anyways. GMP is needed. I am using the Windows incarnation mpir for it. It can be a little tricky to compile that one. Depending on your selection (see below) you might also need mpfr. They are all available on github. Then you should setup some CMAKE variables. At least the installation folder. It typically wouldn't be able to install it in the default directory. There are a few more one might need depending on your installation. When you are happy with the setup trigger a "configure" run. It will make you select the target generator e.g. Visual Studio" and typically one will see some failures due to missing libraries etc. . It tells you which ones it couldn't find and which CMAKE or MPPP variables it couldn't set. Just fix them. Adimtedly that can be come slightly tedious especially if one has to do it a couple of times in a row until everything fits. Especially when one one has never done that before and hasn't written down all the settings already. Not done, yet. That you should check what has been enabled or what you want enabled for your specific case. Under the heading MPPP there is a number of settings you can choose from. I wouldn't recommend to use the benchmarks but the tests (except for pybind11) are O.K. . You can also choose to use mpfr (needs the libraries). Don't attempt quadmath. As far as I know there is no MSVC incarnation for it. After each configure run it is a good idea to check what it selected! If no errors pop up any longer (there can occasionally be some CMAKE warnings. Quite often they are more for the CMAKE developer(s)).. And then you click "generate". There still can be errors showing up but they tell you what it was. Typically the generation will run through. After that you will find the selected build directory the generated cache file and for VS the solution *.sln file. You can now open Visual Studio directly from the CMAKE gui or the standard way and off you go. This all sounds like a lot of steps and one needs a little bit of experience to do it fast but I prefer it over remembering all the command line parameters. Look up the cmake website and there is also a cmake cook book out there.

One important hint. If your cache is messed up for some reason always delete it first before you start again. There is a menu item for it.

7ofNine avatar Apr 02 '21 15:04 7ofNine