2021-01-15 15:06 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001770Frama-CKernel > configurepublic2015-03-17 22:17
Reporterrbonichon 
Assigned Tovirgile 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
Product VersionFrama-C Neon-20140301 
Target VersionFixed in VersionFrama-C Sodium 
Summary0001770: Cannot switch to local version if OCamlgraph is already installed
DescriptionI have OCamlgraph 1.8.5 on my machine, which is apparently incompatible with Frama-C Neon. However, I cannot force a switch to the local version with

./configure --enable-local-ocamlgraph

I am not sure if this option was intended to force the use of the local version.
Steps To ReproduceInstall external ocamlgraph library (1.8.5. for example, through opam)
Run ./configure --enable-local-ocamlgraph

VERBOSEMAKE=yes make

should show that the external ocamlgraph library is in the include path whereas the local one is not.
Additional InformationThe attached patch forces the use of the local ocamlgraph library when --enable-local-ocamlgraph has been given.

Basically, it encapsulates the search for an external library into a conditional which test the presence of then --enable-local switch.
TagsNo tags attached.
Attached Files
  • patch file icon configure.in.patch (6,624 bytes) 2014-05-01 21:12 -
    --- configure.in.orig	2014-05-01 15:52:11.083355931 -0300
    +++ configure.in	2014-05-01 16:06:48.306696588 -0300
    @@ -294,27 +294,13 @@
              OCAMLGRAPH_CUSTOM=yes],
             [])
     
    -if test "$OCAMLFIND" = "no" -o "$OCAMLGRAPH_CUSTOM" = "yes"; then
    -
    -# check if any ocamlgraph is installed in the right place
    -  AC_CHECK_FILE($OCAMLGRAPH_HOME/graph.$OBJ_SUFFIX,
    -              OCAMLGRAPH_EXISTS="yes" OCAMLGRAPH_INCLUDE="-I +ocamlgraph")
    -
    -  if test "$OCAMLGRAPH_EXISTS"="no" -a "$OCAMLGRAPH_CUSTOM" = "yes"; then
    -    AC_MSG_ERROR(
    -     [unable to find OCamlGraph in custom location $OCAMLGRAPH_HOME.
    -      Please give an appropriate value, or use default OCamlGraph library]);
    -  fi
    -else
    -  OCAMLGRAPH_HOME=$($OCAMLFIND query ocamlgraph 2>/dev/null \
    -                          | tr -d '\r\n');
    -  if test "$OCAMLGRAPH_HOME" != ""; then
    -     OCAMLGRAPH_INCLUDE="-I $OCAMLGRAPH_HOME";
    -     OCAMLGRAPH_EXISTS="yes";
    -  else
    -     AC_MSG_NOTICE(no package ocamlgraph in ocamlfind)
    -  fi;
    -fi
    +# allow local ocamlgraph
    +AC_ARG_ENABLE(
    +  local-ocamlgraph,
    +  [  --enable-local-ocamlgraph    allow the user to use the local OcamlGraph version],
    +  ENABLE_LOCAL_OCAMLGRAPH=$enableval,
    +  ENABLE_LOCAL_OCAMLGRAPH=yes, # default value
    +)
     
     ocamlgraph_error() {
       if test "$OCAMLGRAPH_CUSTOM" = "yes"; then
    @@ -328,52 +314,68 @@
       :;
       fi
     }
    +if test "$ENABLE_LOCAL_OCAMLGRAPH" != "yes"; then
    +   if test "$OCAMLFIND" = "no" -o "$OCAMLGRAPH_CUSTOM" = "yes"; then
     
    -# if any, check if it is a compatible version
    -if test "$OCAMLGRAPH_EXISTS" = "yes"; then
    -  test_ocamlgraph_version='print_string Graph.Version.version;;'
    -  echo $test_ocamlgraph_version > test_ocamlgraph.ml
    -  if $OCAMLC -o test_ocamlgraph $OCAMLGRAPH_INCLUDE graph.cmo \
    -       test_ocamlgraph.ml 2> /dev/null; \
    -  then
    -    OCAMLGRAPH_VERSION=`./test_ocamlgraph`
    -    case $OCAMLGRAPH_VERSION in
    -    1.8.1) ocamlgraph_error;;
    -    1.8.2) ocamlgraph_error;;
    -    1.8.3) ocamlgraph_error;;
    -    1.8.4) AC_MSG_NOTICE([OcamlGraph $OCAMLGRAPH_VERSION found: great!]);;
    -    1.8.*) AC_MSG_NOTICE(
    -      [OcamlGraph $OCAMLGRAPH_VERSION > 1.8.4 found: should be compatible, but no warranty. Use it at your own risk!]);;
    -    *) ocamlgraph_error;;
    -    esac
    -    if test "$OCAMLGRAPH_EXISTS" = "yes"; then # current version is ok
    -      if test "$OCAMLBEST" = "opt"; then 
    -        if $OCAMLOPT -o test_ocamlgraph $OCAMLGRAPH_INCLUDE graph.cmxa \
    -          test_ocamlgraph.ml 2> /dev/null; \
    -        then
    -          AC_MSG_NOTICE([OcamlGraph native version is ok])
    -        else
    -          AC_MSG_NOTICE([OcamlGraph native version is not ok])
    -          ocamlgraph_error
    +# check if any ocamlgraph is installed in the right place
    +        AC_CHECK_FILE($OCAMLGRAPH_HOME/graph.$OBJ_SUFFIX,
    +                      OCAMLGRAPH_EXISTS="yes" OCAMLGRAPH_INCLUDE="-I +ocamlgraph")
    +
    +        if test "$OCAMLGRAPH_EXISTS"="no" -a "$OCAMLGRAPH_CUSTOM" = "yes"; then
    +            AC_MSG_ERROR(
    +                [unable to find OCamlGraph in custom location $OCAMLGRAPH_HOME.
    +                    Please give an appropriate value, or use default OCamlGraph library]);
             fi
    -      else
    -        ocamlgraph_error
    -      fi
    -    fi
    -  else
    -    ocamlgraph_error
    -  fi
    -  rm -f test_ocamlgraph test_ocamlgraph.ml test_ocamlgraph.cm*
    +   else
    +       OCAMLGRAPH_HOME=$($OCAMLFIND query ocamlgraph 2>/dev/null \
    +                          | tr -d '\r\n');
    +       if test "$OCAMLGRAPH_HOME" != ""; then
    +           OCAMLGRAPH_INCLUDE="-I $OCAMLGRAPH_HOME";
    +           OCAMLGRAPH_EXISTS="yes";
    +       else
    +           AC_MSG_NOTICE(no package ocamlgraph in ocamlfind)
    +       fi;
    +   fi
    +
    +
    +   # if any, check if it is a compatible version
    +   if test "$OCAMLGRAPH_EXISTS" = "yes"; then
    +       test_ocamlgraph_version='print_string Graph.Version.version;;'
    +       echo $test_ocamlgraph_version > test_ocamlgraph.ml
    +       if $OCAMLC -o test_ocamlgraph $OCAMLGRAPH_INCLUDE graph.cmo \
    +           test_ocamlgraph.ml 2> /dev/null; \
    +           then
    +           OCAMLGRAPH_VERSION=`./test_ocamlgraph`
    +           case $OCAMLGRAPH_VERSION in
    +               1.8.1) ocamlgraph_error;;
    +               1.8.2) ocamlgraph_error;;
    +               1.8.3) ocamlgraph_error;;
    +               1.8.4) AC_MSG_NOTICE([OcamlGraph $OCAMLGRAPH_VERSION found: great!]);;
    +               1.8.*) AC_MSG_NOTICE(
    +                       [OcamlGraph $OCAMLGRAPH_VERSION > 1.8.4 found: should be compatible, but no warranty. Use it at your own risk!]);;
    +               *) ocamlgraph_error;;
    +           esac
    +           if test "$OCAMLGRAPH_EXISTS" = "yes"; then # current version is ok
    +               if test "$OCAMLBEST" = "opt"; then
    +                   if $OCAMLOPT -o test_ocamlgraph $OCAMLGRAPH_INCLUDE graph.cmxa \
    +                       test_ocamlgraph.ml 2> /dev/null; \
    +                       then
    +                       AC_MSG_NOTICE([OcamlGraph native version is ok])
    +                   else
    +                       AC_MSG_NOTICE([OcamlGraph native version is not ok])
    +                       ocamlgraph_error
    +                   fi
    +               else
    +                   ocamlgraph_error
    +               fi
    +           fi
    +       else
    +           ocamlgraph_error
    +       fi
    +       rm -f test_ocamlgraph test_ocamlgraph.ml test_ocamlgraph.cm*
    +   fi
     fi
     
    -# allow local ocamlgraph
    -AC_ARG_ENABLE(
    -  local-ocamlgraph,
    -  [  --enable-local-ocamlgraph    allow the user to use the local OcamlGraph version],
    -  ENABLE_LOCAL_OCAMLGRAPH=$enableval,
    -  ENABLE_LOCAL_OCAMLGRAPH=yes, # default value
    -)
    -
     # revert back to local version of ocamlgraph
     if test "$OCAMLGRAPH_EXISTS" = "no"; then
       if test "$ENABLE_LOCAL_OCAMLGRAPH" = "yes"; then
    @@ -627,7 +629,7 @@
       if test -z "$FRAMAC_DEFAULT_CPP"; then
     # We should use AC_CHECK_PROG_CPP, but then we would end up with a slightly
     # different command line than before for pre-processing (swapping -C and -E)
    -# and since we have the brilliant idea to put this command line in our 
    +# and since we have the brilliant idea to put this command line in our
     # test oracles, changing that would be painful.
         CPP=$CC
         CPPFLAGS="-C -E -I.";
    @@ -642,7 +644,7 @@
           DEFAULT_CPP_KEEP_COMMENTS=true;
          else
           AC_MSG_WARN([Default pre-processing command '$CPP' do not preserve
    -                   comments. Please use define an appropriate pre-processor 
    +                   comments. Please use define an appropriate pre-processor
                        with --with-cpp, or you will only be able to use ACSL
                        annotations in already pre-processed files])
           FRAMAC_DEFAULT_CPP=$CPP;
    
    patch file icon configure.in.patch (6,624 bytes) 2014-05-01 21:12 +

-Relationships
+Relationships

-Notes

~0005097

virgile (developer)

Fix committed to feature/force-local-ocamlgraph branch.

~0005098

virgile (developer)

Fix committed to master branch.
+Notes

-Issue History
Date Modified Username Field Change
2014-05-01 21:12 rbonichon New Issue
2014-05-01 21:12 rbonichon Status new => assigned
2014-05-01 21:12 rbonichon Assigned To => virgile
2014-05-01 21:12 rbonichon File Added: configure.in.patch
2014-05-16 09:51 virgile Source_changeset_attached => framac feature/force-local-ocamlgraph bdf931c0
2014-05-16 09:51 virgile Note Added: 0005097
2014-05-16 09:51 virgile Resolution open => fixed
2014-05-16 09:53 virgile Source_changeset_attached => framac master bdf931c0
2014-05-16 09:53 virgile Note Added: 0005098
2014-05-16 09:57 signoles Status assigned => resolved
2015-03-17 22:17 signoles Fixed in Version => Frama-C Sodium
2015-03-17 22:17 signoles Status resolved => closed
+Issue History