From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 168097F72A for ; Wed, 10 Aug 2016 07:53:03 +0200 (CEST) IronPort-PHdr: 9a23:66vx7xSytWrIsdTuHq99eu7qZdpsv+yvbD5Q0YIujvd0So/mwa64bBKN2/xhgRfzUJnB7Loc0qyN4vmmATZLsMjJ8ChbNscdD1ld0YRetjdjKfbNMVf8Iv/uYn5yN+V5f3ghwUuGN1NIEt31fVzYry76xzcTHhLiKVg9fbytScbshsi6n9q/54fUK10RwmHsOPUqdl7n802R7pBQ2to6bP5pi1PgmThhQ6xu32RmJFaezV7Xx/yb29pdyRlWoO8r7MVaUK/3LOwSRL1cCyk6YShuvJW4/UqLcQza7XIZViASkwFUKwnD9hDzGJnr9mP9veN43B6QMML3S7Y5Qy+K/q5rTxjnkiAaLyV/+2bS2eJqi6cOgxW/Lhdk9LTTZIiTOLIqbK7bJtwXX0JOW89QU2pKBYbqPNhHNPYIIesN99q1nFAJtxbrXQQ= Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=zen3ger@gmail.com; spf=Pass smtp.mailfrom=zen3ger@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f42.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of zen3ger@gmail.com) identity=pra; client-ip=74.125.82.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="zen3ger@gmail.com"; x-sender="zen3ger@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of zen3ger@gmail.com designates 74.125.82.42 as permitted sender) identity=mailfrom; client-ip=74.125.82.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="zen3ger@gmail.com"; x-sender="zen3ger@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f42.google.com) identity=helo; client-ip=74.125.82.42; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="zen3ger@gmail.com"; x-sender="postmaster@mail-wm0-f42.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AlBAA4wKpXfypSfUpdhEVSpRqIRIZAhwSDNoQ4PBABAQEBAQEBAREBAQkLCwkXMUEBAQMJAoFhFoIvFRkBGx4DEhBeEQEFASMMCAEBEA6HdAEDFwSjToEyPjKNJYJbBYZQChknDVSEBwIGEIgSCIZZhg8FiCWLUoVEjwyBa4dcDiOFS45sMYEPNYIuAxyBTmyDY4FvgVoBAQE X-IPAS-Result: A0AlBAA4wKpXfypSfUpdhEVSpRqIRIZAhwSDNoQ4PBABAQEBAQEBAREBAQkLCwkXMUEBAQMJAoFhFoIvFRkBGx4DEhBeEQEFASMMCAEBEA6HdAEDFwSjToEyPjKNJYJbBYZQChknDVSEBwIGEIgSCIZZhg8FiCWLUoVEjwyBa4dcDiOFS45sMYEPNYIuAxyBTmyDY4FvgVoBAQE X-IronPort-AV: E=Sophos;i="5.28,498,1464645600"; d="scan'208,217";a="187325619" Received: from mail-wm0-f42.google.com ([74.125.82.42]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Aug 2016 07:53:01 +0200 Received: by mail-wm0-f42.google.com with SMTP id f65so69788484wmi.0 for ; Tue, 09 Aug 2016 22:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:message-id:date:user-agent:mime-version; bh=I/DYpIcy2l1ZV6KQeBIhXIt3t97htGftclrCXOaTpbY=; b=wmMKPkI2iIk5JjhogdNp9jgNkVHqBQjbShQ3OzXxnys8rUPGM4D50yya5dEBM7g5V+ 32oZhzja388KDsRgWyABzi0ZCHGIVdn+hAzCCfveSMZ3nLWj++vvuJLCO3GXwhCK0aZC 3yhUcsQvCkR/jFG4+vEvMcyfFEOBksCFrBRSoXyktl5OtHXI8tk97S+tcdWTmTsUcaBa 3zawBoowyZvMNmN+fYBRF8n1ftMxswf2zFwCu0kcTgV9BAxel0gOQOfux8U5F/hNbFw6 R9xk6ztF9rShQtpAd2Cya/OT257VCCOyiljTCgsrUolyNw/BAZaDNi/LRrLabBCa49/x XA5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version; bh=I/DYpIcy2l1ZV6KQeBIhXIt3t97htGftclrCXOaTpbY=; b=lobTRDAy+prixUlHOR5K8zZM9noF5TNiH5X1ETb3ymWNwYfc2hww3P4A/epuI719WJ Hz4YQ8nX1Mtg0esK4KRQBAiNBcFzp3PIxAXqryUGYtiHYVmZWgaPd9RtKAabdqui5Fpf tghbva1uAVDL8+KylfGhhTDHVc88WHZZq3Jbo/hd4o9+NSyJQT03ZDLgJ9JTomvgXkjy s3dtacInxrJWcX/9jRz7L1yIjFdnnFDTFA4aLXfg+LrwGlJLTCQS6sDOyehQwaJVyBov W8MtSOanx2rUMVJCBydZ0abIgP5xqr56xv0Gruxijdhe4lmnA+YZfI+HXVNmQvx0uWyD eAtA== X-Gm-Message-State: AEkoouv3RBhJywW3X+L3nXzQlaie7NSjqchht1t7gV/iTujrKfgtHm1HrmgBc8NHBX7CTw== X-Received: by 10.28.17.9 with SMTP id 9mr1204952wmr.73.1470808381182; Tue, 09 Aug 2016 22:53:01 -0700 (PDT) Received: from [192.168.0.133] ([91.82.156.178]) by smtp.gmail.com with ESMTPSA id o4sm41177897wjd.15.2016.08.09.22.53.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Aug 2016 22:53:00 -0700 (PDT) From: =?UTF-8?Q?Kov=c3=a1cs_Roland?= To: caml-list@inria.fr, ocaml_beginners@yahoogroups.com Message-ID: <1113f97f-4ad4-3589-6ff5-4e20d8657e5f@gmail.com> Date: Wed, 10 Aug 2016 07:52:59 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------5C9D029F04A810CB10A9AA6F" X-Validation-by: zen3ger@gmail.com Subject: [Caml-list] Beginner - Cannot set up Core and Batteries This is a multi-part message in MIME format. --------------5C9D029F04A810CB10A9AA6F Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Transfer-Encoding: 7bit Hello Everyone! I'm completely new to OCaml, but I've read that it's a good practice to start by having both Batteries and the Core module installed. I'm using Ubuntu 16.04, and installed ocaml, opam, utop from the official PPAs as it seemed that the one provided for Ubuntu (|avsm/ppa) is not working for 16.04! After installation I did opam init, and all the setups it asked me to do. In my .ocamlinit file I have what I've found as a fix for the error 'unbound module'. For one time utop found the modules, but since then it gives me an error. |Cheers, Roland |||-------------------------------------------------------------------- ||Judging by the output of opam, the packages should be installed correctly : $ opam list # Installed packages for system: base-bigarray base Bigarray library distributed with the OCaml compi base-bytes base Bytes library distributed with the OCaml compiler base-ocamlbuild base OCamlbuild binary and libraries distributed with base-threads base Threads library distributed with the OCaml compil base-unix base Unix library distributed with the OCaml compiler batteries 2.5.2 a community-maintained standard library extension bin_prot 113.33.03 A binary protocol generator cmdliner 0.9.8 Declarative definition of command line interfaces conf-m4 1 Virtual package relying on m4 core 113.33.03 Industrial strength alternative to OCaml's standa core_kernel 113.33.03 Industrial strength alternative to OCaml's standa cppo 1.3.2 Equivalent of the C preprocessor for OCaml progra depext 1.0.1 Query and install external dependencies of OPAM p fieldslib 113.33.03 Syntax extension to define first class values rep js-build-tools 113.33.04 Collection of tools to help building Jane Street ocamlbuild 0 Build system distributed with the OCaml compiler ocamlfind 1.6.2 A library manager for OCaml ppx_assert 113.33.03 Assert-like extension nodes that raise useful err ppx_bench 113.33.03 Syntax extension for writing in-line benchmarks i ppx_bin_prot 113.33.03 Generation of bin_prot readers and writers from t ppx_compare 113.33.03 Generation of comparison functions from types ppx_core 113.33.03 Standard library for ppx rewriters ppx_custom_printf 113.33.03 Printf-style format-strings for user-defined stri ppx_deriving 4.0 Type-driven code generation for OCaml >=4.02 ppx_driver 113.33.03 Feature-full driver for OCaml AST transformers ppx_enumerate 113.33.03 Generate a list containing all values of a finite ppx_expect 113.33.03 Cram like framework for OCaml ppx_fail 113.33.03 Add location to calls to failwiths ppx_fields_conv 113.33.03 Generation of accessor and iteration functions fo ppx_here 113.33.03 Expands [%here] into its location ppx_inline_test 113.33.03 Syntax extension for writing in-line tests in oca ppx_jane 113.33.03 Standard Jane Street ppx rewriters ppx_let 113.33.03 Monadic let-bindings ppx_optcomp 113.33.03 Optional compilation for OCaml ppx_pipebang 113.33.03 A ppx rewriter that inlines reverse application o ppx_sexp_conv 113.33.03 Generation of S-expression conversion functions f ppx_sexp_message 113.33.03 A ppx rewriter for easy construction of s-express ppx_sexp_value 113.33.03 A ppx rewriter that simplifies building s-express ppx_tools 5.0+4.02.0 Tools for authors of ppx rewriters and other synt ppx_type_conv 113.33.03 Support Library for type-driven code generators ppx_typerep_conv 113.33.03 Generation of runtime types from type declaration ppx_variants_conv 113.33.03 Generation of accessor and iteration functions fo re 1.6.1 RE is a regular expression library for OCaml result 1.2 Compatibility Result module sexplib 113.33.03 Library for serializing OCaml values to and from typerep 113.33.03 typerep is a library for runtime types. variantslib 113.33.03 Part of Jane Street's Core library | ||-------------------------------------------------------------------- |My .ocmalinit : ||#use "topfind";; #thread;; #camlp4o;; #require "core.std";; #require "core.syntax";; #require "batteries";; let () = try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") with Not_found -> () ;||; -------------------------------------------------------------------- What ocaml prints : $ ocaml OCaml version 4.02.3 Findlib has been successfully loaded. Additional directives: #require "package";; to load a package #list;; to list the available packages #camlp4o;; to load camlp4 (standard syntax) #camlp4r;; to load camlp4 (revised syntax) #predicates "p,q,...";; to set these predicates Topfind.reset();; to force that packages will be reloaded #thread;; to enable threads /usr/lib/ocaml/threads: added to search path /usr/lib/ocaml/unix.cma: loaded /usr/lib/ocaml/threads/threads.cma: loaded /usr/lib/ocaml/dynlink.cma: loaded /usr/lib/ocaml/camlp4: added to search path /usr/lib/ocaml/camlp4/camlp4o.cma: loaded No such package: core.std /home/zen3ger/.opam/system/lib/core: added to search path /usr/lib/ocaml/nums.cma: loaded /home/zen3ger/.opam/system/lib/num-top: added to search path /home/zen3ger/.opam/system/lib/num-top/num_top.cma: loaded Camlp4 Parsing version 4.02.3 /home/zen3ger/.opam/system/lib/num: added to search path /usr/lib/ocaml/bigarray.cma: loaded /usr/lib/ocaml/str.cma: loaded /home/zen3ger/.opam/system/lib/bytes: added to search path /home/zen3ger/.opam/system/lib/batteries: added to search path /home/zen3ger/.opam/system/lib/batteries/batteries.cma: loaded /home/zen3ger/.opam/system/lib/batteries/batteriesConfig.cmo: loaded /home/zen3ger/.opam/system/lib/batteries/batteriesHelp.cmo: loaded /home/zen3ger/.opam/system/lib/batteries/batteriesPrint.cmo: loaded /home/zen3ger/.opam/system/lib/batteries/batteriesThread.cma: loaded /home/zen3ger/.opam/system/lib/batteries/batteriesThread.cma: loaded | ||-------------------------------------------------------------------- What utop prints : Findlib has been successfully loaded. Additional directives: #require "package";; to load a package #list;; to list the available packages #camlp4o;; to load camlp4 (standard syntax) #camlp4r;; to load camlp4 (revised syntax) #predicates "p,q,...";; to set these predicates Topfind.reset();; to force that packages will be reloaded #thread;; to enable threads No such package: core.std No such package: core.syntax No such package: batteries || --------------5C9D029F04A810CB10A9AA6F Content-Type: text/html; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Hello Everyone!

I'm completely new to OCaml, but I've read that it's a good practice to start by having both Batteries and the Core module installed.
I'm using Ubuntu 16.04, and installed ocaml, opam, utop from the official PPAs as it seemed that the one provided for Ubuntu (avsm/ppa) is not working for 16.04!

After installation I did opam init, and all the setups it asked me to do. In my .ocamlinit file I have what I've found as a fix for the error 'unbound module'.
For one time utop found the modules, but since then it gives me an error.


Cheers,
Roland
--------------------------------------------------------------------
Judging by the output of opam, the packages should be installed correctly :

$ opam list
# Installed packages for system:
base-bigarray            base  Bigarray library distributed with the OCaml compi
base-bytes               base  Bytes library distributed with the OCaml compiler
base-ocamlbuild          base  OCamlbuild binary and libraries distributed with
base-threads             base  Threads library distributed with the OCaml compil
base-unix                base  Unix library distributed with the OCaml compiler
batteries               2.5.2  a community-maintained standard library extension
bin_prot            113.33.03  A binary protocol generator
cmdliner                0.9.8  Declarative definition of command line interfaces
conf-m4                     1  Virtual package relying on m4
core                113.33.03  Industrial strength alternative to OCaml's standa
core_kernel         113.33.03  Industrial strength alternative to OCaml's standa
cppo                    1.3.2  Equivalent of the C preprocessor for OCaml progra
depext                  1.0.1  Query and install external dependencies of OPAM p
fieldslib           113.33.03  Syntax extension to define first class values rep
js-build-tools      113.33.04  Collection of tools to help building Jane Street
ocamlbuild                  0  Build system distributed with the OCaml compiler
ocamlfind               1.6.2  A library manager for OCaml
ppx_assert          113.33.03  Assert-like extension nodes that raise useful err
ppx_bench           113.33.03  Syntax extension for writing in-line benchmarks i
ppx_bin_prot        113.33.03  Generation of bin_prot readers and writers from t
ppx_compare         113.33.03  Generation of comparison functions from types
ppx_core            113.33.03  Standard library for ppx rewriters
ppx_custom_printf   113.33.03  Printf-style format-strings for user-defined stri
ppx_deriving              4.0  Type-driven code generation for OCaml >=4.02
ppx_driver          113.33.03  Feature-full driver for OCaml AST transformers
ppx_enumerate       113.33.03  Generate a list containing all values of a finite
ppx_expect          113.33.03  Cram like framework for OCaml
ppx_fail            113.33.03  Add location to calls to failwiths
ppx_fields_conv     113.33.03  Generation of accessor and iteration functions fo
ppx_here            113.33.03  Expands [%here] into its location
ppx_inline_test     113.33.03  Syntax extension for writing in-line tests in oca
ppx_jane            113.33.03  Standard Jane Street ppx rewriters
ppx_let             113.33.03  Monadic let-bindings
ppx_optcomp         113.33.03  Optional compilation for OCaml
ppx_pipebang        113.33.03  A ppx rewriter that inlines reverse application o
ppx_sexp_conv       113.33.03  Generation of S-expression conversion functions f
ppx_sexp_message    113.33.03  A ppx rewriter for easy construction of s-express
ppx_sexp_value      113.33.03  A ppx rewriter that simplifies building s-express
ppx_tools          5.0+4.02.0  Tools for authors of ppx rewriters and other synt
ppx_type_conv       113.33.03  Support Library for type-driven code generators
ppx_typerep_conv    113.33.03  Generation of runtime types from type declaration
ppx_variants_conv   113.33.03  Generation of accessor and iteration functions fo
re                      1.6.1  RE is a regular expression library for OCaml
result                    1.2  Compatibility Result module
sexplib             113.33.03  Library for serializing OCaml values to and from
typerep             113.33.03  typerep is a library for runtime types.
variantslib         113.33.03  Part of Jane Street's Core library


--------------------------------------------------------------------
My .ocmalinit :

#use "topfind";;
#thread;;
#camlp4o;;
#require "core.std";;
#require "core.syntax";;
#require "batteries";;

let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;
;

--------------------------------------------------------------------
What ocaml prints :

$ ocaml
                       OCaml version 4.02.3                                                                                                                                   
Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

/usr/lib/ocaml/threads: added to search path
/usr/lib/ocaml/unix.cma: loaded
/usr/lib/ocaml/threads/threads.cma: loaded
/usr/lib/ocaml/dynlink.cma: loaded
/usr/lib/ocaml/camlp4: added to search path
/usr/lib/ocaml/camlp4/camlp4o.cma: loaded
No such package: core.std
/home/zen3ger/.opam/system/lib/core: added to search path
/usr/lib/ocaml/nums.cma: loaded
/home/zen3ger/.opam/system/lib/num-top: added to search path
/home/zen3ger/.opam/system/lib/num-top/num_top.cma: loaded
    Camlp4 Parsing version 4.02.3

/home/zen3ger/.opam/system/lib/num: added to search path
/usr/lib/ocaml/bigarray.cma: loaded
/usr/lib/ocaml/str.cma: loaded
/home/zen3ger/.opam/system/lib/bytes: added to search path
/home/zen3ger/.opam/system/lib/batteries: added to search path
/home/zen3ger/.opam/system/lib/batteries/batteries.cma: loaded
/home/zen3ger/.opam/system/lib/batteries/batteriesConfig.cmo: loaded
/home/zen3ger/.opam/system/lib/batteries/batteriesHelp.cmo: loaded
/home/zen3ger/.opam/system/lib/batteries/batteriesPrint.cmo: loaded
/home/zen3ger/.opam/system/lib/batteries/batteriesThread.cma: loaded
/home/zen3ger/.opam/system/lib/batteries/batteriesThread.cma: loaded


--------------------------------------------------------------------
What utop prints :

Findlib has been successfully loaded. Additional directives:
  #require "package";;      to load a package
  #list;;                   to list the available packages
  #camlp4o;;                to load camlp4 (standard syntax)
  #camlp4r;;                to load camlp4 (revised syntax)
  #predicates "p,q,...";;   to set these predicates
  Topfind.reset();;         to force that packages will be reloaded
  #thread;;                 to enable threads

No such package: core.std
No such package: core.syntax
No such package: batteries

--------------5C9D029F04A810CB10A9AA6F--