Intro
Hey folks! I'm not sure how many folks out there have had the same struggles with installing and using Open-Watcom as I have. It seemed like every other guide, walk-through, and Wiki kept leading me to a half broken, half-complete and unusable setup. I finally, figured out a working setup. Why did I keep putting myself through this? I wanted to compile and use this: https://github.com/nilseuropa/dosmnt. Yes I'm aware there's already a binary in the repo, but I wanted to compile my own just in case. Beyond that, there's been several other open source projects I had to compile myself that I just couldn't because of not haivng a working Open-Watcom toolset After taking a moment to humble-brag, @eric suggested writing up the process to pass it along, so here we go!System Setup
This is the process I used on both Pop! OS (Ubuntu 22.04 LTS) and Pop! OS Cosmic (Ubuntu 24.04 LTS), and should work on any Ubuntu derivative. Make sure your install is fully updated first.Prerequisite Packages:
- git
- make
- gcc
- dosbox
- vim (personal preference for file editing)
Build
Before we can use Open-Watcom, it has to be built, but something that's not really very clear from the Open-Watcom directions (IMHO) is that the build/compilation is multi-step with a couple of hidden switches that have to be passed which are missing, even from the instrucions posted at the bottom here: https://github.com/open-watcom/open-watcom-v2/wiki/Build.Step 1. Clone the Open-Watcom repo to a local folder (I used ~/Development/ on my system)
git clone https://github.com/open-watcom/open-watcom-v2.gitStep 2. Navigate into the Open-Watcom folder:
cp setvars.sh my_setvars.shStep 3. Make a copy of the setvars.sh script:
cp setvars.sh[FONT=courier new] my_setvars.sh[/FONT]Step 4. Edit the my_setvars.sh script. We need to set the following:
export OWROOT=[FULL-PATH]
Use the full path of your folder (no symbolic links, shortcuts like ~, etc., trust me) for [FULL-PATH]
export OWDOSBOX=dosbox
Uncomment this line by removing the # from the fornt of the line
. ./my_setvars.shStep 6. Now comes the part that takes a while, run the following and wait.
./build.shNOTE: What's not very clear from the official instructions is that this is just building the tools used to build Open-Watcom, there's more necessary afterwards.
Step 7. When the compilation finishes, now we need to build the actual release:
./build.sh relNow that the actual release is built, we can proceed to the integration.
Integration
IMHO, this is the part that is sorely missing or unclear in nearly every guide or set of instructions I found.Step 1. Create the folder where the Open-Watcom tools will be located for use:
mkdir /opt/watcomStep 2. Copy the Open-Watcom release tools:
sudo cp -r rel/* /opt/watcom/ Step 3. Edit your environmental variables to add the tools into your path for use with make/compilatio tools:
vim ~/.bashrcWe need to add the following lines at the very end of the file:
export WATCOM=/opt/watcom
export PATH=$WATCOM/binl64:$WATCOM/binl:$PATH
export INCLUDE=$WATCOM/h
export EDPATH=$WATCOM/eddats
export WIPFC=$WATCOM/wipfcStep 4. Save and close the file.
Open-Watcom should now be built, integrated, and usable the next time you login/open a terminal window.
Testing
If you're like me, you want a "known good" test instead of jthe "run tests etc." from the offical docs. So let's use the open source project that inspired/caused me to finally get Open-Watcom compiled and working, the DOS Serial Mount project.Step 1. Clone the repo to a folder. I'm using my tried and true ~/Development one again
git clone https://github.com/nilseuropa/dosmnt.gitStep 2. Navigate into the repo's folder:
cd dosmntStep 3. Clean the existing DOS executable out:
rm -rf dos/build/*Step 4. Now for the true test, time to build a DOS executable!!! Run make within the dosmnt/dos folder:
makeThe compilation should finish without issue. If you check the dosmnt/dos/build folder, you should now have a shiny new DOSSRV.EXE executable, ready to run!