# Using ppx with ocamlc directly

**URL:** <https://discuss.ocaml.org/t/using-ppx-with-ocamlc-directly/9313>\
**Category:** Learning\
**Created:** [February 12, 2022, 3:17pm UTC](https://discuss.ocaml.org/t/using-ppx-with-ocamlc-directly/9313 "2022-02-12T15:17:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![choltreppe](https://avatars.discourse-cdn.com/v4/letter/c/b487fb/32.png) [@choltreppe](https://discuss.ocaml.org/u/choltreppe)\
**Post date:** [February 12, 2022, 3:17pm UTC](https://discuss.ocaml.org/t/using-ppx-with-ocamlc-directly/9313/1 "2022-02-12T15:17:25Z")

</div>

Hey there

Im trying to run a ppx directly with ocamlc not using dune.  
just ` -ppx [name_of_ppx]` doesnt work.  
I searched for quite a while now and didnt realy find an explenation of how to correctly use the -ppx attribute.

---

<div class="post-metadata">

**Author:** ![hyphenrf](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/hyphenrf/32/2733_2.png) [@hyphenrf](https://discuss.ocaml.org/u/hyphenrf)\
**Post date:** [February 12, 2022, 3:39pm UTC](https://discuss.ocaml.org/t/using-ppx-with-ocamlc-directly/9313/2 "2022-02-12T15:39:00Z")

</div>

it’s `... -ppx "the_ppx_library/ppx.exe -as-ppx" ...`  
see [here](https://git.sr.ht/~hyphens/ppx_seq/tree/master/item/README#L10-43)

also:  
If you look at the help message: `ocamlc -help`  
you get back a description of how it works:  
`-ppx <command> Pipe abstract syntax trees through preprocessor <command>`  
which implies you need a standalone ppx command to pipe the program ast through.

The manual page also expands on the brief help message:

```nohighlight
...
       -ppx command
              After parsing, pipe the abstract syntax tree through the pre‐
              processor command. The module Ast_mapper(3) implements the ex‐
              ternal interface of a preprocessor.
...

```
