Hi there,
I've installed nim from rpm package in OS Tumbleweed It's version 0.19.2
I've set PATH to bin and it works.
I can write code and compilation is successfull.
The problem arise when I try to import packages. In my file when I import e.g os it tells me:
Hint: system [Processing] Hint: gret [Processing] gret.nim(2, 8) Error: cannot open file: os
gret is my hello_world like file.
What I found with strace is that Nim is looking for os module in lib file as in the following line:
stat("/home/sebastian/nim/lib/os.nim", 0x7fff80637ac0) = -1 ENOENT (No such file or directory)
I found os.nim in lib/pure file.
When i run nim dump it leads to valid lib folder. What should i do to fix imports without creating a mess?
I think this is more an issue of your package manager than a Nim issue. (Or you may have installed an older Nim release and not fully removed it.) And Nim 019.2 is already old.
For Linux systems, git install of latest Nim devel is very easy, I think most users do that. You only have to manage to install git before, then follow these instructions: (step 1 and if your box is posix step 2, which is a single script.) All files are installed into a single directory called Nim inside of your home directory, you do not need root rights. Only thing what you may have to do additional is settings paths, i.e. for Nim executable. (Don't forget to remove all previously installed Nim stuff before.)
https://github.com/nim-lang/Nim#compiling
The additional benefit is that updating then is done in a few seconds with only two instructions:
# for update:
# cd Nim
# git pull
# ./koch boot -d:release
Stefan, I followed your advice and compiled thenim compiler. The end result is that everything works great, and all libraries can be imported perfectly. I was a little scared about compilation process with gcc because there was some dependency issues in the past, but not with Nim. I have fresh Nim compiler and I'm very happy.
I would like to notice that comparing that fresh build with installation from distro package i can see how less configured is the version from package, and indeed the best way to start with Nim is compilation from git sources.
Thank you