I wrote a Nim program,
echo("Hello.")
And then I tried to compile the compilation for a Linux machine,
nim c --cpu:i386 --os:linux -c hello.nim
This produced the following conclusion:
config/nim.cfg(45, 2) Hint: added path: '/Users/connor/.babel/pkgs/' [Path] config/nim.cfg(46, 2) Hint: added path: '/Users/connor/.nimble/pkgs/' [Path] Hint: used config file '/usr/local/lib/nim-0.10.2/config/nim.cfg' [Conf] Hint: system [Processing] Hint: hello [Processing] Hint: operation successful (8753 lines compiled; 0.140 sec total; 14.148MB)[SuccessX]
At this point, I went to the nimcache/ directory and tried to execute:
gcc hello.c -o hello.o
But this gave me an error:
hello.c:5:10: fatal error: 'nimbase.h' file not found
I thought, βNot a biggie, I just find nimbase.h and put it in the nimcache directory there,β but after that I got a new error,
In file included from hello.c:5: ./nimbase.h:385:28: error: 'assert_numbits' declared as an array with a negative size ...sizeof(NI) == sizeof(void*) && NIM_INTBITS == sizeof(NI)*8 ? 1 : -1]; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
I'm not sure what I should do with this. I tried using the --genScript , but this led to similar errors. I am running OS X Yosemite.
Thanks!
Update:
I was not sure how many architectures were supported for the --cpu: option, but I found a (incomplete?) List on What makes it practical on a blog. I ended up calling
nim c --cpu:amd64 --os:linux -c hello.nim
This prevented the error that I saw when compiling in my Linux box. If you use Linux or OS X, you donβt know what architecture you can name,
less /proc/cpuinfo