sebferre / sparklis

Sparklis is a query builder in natural language that allows people to explore and query SPARQL endpoints with all the power of SPARQL and without any knowledge of SPARQL.
Apache License 2.0
42 stars 10 forks source link

build help #9

Closed waldenn closed 2 years ago

waldenn commented 2 years ago

Hi, could someone help me with the build-step. I'm trying to build Sparklis on an Ubuntu 20.04 system.

git clone https://github.com/sebferre/sparklis.git
cd sparklis
sudo apt-get install ocaml ocaml-findlib
make

Running the make command fails to install the Sparkliss package dependencies:

ocamlfind ocamlc -package csv,lwt,js_of_ocaml,js_of_ocaml-lwt,lwt_ppx,js_of_ocaml-ppx -c common.ml
ocamlfind: Package `csv' not found
make: *** [makefile:28: common.cmo] Error 2

Any idea how this can be fixed? Thanks!

sebferre commented 2 years ago

Hi, first building from source is only necessary if you want to change the code. To reuse Sparklis in your website, please see the relevant section in the README.

For building OCaml projects, I strongly recommend to use opam to create a safe environment and install the required dependencies (ex: opam install csv).

waldenn commented 2 years ago

Hi, first building from source is only necessary if you want to change the code. To reuse Sparklis in your website, please see the relevant section in the README.

For building OCaml projects, I strongly recommend to use opam to create a safe environment and install the required dependencies (ex: opam install csv).

Thank you for the feedback! I want to build from source and see how I can better integrate your project into my https://conze.pt project. I think it can help me to add a sub-system for handling 3rd-party SPARQL-endpoints. See this page: https://conze.pt/guide/concept_stores for some more background.

I installed opam and the required packages (see below), but ocamlfind still says: "Package ... not found". Do I need to configure ocamlfind in some way? Sorry, I'm not well versed in the OCaml world yet.

$ opam list
# Packages matching: installed
# Name               # Installed # Synopsis
base-bigarray        base
base-bytes           base        Bytes library distributed with the OCaml compiler
base-threads         base
base-unix            base
biniou               1.2.1       Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve
cmdliner             1.0.4       Declarative definition of command line interfaces for OCaml
cppo                 1.6.8       Code preprocessor like cpp for OCaml
csexp                1.5.1       Parsing and printing of S-expressions in Canonical form
csv                  2.4         A pure OCaml library to read and write CSV files
dune                 2.9.1       Fast, portable, and opinionated build system
dune-configurator    2.9.1       Helper library for gathering system configuration
easy-format          1.3.2       High-level and functional interface to the Format module of the OCaml standard library
js_of_ocaml          3.11.0      Compiler from OCaml bytecode to JavaScript
js_of_ocaml-compiler 3.11.0      Compiler from OCaml bytecode to JavaScript
js_of_ocaml-lwt      3.11.0      Compiler from OCaml bytecode to JavaScript
js_of_ocaml-ppx      3.11.0      Compiler from OCaml bytecode to JavaScript
lwt                  5.5.0       Promises and event-driven I/O
lwt_ppx              2.0.3       PPX syntax for Lwt, providing something similar to async/await from JavaScript
menhir               20211128    An LR(1) parser generator
menhirLib            20211128    Runtime support library for parsers generated by Menhir
menhirSdk            20211128    Compile-time library for auxiliary tools related to Menhir
mmap                 1.1.0       File mapping functionality
ocaml                4.08.1      The OCaml compiler (virtual package)
ocaml-compiler-libs  v0.12.4     OCaml compiler libraries repackaged
ocaml-config         1           OCaml Switch Configuration
ocaml-system         4.08.1      The OCaml compiler (system version, from outside of opam)
ocamlbuild           0.14.0      OCamlbuild is a build system with builtin rules to easily build most OCaml projects.
ocamlfind            1.9.1       A library manager for OCaml
ocplib-endian        1.2         Optimised functions to read and write int16/32/64 from strings and bigarrays
ppx_derivers         1.2.1       Shared [@@deriving] plugin registry
ppxlib               0.24.0      Standard library for ppx rewriters
result               1.5         Compatibility Result module
seq                  base        Compatibility package for OCaml's standard iterator type starting from 4.07.
sexplib0             v0.14.0     Library containing the definition of S-expressions and some base converters
stdlib-shims         0.3.0       Backport some of the new stdlib features to older compiler
uchar                0.0.2       Compatibility library for OCaml's Uchar module
yojson               1.7.0       Yojson is an optimized parsing and printing library for the JSON format

$ make
ocamlfind ocamlc -package csv,lwt,js_of_ocaml,js_of_ocaml-lwt,lwt_ppx,js_of_ocaml-ppx -c common.ml
ocamlfind: Package `csv' not found
make: *** [makefile:28: common.cmo] Error 2
sebferre commented 2 years ago

Make sure that you have set the OPAM-related environment variables. Scripts for setting them are available in ~/.opam/opam-init/ . You can also run the command eval $(opam env). When you run which ocamlc, it should return a path like ~/.opam/4.11.1/bin/ocamlc. Same for which ocamlfind.

waldenn commented 2 years ago

Thank you Sébastien. Its building now.

You might want to add the following section to the README:

Build steps for Ubuntu (20.04 LTS):