I’m not sure what isn’t compiling, so let me go into detail.
I have an i7 4C|8T laptop, and I use Linux.
In my /home
directory I have the extracted *.tar
directories for Crystal versions.
So I have directories like crystal-0.34
, crystal-0.36.1
, etc. I also have a crystal
folder which contains the latest version, currently for 1.0.0
. I have a symlink
pointed to ~/crystal/bin/crystal
, so all I do for a new version is extract it to a folder and rename it to crystal
(after renaming the old crystal
to its version number, if I want to keep it).
So, for file name twinprimes_ssoz.cr
, to compile it with the current version I do:
$ crystal build twinprimes_ssoz.cr -Dpreview_mt --release
I then typically rename the binary to twinprimes_ssoz.xyz
to show the version.
So for 0.34, I use the following statement to compile:
$ ~/crystal-0.34/bin/crystal build twinprimes_ssoz.cr -Dpreview_mt --release
To run the binaries I do:
$ CRYSTAL_WORKERS=8 ./twinprimes_ssoz.xyz <input value(s)>
This is my system for using multiple Crystal versions to
compile|run the same program, to compare their differences.