New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building with CMAKE on Windows #16
Comments
Hi Rich, Apparently, the "FindEXPAT" plugin of CMake is unable to locate the EXPAT Regards, On Thu, Jul 17, 2014 at 2:28 PM, Rich Signell notifications@github.com
|
I downloaded the expat-win32bin-2.1.0.exe from http://sourceforge.net/projects/expat/?source=dlp and installed it in the default location: Do I need to set some environment variables for Cmake to find it? |
@aashish24, any ideas? |
@rsignell-usgs looks like for some reason its looking in the Program Files(x86). you can set these manually and see if that works? These should be visible in the ccmake or cmake-gui EXPAT_INCLUDE_DIR |
the problem with expat is not related to CMAKE_INSTALL_PREFIX. You may have to click on the Advanced check option to see EXPAT variable. |
I'm setting the EXPAT_LIBRARY, but when I click |
EXPAT_LIBRARY should be set tot he libexpat.dll |
Okay, and what about EXPAT_INCLUDE_DIR? |
Seems like you only have one error? libgen,h is not found? |
Looks like you are using cygwin shell and that may be the problem source. |
I was using the Visual Studio 2008 Command Prompt. Do I want something else? |
Right. but looks like you are using the command prompt in a cygwin environment which I think made udunits thinks it needs libegen.h which I don't think exist in windows environment. Are you using git bash-shell of git via cygwin? |
Hi, just chiming in since I've only now caught up on the messages. I don't -Ward On Fri, Jul 18, 2014 at 9:59 AM, Rich Signell notifications@github.com
|
Thanks Aashish. What was the underlying problem with the EXPAT plug-in and can we get Regards, On Fri, Jul 18, 2014 at 9:27 AM, Rich Signell notifications@github.com
|
Yeah, there is a problem finding
Yipes. Do we need to that kind of hacking to get this to work? |
Building the UDUNITS-2 package via CMake has only been tested using the Regards, On Fri, Jul 18, 2014 at 12:24 PM, Rich Signell notifications@github.com
|
I had no problem compiling libexpat via cmake on Windows. I'm poking around with UDUNITS-2 right now. I'm not sure I'll have time to incorporate all of the changes suggested by vapor's port today, but as it stands it looks fairly straightforward. |
@WardF, I was actually hoping you would try the Native Windows port PR by sdebionne: #4 You can grab the zip from here: and just build the solution in |
Great, I'll give that a try. |
Does not work right out of the box with Visual Studio 10, unfortunately. It appears that it needs some of the changes made by VAPOR (conditional inclusion of strings.h, for example). I'll poke around with it some more; I've forked UDUNITS-2 to https://github.com/WardF/UDUNITS-2, so that I can avoid polluting the main branch. |
@WardF, I'm really hoping we can get UDUNITS working with MS Visual Studio 2008 so that we can build conda python modules that depend on it. In our Integrated Ocean Observing System (IOOS) work, lack of UDUNITS on PC is a blocker for our CF and ACDD compliance checker (https://github.com/ioos/compliance-checker) and for the British Met Office Iris Project (https://github.com/SciTools/iris), which we depend on for reading CF compliant datasets in Python. Sounds like the VAPOR team would be appreciative too! Do you have a few cycles to spend on this? |
@rsignell-usgs I don't today, but I will find some time tomorrow to look at it. My feeling is it will either A) Be very straight forward and I can have something that works with VS put together in a few hours, or B) There are deep hooks into Unix/POSIX that will be very difficult to work around. Given the preponderance of extant Windows/UDUNITS-2 projects, I'm hopeful that it will be the former instead of the latter. I'm currently working on some |
Lets us know if we can help. Although we can not help officially (as we don't have any direct funding for this) we can try to help as much as possible over the emails. |
Here is what I've found. The following things would have to be implemented in order for me to move forward towards compiling UDUNITS-2 with Visual Studio 2010:
On Windows using MSVC, What work I've done so far lives at http://github.com/WardF/UDUNITS-2. CMake is used to generate Visual Studio project files, and I have been focusing on getting libudunits2 to compile; after that works, I was planning on moving on to the 'udunits2' target. So! That is where we're at currently. I am open to further suggestions, if solutions to the above occur to anybody. |
@WardF , thanks so much for scoping the problem. Now that the issues are known, it would be great if could move into a fast tracked "official" project instead of a "doing a favor for Rich" project. ;-) Would the best way to get this work on the official schedule to be to speak with Ethan or Mohan, or should I just wait? Please advise. I'm sure the IOOS system-test developers and British Met Office developers would be happy to pile on with their endorsement of this work as being immensely useful and would be used right away. |
@rsignell-usgs Rich, no problem. I'm disappointed that it wasn't something I could just make happen. I would start with @semmerson, as UDUNITS is his project. I've briefed him on what I found, in addition to my comment above. He will have a better perspective on moving forward with this in whatever fashion, "official" or otherwise. As always, I'm available and happy to help to the extent that my big-picture workload will let me. |
Additionally, I don't know if these are issues which are corrected in later versions of Visual Studio; I see there is a Visual Studio 2012 express that I can try to build with. It's a long shot, but perhaps these functions are implemented in the newer tools. @aashish24, do you know if newer VS provides |
@WardF, actually I belive we will need to use Visual Studio 2008 for compatibility with python 2.7. @aashish24, can you confirm that as well? |
Ah, good to know; scrolling back I see that now. Once it is working with On Wed, Jul 23, 2014 at 2:18 PM, Rich Signell notifications@github.com
|
okay, hopefully with @semmerson knowing the UDUNITS codebase, @WardF knowing the Windows stuff, and @aashish24 knowing the CMAKE stuff, we can bring this wild pony into the stable! |
Reading @WardF's comments a bit closer, it seems that the |
I see that in the approach the Vapor gang used, they did this:
Does this work? |
I'm on my way to the vast wilderness that is the middle of nowhere right now (camping in Wyoming) but will take a closer look at tsearch.h Monday. I had missed that in the README that Vapor provided. Have a good weekend! Sent from my iPhone
|
@rsignell-usgs I don't have any replacement (cross platform search) for search.h. Seems like you can replace it with tsearch.h as you found out. |
I have some more time to look at this and adopting tsearch.c and tsearch.h got through that issue, thanks very much for your input @rsignell-usgs and @aashish24! I've tackled the next issue which came up, the lack of |
I'm able to get
Next I should be able to find some time in the next day or so to try to get udunits2 itself going. At a glance, it appears that perhaps it only needs to have a replacement @semmerson, does UDUNITS-2 require large file support? I don't believe it would but I'm not certain. If it does, then there is work to be done getting that wired in. It took more effort than anticipated to wire in LFS for netcdf on Windows. So, it's doable, but not something I'm going to even think about unless I know for sure it is required.
|
@WardF. This is exciting! Go Ward Go! 👏 |
@WardF UDUNITS doesn't require support for large files. The only files the UDUNITS library deals with are the XML files that contain the units database -- and they're relatively small. |
I got a custom On another front, my first-pass research into "CUnit with Visual Studio" suggests that they do not work together, or if so with great difficulty. As a result, out of the box testing of udunits on Windows may need to be by hand, or downstream in the projects which use it. I'll leave that to those more knowledgable about udunits2 than I :) |
Ward, Excellent progress! Too bad about CUnit support on Windows. Those tests are fairly --Steve |
As of commit dad48f3, the UDUNITS-2 fork at http://github.com/WardF/UDUNITS-2 compiles. I don't know if it works, but it compiles. I have to switch gears for a while so any feedback anybody else can contribute would be great, otherwise I will turn my attention back to it when I can later this week :). |
Addenum to previous comment: it may be next week before I can look back at this. If anybody wants to try building it, here are the steps I take to build on Windows, using VS2010, with libexpat installed in
Compile from shellAssuming that we're starting in the base
I have not tried compiling any of the other directories, or 'ALL' because I don't know if it will break on other directories. The output of the commands above are the shared .DLL and import .LIB in Future WorkAs mentioned above, I will try to take a look at it later this week, or more likely next week, to see if it actually works or not. Once a naive command-line test works, I will submit a merge to the main project and then withdraw back to my own little world, emerging to provide further assistance as best I can but eschewing an active role in the project due to other commitments. :) |
Executive Summary
BuildingOk, I've spent some more time with this and here's where we're at. I'm able to compile libudunits and udunits.exe using Visual Studio 2010, 32-and-64-bit versions, using CMake to generate Visual Studio configuration files. I'm also able to build
RunningI'm able to run
Once I took these steps, I was able to run the executable without any issue. These changes live at http://github.com/WardF/UDUNITS-2. I will talk with Steve about issuing a pull request into the main project, but I am going to be out of the office at the FRC HPC symposium for the next two days. If anybody finds any problems please let me know, otherwise I'll consider my involvement here done post-merge and assume that everything works :). |
Issued a pull request, #17, which can be automatically merged post-review. The changes affect a number of files but are individually very modest. |
Ward's modification for Visual Studio have been merged into the master branch. If all goes well, a new distribution should be available very soon. |
Fixed in 77a8494 |
@semmerson and @WardF I'm trying to build UDUNITS using CMAKE with Visual Studio 2008 (Visual Studio 9). From the Visual Studio 2008 Command Prompt, I typed:
and I get back
I tried installing expat for windows but that didn't help. Do I need to build it with CMAKE & same compiler?
The text was updated successfully, but these errors were encountered: