IPB

Bienvenue invité ( Connexion | Inscription )

> ocaml sous mac
Options
audionuma
posté 7 Oct 2016, 11:57
Message #1


Macbidouilleur d'Or !
*****

Groupe : Membres
Messages : 2 031
Inscrit : 27 Apr 2004
Membre no 18 176



Bonjour,
je suis en train de suivre le mooc https://www.fun-mooc.fr/courses/parisdidero...session02/about.
Je me suis donc intsallé les outils ocaml via macports comme suggéré ici : http://ocaml.org/docs/install.html
(Je suis sous Mac OS 10.10.5)
Donc :
Code
$ which ocaml
/opt/local/bin/ocaml
$ which opam
/opt/local/bin/opam


Et je peux utiliser le toplevel :
Code
$ ocaml
        OCaml version 4.02.2

Cannot find file topfind.
Unknown directive `thread'.
# let a = 2 + 1;;
val a : int = 3


Bon, y'a bien ces deux message d'alerte, mais ça fonctionne.

Bon, ensuite, j'entends parler de utop comme alternative au toplevel par défaut.
J'essaye donc d'installer utop comme indiqué ici : https://github.com/diml/utop
Code
$ opam install utop

The following actions will be performed:
  ∗  install lwt         2.4.5                [required by utop]
  ∗  install lambda-term 1.6                  [required by utop]
  ∗  install utop        1.14
===== ∗  3 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[lambda-term] Archive in cache
[lwt] Archive in cache
[utop] Archive in cache

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[ERROR] The compilation of lwt failed at "./configure --disable-libev
        --enable-react --enable-ssl --enable-unix --enable-extra
        --enable-preemptive --disable-glib --disable-text".
Processing  1/3: [lwt: ocamlfind remove]
#=== ERROR while installing lwt.2.4.5 =========================================#
# opam-version 1.2.2
# os           darwin
# command      ./configure --disable-libev --enable-react --enable-ssl --enable-unix --enable-extra --enable-preemptive --disable-glib --disable-text
# path         /Users/manu/.opam/system/build/lwt.2.4.5
# compiler     system (4.02.2)
# exit-code    1
# env-file     /Users/manu/.opam/system/build/lwt.2.4.5/lwt-13318-c61e7b.env
# stdout-file  /Users/manu/.opam/system/build/lwt.2.4.5/lwt-13318-c61e7b.out
# stderr-file  /Users/manu/.opam/system/build/lwt.2.4.5/lwt-13318-c61e7b.err
### stderr ###
# [...]
# W: Failure("When looking for findlib package camlp4, directory /opt/local/lib/ocaml/camlp4 return doesn't exist")
# W: Failure("When looking for findlib package camlp4.quotations.o, directory /opt/local/lib/ocaml/camlp4 return doesn't exist")
# W: Field 'pkg_camlp4_extend' is not set: When looking for findlib package camlp4.extend, directory /opt/local/lib/ocaml/camlp4 return doesn't exist
# W: Failure("When looking for findlib package camlp4, directory /opt/local/lib/ocaml/camlp4 return doesn't exist")
# W: Failure("When looking for findlib package camlp4, directory /opt/local/lib/ocaml/camlp4 return doesn't exist")
# W: Failure("When looking for findlib package camlp4.quotations.o, directory /opt/local/lib/ocaml/camlp4 return doesn't exist")
# E: Cannot find findlib package camlp4
# E: Cannot find findlib package camlp4.extend
# E: Cannot find findlib package camlp4.quotations.o
# E: Failure("3 configuration errors")



=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following actions were aborted
  ∗  install lambda-term 1.6
  ∗  install utop        1.14
The following actions failed
  ∗  install lwt 2.4.5
No changes have been performed


Et pourtant :
Code
$ opam install camlp4
[NOTE] Package camlp4 is already installed (current version is 4.02.0).

Voici le contenu de mon .ocamlinit :
Code
(* Added by OPAM. *)
let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;
#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;
open Core.Std


et
Code
$ echo $OCAML_TOPLEVEL_PATH

$


Est-ce que je dois exporter cette variable dans .profile ? Si oui, vers quoi doit-elle pointer ? Le problème est-il ailleurs ?

Merci,
Manu


--------------------
Membre du club des AIPBP (Anciens Inscrits Pas Beaucoup de Posts) Voir la liste
Futur ex-macbidouilleur, sous Dell / Ubuntu depuis 2021 !
Go to the top of the page
 
+Quote Post
 
Start new topic
Réponse(s)
Jaypee
posté 14 Oct 2016, 21:51
Message #2


Macbidouilleur d'Or !
*****

Groupe : Membres
Messages : 2 486
Inscrit : 29 Aug 2002
Membre no 3 340



J'ai remis en marche mon Eclipse avec ocaIDE.

Je n'ai pas encore rattrapé la semaine n°3, je viens de finir la petite base de donnée.
J'ai dû lâcher prise sur les tableaux (is_sorted et la recherche dicho) pour pouvoir avancer mais je suis presque au taquet pour le moment.

Chapeau ! en tout cas, car faut vraiment s'accrocher smile.gif

J-P

Ce message a été modifié par Jaypee - 14 Oct 2016, 21:52.
Go to the top of the page
 
+Quote Post

Les messages de ce sujet


Reply to this topicStart new topic
1 utilisateur(s) sur ce sujet (1 invité(s) et 0 utilisateur(s) anonyme(s))
0 membre(s) :

 



Nous sommes le : 27th April 2024 - 21:08