The only dependency for libc
is Mojo.
You can install Mojo following the instructions from the Modular website.
Once you have created a Mojo project using the magic
tool,
- Add the
mojo-community
channel to yourmojoproject.toml
, e.g:[project] channels = ["conda-forge", "https://conda.modular.com/max", "https://repo.prefix.dev/mojo-community"]
- Add
libc
as a dependency:[dependencies] libc = ">=0.1.4"
- Run
magic install
at the root of your project, wheremojoproject.toml
is located libc
should now be installed as a dependency. You can import libc functions from the library, e.g:from libc import socket
See the examples in examples/sockets/ directory.
See the examples in examples/files/ directory.
To build the project, execute the following command:
./scripts/build.sh
To run the tests, execute the following command:
./scripts/run-tests.sh