The nimformat project on github uses nim with nimpy to build a python module that can be packaged and installed with python's package manager (pip). The package includes the c source files and pip compiles them to build the python module on the target machine.
https://github.com/UNIcodeX/nimformat/
I'm interested in using this scheme to make my own python package.
For this python packaging scheme to work the c files generated by nim and nimpy need to compile on all the target platforms, and the list of source files to compile must to be the same on all the target platforms.
The source file list comes from the files generated when running "nim --compileOnly ..." plus nimbase.h. You find the c files in the cache's nimformat_r folder.
When compiling on the Mac you get a system file stdlib_posix.nim.c that you do not see on Ubuntu. This file is necessary on the Mac, without it you see compile errors. Is this a bug, or am I doing something wrong?
Is there a way to make this cross platform scheme work? Do you see any other issues with it?
For this python packaging scheme to work the c files generated by nim and nimpy need to compile on all the target platforms, and the list of source files to compile must to be the same on all the target platforms.
Well you need to find some other scheme that works then as the list of source files is platform specific as you noticed and in C land OS specific .c files are not uncommon either.
I've been looking for another approach. From what I've read, the python wheel package can do what I want, but it is still a mystery to me how.
Has anyone done this and know of a project I can learn from? I haven't been able to find an example in the python or nim public package lists.