1

I'm trying to use the Quadprog++ library (http://quadprog.sourceforge.net/). I don't understand the instructions though.

To build the library simply go through the ./configure; make; make install cycle.

In order to use it, you will be required to include in your code file the "Array.hh" header, which contains a handy C++ implementation of Vector and Matrices.

There are some "configure", and "MakeFile" files, but they have no extension and I have no idea what to do with them. There are also some ".am", ".in" and ".ac" extensions in the folder.

Does this look familiar to anyone? What do I do with this?

(Edit: On Windows.)

BoBTFish
  • 19,167
  • 3
  • 49
  • 76
Tessa
  • 297
  • 1
  • 3
  • 10

3 Answers3

3

This package is built using the autotools. These files you talk to (*.am, *.in...) are because of the tools automake, and autoconf.

Autotools is a de-facto standard in the GNU/Linux world. Not everybody uses it, but if they do you ease the work of package and distribution managers. Actually they should be portable to any POSIX system.

That said, I'm guessing that you are using a non-unix machine, such as Windows, so the configure script is not directly runable in your system. If you insist in keep using Windows, wich you probably will, your options are:

  1. Use MinGW and MSYS to get a minimal build enviroment compatible with autotools.
  2. Use Cygwin and create a POSIX like environment in your Windows.
  3. Create a VS project, add all the source of the library in there, compile and debug the errors they may arise, as if the code had been written by you.
  4. Search for someone that already did the work and distributes a binary DLL, or similar.
  5. (My favourite!) Get a Linux machine, install a cross-compiler environment to build Windows binaries, and do configure --host i686-mingw32 ; make.
rodrigo
  • 94,151
  • 12
  • 143
  • 190
  • Thank you for your awesome answer! I think I'm going with "6. Keep looking for a different library", but thank you for all your suggestions! – Tessa Feb 27 '13 at 10:38
  • 1
    @Tessa: Actually, this library is just two .CC files and two .HH files. You can just add them to your current solution and it should just work. No DLL, no libraries, no Makefiles! – rodrigo Feb 27 '13 at 10:42
1

This instruction say how can be build an program delivered like a tarball in Linux. To understand take a look on Why always ./configure; make; make install; as 3 separate steps?.

Community
  • 1
  • 1
Mihai8
  • 3,113
  • 1
  • 21
  • 31
1

This can be confusing at first, but here you go. Type these in as shown below:

cd <the_directory_with_the_configure_file>
./configure

At this point, a bunch of stuff will roll past on the screen. This is Autoconf running (for more details, see http://www.edwardrosten.com/code/autoconf/index.html)

When it's done, type:

make

This initiates the build process. (To learn more about GNU make, check out Comprehensive gnu make / gcc tutorial). This will cause several build messages to be printed out.

When this is done, type:

sudo make install

You will be asked for the root password. If this is not your own machine (or you do not have superuser access), then contact the person who administers this computer.

If this is your computer, type in the root password and the library should install in /usr/local/lib/ or something similar (watch the screen closely to see where it puts the .so file).

The rest of it (include the .hh file) seems self-explanatory.

Hope that helps!

Community
  • 1
  • 1
Rahul Banerjee
  • 2,343
  • 15
  • 16
  • Thank you! By now I found out that only works on Linux (while I'm using Windows), but these are really nice step-by-step instructions! – Tessa Feb 27 '13 at 10:56
  • Ha! Sorry, I had no idea you were trying to get it building inside Windows. How critical is QuadProg++ to what you're trying to do? Can you use a different quadratic programming library? If not, can you get a Linux system to work on? I seem to be asking more questions than providing answers, but my aim is to figure out how much effort *you* are willing to put in towards getting quadprog++ building on Windows. – Rahul Banerjee Feb 28 '13 at 09:50
  • Quadprog++ compiles and works perfectly under Windows too, and it doesn't need the makefile chain.. just compile the files directly, e.g. g++ -O -o myquadprog main.cc QuadProg++.cc Array.cc using MinGW or MS visual studio.. I don't know why people add complexity on simple things.. – Antonello May 27 '14 at 15:10