Chapel Quickstart Instructions¶
These instructions are designed to help you get started with a source distribution of the latest Chapel release.
In the following instructions, note that building and using Chapel as described in steps 2-5 disables optional and advanced features in the interest of getting you a clean build as quickly as possible. Later sections explain how to re-build in the preferred configuration and how to enable more features, such as distributed memory execution.
See prereqs.rst for more information about system tools and packages you may need to have installed to build and run Chapel.
If you don’t already have Chapel 1.24, see https://chapel-lang.org/download.html .
If you are using a source release, build Chapel in a quickstart configuration. The quickstart script used below is designed to help you get started with Chapel. After that, you may want to switch to a more full-featured configuration. See using-a-more-full-featured-chapel below.
Expand the source release if you haven’t already:
tar xzf chapel-1.24.1.tar.gz
Make sure that you are in the directory you just created by expanding the source release, for example:
cd chapel-1.24.1
Set up your environment for Chapel’s Quickstart mode. If you are using a shell other than bash, see quickstart-with-other-shells below.
source util/quickstart/setchplenv.bash
Use GNU make to build Chapel. On some systems, you will have to use gmake. See building.rst for more information about building Chapel.
make
Optionally, check that your Chapel build is working correctly
make check
Compile an example program:
chpl -o hello examples/hello.chpl
Run the resulting executable:
./hello
Experiment with Chapel in this Quickstart mode to your heart’s content. Once you are comfortable with Chapel and interested in using a full-featured version in the preferred configuration, see the next section.
Using a More Full-Featured Chapel¶
To use Chapel in a more full-featured and preferred configuration, you will need to rebuild Chapel from source in a different configuration.
Open up a new shell to avoid inheriting the previous environment settings.
Repeat steps 2-5 above, but in Step 2, source
util/setchplenv.bash
instead ofutil/quickstart/setchplenv.bash
. This will set up your environment to use Chapel in the preferred configuration. Building this configuration involves compiling third-party packages, which will increase the overall build time. If you run into any portability issues, please let us know via bugs.rst.# Set environment variables to preferred configuration source util/setchplenv.bash # re-build Chapel make # make check is available but optional make check # compile a sample program chpl -o hello examples/hello.chpl # run the sample program ./hello
Note that the environment settings from
util/setchplenv.bash
will not persist beyond this terminal session. You can choose to sourcesetchplenv.bash
whenever you want to use relevant commands. If you want these environment settings to persist for future terminal sessions, copy the commands from the Recommended Settings in chplenv.rst into your~/.bashrc
file. You can also store Chapel configuration settings in a chplconfig file instead of your~/.bashrc
.See chplenv.rst for a complete description of Chapel’s configuration variables, what they mean, and how they can be set.
Using Chapel in Multi-Locale Mode¶
All of the instructions above describe how to run Chapel programs in a single-locale (shared-memory) mode. To run using multiple locales (distributed memory), please refer to multilocale.rst.
Performance¶
If you plan to do performance studies of Chapel programs, be sure to use the full-featured version from using-a-more-full-featured-chapel above and see https://chapel-lang.org/performance.html for performance tips.
Quickstart with Other Shells¶
If you use: |
then type: |
a bash-compatible shell (bash/zsh) |
|
a csh-compatible shell (csh/tcsh) |
|
the fish shell (fish) |
|
the Bourne shell (sh) |
|
What’s next?¶
For more information about Chapel, refer to the following resources:
Online documentation: |
|
Platform-specific notes: |
|
Example Chapel programs: |
|
Setting Chapel env vars: |
|
Building the compiler: |
|
Compiling Chapel programs: |
|
Executing Chapel programs: |
|
Debugging Chapel programs: |
|
Reporting bugs: |
|
Performance: |
|
Chapel modes for emacs/vim: |
|
Chapel’s file/dir structure: |
|
Changes since last release: |
|