Skip to content

Getting Started: BSD

Eric Sessoms edited this page Dec 21, 2021 · 1 revision

Installing on BSD is very similar to installing on Linux or macOS. A few notes:

  • Like macOS, you need to explicitly use GNU tar.
  • On FreeBSD you need to update the system definition to not default to g++.
  • You need to explicitly state the target, because it is not correctly detected.

With these changes, FreeBSD and NetBSD both install and run cm3, and more-or-less pass the compiler test suite.

OpenBSD fails to compile, citing a "double free", which is most likely a legitimate bug that all other platforms simply ignore.

FreeBSD

# prerequisites
sudo pkg install cmake gtar python3 unixODBC wget

# download and extract
wget https://github.com/modula3/cm3/releases/download/d5.11.4/cm3-dist-AMD64_LINUX-d5.11.4.tar.xz
gtar Jxf cm3-dist-AMD64_LINUX-d5.11.4.tar.xz

# fix system definition
sed -i -e 's/^SYSTEM_CC.*/SYSTEM_CC = "c++ -fPIC"/' cm3-dist-AMD64_LINUX-d5.11.4/m3-sys/cminstall/src/config-no-install/AMD64_FREEBSD

# build and install
mkdir build
cd build
../cm3-dist-AMD64_LINUX-d5.11.4/scripts/concierge.py install --prefix $HOME/cm3 --target AMD64_FREEBSD
set path = ($HOME/cm3/bin $path)

NetBSD

# prerequisites
sudo pkgin -y install cmake gtar python38 unixodbc
sudo ln -s /usr/pkg/bin/python38 /usr/pkg/bin/python3

# download and extract
wget https://github.com/modula3/cm3/releases/download/d5.11.4/cm3-dist-AMD64_LINUX-d5.11.4.tar.xz
gtar Jxf cm3-dist-AMD64_LINUX-d5.11.4.tar.xz

# build and install
mkdir build
cd build
../cm3-dist-AMD64_LINUX-d5.11.4/scripts/concierge.py install --prefix $HOME/cm3 --target AMD64_NETBSD
PATH=$HOME/cm3/bin:$PATH
Clone this wiki locally