0

I always compile my own cgal programs in my laptop (which cgal has been installed as root, and in the standard location) like this:

cgal_create_CMakeLists -s executable 
cmake -DCGAL_DIR=$HOME/CGAL-4.9.1 . 
make

I installed CGAL in my account in our cluster, in a non standard location:

/data/home/user1/CGAL-1.4.9

, and I added this line to the .bashrc file:

export CGAL_DIR=$HOME/CGAL-4.9.1

Now compiling a test code using the above command, gives me:

-bash: cgal_create_CMakeLists: command not found

I also tried the following, according to this post:

$ g++ chull.cpp -lCGAL -I/data/home/user1/CGAL-4.9.1/include
$/usr/bin/ld: cannot find -lCGAL
collect2: error: ld returned 1 exit status

How can I compile a cgal program with this type of installation?

Community
  • 1
  • 1
user252935
  • 317
  • 3
  • 15
  • You likely want to add $HOME/CGAL-4.9.1/bin to your PATH. – Marc Glisse Apr 30 '17 at 22:38
  • For the manual version without cmake where you specify `-lCGAL` yourself, the documentation of gcc for -l says "Search the library named library when linking [...] The directories searched include several standard system directories plus any that you specify with -L." If you don't install in a system directory, that means you need to specify the location of the library with -L (later you'll also need to specify it with -rpath or LD_LIBRARY_PATH as well so the program actually runs). Note that you may need to link with more than just CGAL (GMP, etc), which cmake usually handles for you. – Marc Glisse Apr 30 '17 at 22:44

0 Answers0