This is a Scheme implementation, supporting R6RS and R7RS specification.
Sagittarius uses CMake for its building infrastructure. If you do not have it on your platform, please install it.
The minimum required version of CMake is 3.12. The older version may work but not guaranteed.
The runtime of Sagittarius is written in C. The C compiler must support C11 features.
If your environment already has required libraries and just want to
install to default location, run the following commands in the
directory where all distributed files are expanded (c.f. By default
it'd be sagittarius-X.X.X, X.X.X is the version you downloaded):
cmake .
make
make installFollowing sections describes more details.
Sagittarius depends on the following libraries.
If you are using Linux which supports apt, then you can simply
execute the following command:
apt install libgc-dev, zlib1g-dev libffi-dev libssl-dev libpam0g-devFor Boehm GC, you need to install it with the option
--enable-threads=pthreads. If your CPU is not incredibly old, you
can also specify the option --enable-parallel-mark.
If you are too lazy to download the archive file of GC, CMake will download it for you. Make sure to run the following commands from in GC directory:
./configure \
--enable-threads=pthreads \
--enable-parallel-mark \
--enable-large-config
make
make installNote: most of the Linux distributions already have Boehm GC in their
package management system, such as apt-get. I recommend to use it
for security reason.
After installing CMake and dependent libraries, you are ready to build Sagittarius; type the following command:
cmake .Note: The above command assumes you are in the source directory.
It is possible to build Sagittarius in a directory that is not the top source directory of the distributed package (out-of-tree building); for example:
mkdir build
cd build
cmake ${path to Sagittarius' source directory}
makeTo run the tests, specify test target.
make testOr, alternatively, you can also use ctest. This is convenient to
test individual tests.
To install Sagittarius non default location, you need to specify
CMAKE_INSTALL_PREFIX variable.
cmake . -DCMAKE_INSTALL_PREFIX=/path/to/installOn some environment, there are 64 bits runtime specific directories
such as lib64. To install Sagittarius runtime in the directory, then
you can specify LIB_DIR variable as the following:
cmake . -DLIB_DIR=lib64Then the runtime install directoy will be
CMAKE_INSTALL_PREFIX/LIB_DIR. There are also the variables to
specify bin, include and share directories, and the directory
for the .pc files; BIN_DIR, INCLUDE_DIR SHARE_DIR, and
PKGCONFIG_DIR, respectively.
Since 0.5.6, Sagittarius's REPL is renamed to sagittarius and legacy
sash is kept as a symbolic link. If you don't need the symbolic link
then you can put the INSTALL_SYMLINK option off as the following:
cmake . -DINSTALL_SYMLINK=0After a successful compilation, it is possible to install Sagittarius
to the location specified by CMAKE_INSTALL_PREFIX or default system
location if it's not specified with the command:
make installAfter installation, you might need to run ldconfig to run
Sagittarius properly.
Note: For some reason, you might want to build a 32-bit runtime on a 64-bit platform. The following command can be used for this purpose;
cmake . \
-DCMAKE_CXX_COMPILER=${your 32 bit C++ compiler} \
-DCMAKE_C_COMPILER={your 32 bit C compiler}Make sure you have all the required 32-bit executables and libraries.
Only with Homebrew is tested. A user can install sagittarius directly with homebrew, via
brew install sagittarius-schemeAlternately, the user can install the following dependencies and then make sagittarius locally.
Installing libffi, CMake, Boehm GC and OpenSSL.
brew install libffi cmake bdw-gc opensslAfter installing dependent libraries, the rest of the process are the same as Unix-like environment.
If cmake can't find libffi, then you can specify the location via
FFI_LIBRARY_DIR option like the following.
cmake . -DFFI_LIBRARY_DIR=/opt/homebrew/Cellar/libffi/3.4.6/libNote: some Mac OS X environment may not be able to find ar command
because /usr/bin/gcc is identical as /usr/bin/clang. In that case,
export CC and CXX environment variable with proper GCC and G++
command path respectively so that CMake can find the command.
FreeBSD has multiple type of Boehm GC system libraries; gc,
gc-threaded and gc-redirect. Sagittarius requires threaded runtime
to make thread library works properly. The building process checks if
gc has GC_get_parallel() function and if it doesn't then tries to
use gc-threaded library. Please make sure your system has
gc-threaded or gc built with multi thread option.
NB: If you install gc without build option, then default is without
thread support. In such a case, you need to install gc-threaded as
well.
The command below installs the requried dependencies.
pkg install curl libffi boehm-gc-threaded cmake openssl bashFor OpenBSD, you can use pkg_add command to install dependencies.
You can use the command below to install the required components.
pkg_add -IUv curl libffi boehm-gc cmake bash gmakeNOTE: the command is expecting to be fresh environment.
On Windows, you need to create an installer and Sagittarius is using innosetup for it. Please install it.
You need to install MSVC preferably Visual Studio 2019 or higher. Run
Visual Studio Command Prompt and go to the directory which Sagittarius
source codes are expanded.
cmake . -G"NMake Makefiles"
nmake
nmake testcmake . -G"Ninja"
ninjaFor Ninja, you can build with multiple processor by specifying -j option.
For example:
rem This build Sagittarius with 8 processes
ninja -j8After these commands, you move to the win/ directory and double
click the file innosetup.iss. Go to [Build] - [Compile], then it
will create the installer. For more detail, please see Inno Setup's
document.
Experimentally, we support other build tools. Below are the supported ones:
- MSBuild
cmake . msbuild /p:Configuration=Release Sagittarius.sln
| OS | x86 | amd64 | ARM64 | ARM | ppc64le |
|---|---|---|---|---|---|
| Linux | ✅✔️ | ☑️✔️ | ✔️ | ✔️ | |
| macOS | ✅ | ||||
| FreeBSD | ✅ | ☑️ | |||
| OpenBSD | ✅ | ☑️ | |||
| Windows | ✅ | ✅ | ☑️ |
- ✅ Tested with CI
- ☑️ Tested locally
- ✔️ Docker image
The tests are executed via CTest. In case you want to have verbose output,
you can use ctest command. For example, the below command shows the output
of the test execution when the test failed.
ctest --output-on-failureFor more options, please refer the official document of the
CTest
If you have any question, please ask on the following Google group:
If you find a bug, please report it on the project bug tracking board:
Or you can report it on Google group.
See HACKING.md file.