# Using ocsigenserver/eliom with sqlite3 on mac osx

**URL:** <https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714>\
**Category:** Ecosystem\
**Tags:** sqlite, eliom, ocsigen\
**Created:** [April 21, 2022, 10:26pm UTC](https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714 "2022-04-21T22:26:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TBrittain](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/tbrittain/32/2022_2.png) [@TBrittain](https://discuss.ocaml.org/u/TBrittain)\
**Post date:** [April 21, 2022, 10:26pm UTC](https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714/1 "2022-04-21T22:26:08Z")

</div>

I’m a long time linux user who just switched to using a mac, and I’m running into a problem getting my eliom projects to launch on ocsigenserver when using sqlite or pgsql for the persistent data backend (`PERSISTENT_DATA_BACKEND = sqlite` in my `Makefile.options` file for my eliom project).

**Error from `make test.byte`:**

```
ocsigenserver -c local/etc/<eliom_project_name>/<eliom_project_name>-test.conf

ocsigenserver: main: Fatal - While loading /Users/<my_comp_name>/.opam/default/lib/sqlite3/sqlite3.cma: error loading shared library: error loading shared library: Failure("dllsqlite3_stubs.so: dlopen(dllsqlite3_stubs.so, 0x000A): tried: 'dllsqlite3_stubs.so' (no such file), '/usr/local/lib/dllsqlite3_stubs.so' (no such file), '/usr/lib/dllsqlite3_stubs.so' (no such file), '/Users/<my_comp_name>/<eliom_project_name>/web/dllsqlite3_stubs.so' (no such file), '/usr/local/lib/dllsqlite3_stubs.so' (no such file), '/usr/lib/dllsqlite3_stubs.so' (no such file)")

make: *** [test.byte] Error 52

```

My sqlite3 module works just fine on its own. I’ve tried all the mac specific items mentioned at [GitHub - mmottl/sqlite3-ocaml: OCaml bindings to the SQLite3 database](https://github.com/mmottl/sqlite3-ocaml#build-issues), but no luck.

Have any other mac/eliom users run into this issue?

Thanks!

---

<div class="post-metadata">

**Author:** ![dbuenzli](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dbuenzli/32/18_2.png) [@dbuenzli](https://discuss.ocaml.org/u/dbuenzli)\
**Post date:** [April 21, 2022, 11:01pm UTC](https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714/2 "2022-04-21T23:01:37Z")

</div>

The stubs for the bytecode library of `sqlite.cma` are not found. They should be in `$(opam var lib)/stublibs` so this should be in your ocaml bytecode stub load path, see the manual [here](https://ocaml.org/manual/runtime.html#s%3Aocamlrun-dllpath).

Maybe you are just missing an `eval $(opam env)` in your shell. This should setup `CAML_LD_LIBRARY_PATH` to point to the directory mentioned above. Check that `env | grep CAML_LD_LIBRARY_PATH` has the directory in which the missing stubs resides and try to run your program again.

---

<div class="post-metadata">

**Author:** ![TBrittain](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/tbrittain/32/2022_2.png) [@TBrittain](https://discuss.ocaml.org/u/TBrittain)\
**Post date:** [April 22, 2022, 1:59am UTC](https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714/3 "2022-04-22T01:59:03Z")

</div>

Thanks, this helped me partially solve the issue. I created a symlink to the needed sqlite stubs file directly in the ocsigen project, which allows the project to compile and run. My env and CAML\_LD\_LIBRARY\_PATH variable are setup correctly, but it seems that ocsigenserver is just not looking for the stubs file in that directory. I’ll keep digging around and post something here when I find a fix.

---

<div class="post-metadata">

**Author:** ![Kakadu](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kakadu/32/1204_2.png) [@Kakadu](https://discuss.ocaml.org/u/Kakadu)\
**Post date:** [April 22, 2022, 6:57am UTC](https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714/4 "2022-04-22T06:57:34Z")

</div>

There is also a fancy opam feature that allows to investigate which files have been installed by opam: `opam show sqlite3 --list-files`.

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [April 22, 2022, 7:57am UTC](https://discuss.ocaml.org/t/using-ocsigenserver-eliom-with-sqlite3-on-mac-osx/9714/5 "2022-04-22T07:57:42Z")

</div>

Out of curiosity, what is the reason `ocisgenserver` being a bytecode executable instead of a native one?

Cheers,  
Nicolas
