-1

I recently installed CGAL from their website. I used the native installer that is up to download on the website, and after selecting a directory, the installation completed. I am looking through the User Manual and trying to run some basic code, but I keep getting a compiler error. The code that I run is this (it is straight from the user manual):

// example: construct a quadratic program from data
// the QP below is the first quadratic program example in the user manual
#include <iostream>
#include <cassert>
#include <CGAL/basic.h>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
// choose exact integral type
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz ET;
#else
#include <CGAL/MP_Float.h>
typedef CGAL::MP_Float ET;
#endif

int main()
{

}

It is just a simple QP problem, using the syntax straight from the website. However, when I try to run it, I receive this compiler error:

C:\...\include\CGAL\config.h|161|fatal error: CGAL/compiler_config.h: No such file or directory|

I used the installer straight from the website, but CGAL is still giving me these issues. Does anyone know how to solve it? Thank you.

Saswat Mishra
  • 185
  • 1
  • 11
  • 1
    Did you check the file exists? – Matthieu Brucher Nov 25 '18 at 09:12
  • I looks like you have posted a lot of completely unrelated code to demonstrate your problem. Would you mind to stick to a [mcve] as required here please. – πάντα ῥεῖ Nov 25 '18 at 09:13
  • @MatthieuBrucher The files that exist with similar names are MSVC_compiler_config.hpp and config.h. I used the native installer to CGAL, which is why I am unsure of why this file does not exist. – Saswat Mishra Nov 25 '18 at 09:34
  • Check in `CGAL\config.h` that it doesn't fail to properly include the MSVC compiler config first. – Matthieu Brucher Nov 25 '18 at 09:35
  • You did not give a single hint as to how you are trying to compile. I can guess you are on windows because of the error message, but that's it. Are you using cmake? Did you tell it to use a header-only installation? – Marc Glisse Nov 25 '18 at 10:21
  • @MarcGlisse I am on 64-bit windows, using GCC 7.3.0, and I am assuming the installer used cmake since there is a CMakeLists.txt file and a cmake folder in the CGAL directory. Sorry for my inexperience, I am new to extensive use of external libraries. I am only used to Eigen and Boost, neither of which required knowing what cmake is or does. Thank you for the help. – Saswat Mishra Nov 25 '18 at 11:32
  • @MatthieuBrucher It is in config.h that the problem arises. If (! CGAL_HEADER_ONLY), it attempts to #include . I tried manually defining the macro CGAL_HEADER_ONLY to 1 as a patchy fix to see if this would work, but a whole host of other problems arose from that. Is there a safe way to get around this? Sorry, I am inexperienced in extensive installation of external libraries, and thank you. – Saswat Mishra Nov 25 '18 at 11:37
  • I believe `CGAL/compiler_config.h` is created by `cmake` configuration. – Erwin Kalvelagen Nov 26 '18 at 23:15

1 Answers1

0

According to the documentation (https://doc.cgal.org/latest/Manual/installation.html#title5), after installing CGAL on Windows, you still need to build the library itself.

This process will (I suspect) create the missing configuration files according to the compiler you have (gcc 7.3).

Matthieu Brucher
  • 21,634
  • 7
  • 38
  • 62