[PPL-devel] Difficulty compiling PPL

Kenneth MacKenzie kwxm at inf.ed.ac.uk
Wed Jan 21 18:27:20 CET 2009


Roberto Bagnara writes:
 > Kenneth MacKenzie wrote:
 ...
 > 
 > > I also had some trouble compiling the Ocaml interface because it
 > > wanted to install the output files in /usr/lib/ocaml,  which I don't
 > > have write access to on my system.
 > 
 > I have not been able to reproduce this problem.  I did configure
 > PPL 0.10 with the command
 > 
 >      ./configure --prefix=/tmp/dst
 > 
 > Then I did `make'.  Then I did `make install' as an unprivileged user:
 > this succeeded and installed everything under /tmp/dst .
 > 
 > Perhaps I have misunderstood what you wrote?
 > 
 > I mean: since you wrote that you don't have write access to /usr/lib/ocaml
 > in your system, I guessed you configured with the --prefix option.
 > Thus my hypothesis was that our makefiles were not "obeying" what the
 > user specified as the --prefix argument.  But my experiment did not show that.

My apologies: the explanation I gave you was incorrect. Here's what
really went wrong.

The problem is that the configure script expects MLGMP (the OCaml
wrapper for gmp) to be installed in the directory containing the main
ocaml installation:

  ocamlgmp="no"
  if test x"$OCAMLC" = xocamlc
  then
     ocamlc_root=`ocamlc -where`
     # Checks for OCaml GMP.
     { $as_echo "$as_me:$LINENO: checking for OCaml-GMP module gmp.cma" >&5
 $as_echo_n "checking for OCaml-GMP module gmp.cma... " >&6; }
     if test -f ${ocamlc_root}/gmp/gmp.cma;
     then
         { $as_echo "$as_me:$LINENO: result: yes" >&5
 $as_echo "yes" >&6; }
	 ocamlgmp="yes"
     else
         { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
	 ocamlgmp="no"
     fi

OCaml is installed on our system, and "ocamlc -where" returns
/usr/lib/ocaml.  However, MLGMP is not installed, and so "test -f
${ocamlc_root}/gmp/gmp.cma" fails silently.  I'm not exactly sure what
happens next, but when you run make && make install it completes
without complaining, but it doesn't attempt to compile or install the
OCaml interface.  Since I don't have write access to /usr/lib/ocaml
I'm unable to install gmp.cma in the place expected by the
configuration script.

I was able to fix this by installing gmp.cma in a directory of my own
and then changing the lines

 OCAMLC_COMPILE_FLAGS = \
 -I +gmp -I .. -ccopt -g

in interfaces/OCaml/Makefile to

 OCAMLC_COMPILE_FLAGS = \
 -I ${HOME}/lib/gmp -I .. -ccopt -g

and then running make && make install in interfaces/OCaml.

Here's what config.log says if I type

./configure --prefix=$PWD/lib --enable-interfaces="c cxx ocaml"

(Incidentally, I think that if you just try --enable-interfaces=ocaml
then you eventually get a cryptic error due to the fact that the C++
interface is also required.)


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

-------------- next part --------------

Sorry for the confusion,

Kenneth


More information about the PPL-devel mailing list