I've just setup Nim v1.17.2 on Win10 x64, using the MinGW-w64 package downloaded from Nim download page. I've tested compiling various Nim examples, and the Nim compiler works fine so far. (before I had Nim v1.16.0, which came with an installer, so I've just uninstalled it and setup v1.17.2 manually, so chances are that I might have got something wrong).
I've also added %USERPROFILE%\.nimble\bin\ to my User Path — but I think this might not be required on Windows, since I've tried using Nimble without that on the PATH and it seemed to work just fine. Is it necessary on Windows?
When I try nimble test I get this error:
C:\Nim>nimble test
Executing task test in C:\Nim\compiler.nimble
Verifying dependencies for [email protected]
Compiling C:\Nim\tests\benchmark.nim (from package compiler) using c backend
Hint: used config file 'C:\Nim\config\nim.cfg' [Conf]
Hint: system [Processing]
system\alloc.nim(4, 1) Error: undeclared identifier: 'assert'
Error: Execution failed with exit code 1
Is the above Error something I should worry about? does it mean my setup is not good?
But Nimble seems to be able to carry out all other operations fine, I've even downloaded some packages without problems.
Also, from the Nimble documentation it seems that I should find Nimble configuration file here:
C:\Users\<YourUser>\AppData\Roaming\nimble\nimble.ini
... but there is no nimble folder inside \AppData\Roaming .
Nim v1.17.2
*0.17.2
When I try nimble test I get this error:
That does seem like there is something wrong. No idea what, but it might help if you reinstall Nim. How did you install it btw? If not via choosenim then I suggest you give it a go.
.. but there is no nimble folder inside AppDataRoaming .
It's not there by default. If you want to configure Nimble you should create it...
Hi dom,
How did you install it btw?
I've donwloaded all the x86-64 Zip files from the download page (including MinGW-w64). I've setup MinGW in "C:\MinGW\" and added it's "bin" folder to the path, then unpacked Nim in "C:\Nim\" and run "finish.exe". As I said, it can compile source alright.
I've alsp run "chock tests" (not to the end, it took ages so after about an hour I had to stop it's execution). Most tests passed, a few skipped, but I noticed that many of the C++ tests where failing.
If not via choosenim then I suggest you give it a go.
I didn't use choosemin because I'm not sure how it actually works. I've noticed in the source code that it seems to download only the x86 version of MinGW:
https://github.com/dom96/choosenim/blob/master/src/choosenim/download.nim#L15
const # Windows-only
mingwUrl = "http://nim-lang.org/download/mingw32.tar.gz"
dllsUrl = "http://nim-lang.org/download/dlls.tar.gz"
Does it always install MinGW? And only 32 bit?
I'd like to have MinGW 64 bit, and available system wide, not only within Nim environment; I haven't understood how choosenim handles this.
Yeah, choosenim currently does not support 64bit.
Then I'll have to wait. Is there an estimate about when it might support it?
As for my setup, I'm really confused. I did follow all instructions, and GCC is available on PATH, and Nim too — and really, there isn't much to the setup to be done. I've compiled quite a few code examples, and they seem to work. Nimble succesfully installed dependencies. It's only the tests that fail (both Nimble and koch, the latter with Cpp tests mainly). So, somehow (from koch tests) it looks like there are quite a lot of test failures when it comes to C++. I'm not sure how bad this can be, but I guess that sooner or later I'll be banging against some limits.
Could it just be that the tests are not tuned for Win 10 x64? Or, I wonder, if the Fall Creators Update introduced breaking changes...
Anyhow, for now I'll play around with Nim some more, and go over the book exercises again; I'll still be benefiting from learning the basics. Of course, I can just move to my other Linux machine, but I was hoping to use Nim to create DLLs to use with other languages.
To be honest, my worry is just that in the past I came across quite a few great and robust languages (like Haskell, to name one) that never seem to work 100% under Windows (there are always problems with some libs, dependencies, or compiling DLLs, etc.) despite the years they've been around in stable release. In the last years many huge leaps have been achieved in cross-platformness, and this is really great; but with Windows there are always pitfalls round the corner, and often cross compiling from Linux seems the better choice.
Learning a new language (especially if it involves a shift in paradigms from the languages one has worked with) is already a challange, but when there are issues related to the environment then it's difficult to pinpoint if the problems are due to one's lack of knowledge or to issues with the OS.
Thanks for the help Dom!
Thanks @Araq. I tried out nimble test because it showed up in the commands help.
As I said, so far most sources that I've tried to compile worked out. But I was worried about the koch tests showing a high number of failures for the Cpp tests.
On windows, nimble already available in bin folder. Setup the path to nim.exe will automatically set the path for nimble.exe, also any required DLLs for SSL, 7z, libui, etc.
FYI, I did some work which the executable running on debian but I coded and tested on windows first, all I did was copy my source code to debian machine, and it compiled and ran fine without me changing anything in my code. (Usually people develop on Unix and cross compile to Windows tho, I just too lazy to setup the devs env again so I just used the existing devs env ;) )