To compile an application, click the Compiler button (

) in the
Home toolbar’s
Main section and specify the output directory, the platforms to compile for, a splash screen, and possibly some additional settings (see below); then click the
Compile Application button (

) or press F8. You can also use the
comsolcompile (Windows) and
comsol compile (Linux and macOS) commands to compile an application on any supported platform (see
The COMSOL Commands in the
COMSOL Multiphysics Reference Manual).
The Compiler node’s
Settings window contains the following sections:
In the Directory field, specify the output directory where the compiled application will be stored, or click the
Browse button to browse for a location.
Under Runtime, from the
Runtime library list choose
Download (the default) or
Embed, to embed the runtime library in the compiled application. If you choose
Download, users can download and install the runtime library on demand, By excluding the COMSOL Runtime, you can create much smaller executable files.
Under Platforms, select the
Windows;
Linux;
Linux, ARM;
macOS, Intel; and
macOS Apple silicon check boxes as desired (depending on the platforms where you want users to be able to run the applications). By default, only the
Windows check box is selected.
To compile the application into an executable application, click the Compile Application button (

) at the top of the
Settings window or press F8. The size of a created application is about 300 MB with an embedded runtime; with a downloaded runtime, it is just a few MB in addition to the model’s size.
The Icon for Windows and
Icon for macOS lists appear when the corresponding check boxes for each platform have been selected under
Platforms in the
Executable section. From the lists you can select a number of available icons. Click the
Add Image to Library and Use Here button (

) to add another icon to use. The following formats are supported:
Click the Export button (

) to export the image used for the icon to a file.
From the Splash list, select an image to use as the splash-screen image when launching an application. The
Default splash screen is a generic default splash screen for compiled applications. Click the
Add Image to Library and Use Here button (

) to add any other BMP image to the list of splash-screen images and use it. Under
Preview, you can see what the currently selected splash-screen image looks like. Click the
Export button (

) to export the image used for the splash screen to a file.
Custom-made physics interfaces, created with the Physics Builder, can be embedded into the compiled application, making it easy to share that type of applications. From the Physics interfaces list, choose the location of the custom-made physics interface:
None (the default, if no such physics interfaces exist or should be included);
Development files (physics interface files that you can add and test in a COMSOL Desktop session);
External folder, which you specify in the
Folder field (for physics interface files in an archive folder that has not been converted into a JAR archive); or
External Java archive, which you specify in the
File field (for physics interface files in JAR archives resulting from a Physics Builder compilation). See the
Physics Builder Manual for more information about these file types.