Setting up Metacall development environment on windows
To learn about metacall checkout my previous articles here
MetaCall allows you inter-connect any programming language with a simple syntax. It was created with user experience and high performance applications in mind.
MetaCall is open-sourced under Apache 2.0 license. Let's switch gears and setup our windows system to build and develop metacall locally.
Clone the metacall core repository from here https://github.com/metacall/core/
git clone https://github.com/metacall/core
Download and install Visual Studio 2019
- Under Workloads select Desktop development with C++
- Make sure all the components are selected as in above image.
- After setup restart your system.
corerepo in Visual Studio code or your editor of choice.
The metacall build step comprises of three steps
- Environment setup
- Configuring cmake
- Building the project using cmake
Setting up the environment is a one time step, this is done to install various dependencies and other important configuration for the runtimes. For example setting up
Python, Nodejs, Java, etcfor metacall.
# open command prompt and run powershell .\tools\metacall-environment.ps1 python nodejs
This script will setup the environment for
nodejs. We can also pass other runtimes that we want to build for metacall
powershell .\tools\metacall-environment.ps1 python nodejs typescript java
This set prepare the build directory and sets up
CMAKEfor building metacall along with its various components
cd build powershell ..\tools\metacall-configure.ps1 debug scripts ports tests python
In this example we are configuring
CMAKEto build metacall in
debugmode along with its scripts, ports, tests and support for python.
We can include other components as we did in above step
powershell ..\tools\metacall-configure.ps1 debug scripts ports tests python nodejs typescript java
Finally build metacall
To build metacall on debug mode run the following command inside the
powershell ..\tools\metacall-build.ps1 debug
We can also run the test suite by providing the
testsargument to the above command
powershell ..\tools\metacall-build.ps1 debug tests
- Windows is notoriously hard to develop and troubleshoot low level stuff, you might face few issues with the setup.
- Make sure you don't have other compilers like
MSVCelse you will get build errors.
- Also make sure to use the Visual Studio 2019 along if you have other versions installed than you will need to manually pass the generator flag to
# update this line in metacall-environment.ps1 cmd.exe /c "cmake $CustomFlags $BUILD_STRING -G ""Visual Studio 15 2019"" .."
Feel free to reach out in comments if you have any questions or join the metacall discord/telegram