Unidata / UDUNITS-2

API and utility for arithmetic manipulation of units of physical quantities
http://www.unidata.ucar.edu/software/udunits
Other
62 stars 36 forks source link

UDUNITS-2 Cmake/Visual Studio build broken. #40

Closed WardF closed 8 years ago

WardF commented 8 years ago

In the course of answering a question re: UDUNITS-2 Issue https://github.com/Unidata/UDUNITS-2/issues/16, I've discovered that the latest code in master fails to compile on Windows with Visual Studio. The culprit is the auto-generated file scanner.c, which has introduced a dependency on unistd.h. This issue is clearly known on other platforms, as a lack of unistd.h has been mitigated in autotools-based builds.

The fix should be fairly simple; I forked and took a quick pass, but the fix I added didn't work as expected. I will pursue as best I can, although my focus right now is on some netcdf-c issues.

ocefpaf commented 8 years ago

@WardF it will be awesome to get rid of a bogus dependency. Meanwhile we are building on windows by copying an empty file named unistd.h to the build directory.

(See https://github.com/ocefpaf/conda-recipes/blob/master/udunits2/bld.bat#L14)

WardF commented 8 years ago

I've addressed this issue in https://github.com/Unidata/UDUNITS-2/pull/41. I don't have access to merge the pull request, and even if I did, the project maintainer is @semmerson so I'd want him to review it first. But, once reviewed, it can be merged.

The changes were tested in Windows 10 (64-bit) with Visual Studio 12. Testing was also performed on the latest OSX, and a Ubuntu 15.10 environment.

semmerson commented 8 years ago

Looks good. I merged and pushed to GitHub. Hopefully, a new release will be out by COB tomorrow.