-
Notifications
You must be signed in to change notification settings - Fork 36
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 UDUNITS2 with CMAKE: missing EXPAT_INCLUDE_DIR #18
Comments
Okay, I was able to fix this by setting
|
@rsignell-usgs I'm glad you got it going. It took some doing to make NetCDF-cmake work transparently in this sort of situation. I'm sure I'll find some time to make the udunits2-cmake a little more robust :). Glad to see this is proving useful! |
Look just how useful! Gohlke built Iris for windows last night, using your udunits2-2.2.16!!!! |
@rsignell-usgs Yea. I'm glad this appears to be somewhat useful. |
For the record, I had to define |
Hello, I need a Windows binary for the UDUNITS or UDUNITS2 asap. As you can see from the following link, I am still stuck: https://stackoverflow.com/questions/29657170/migration-of-perl-code-to-windows-missing-udunits-package Thanks in advance. |
You can download a pre-built one with miniconda if you have it installed. |
No, I don't have conda recipe and nor do I want to install anything anymore. Can someone please put the ununits or udunits2 binary somewhere for me to grab? I have exhausted hours on this already and the real work is yet to even begin. Thanks! |
Hi @meengla, "For Windows" is a bit nebulous. I'm unfamiliar with ActivePerl, but in general programs for 'Windows' are typically linked against one of three C runtime libraries; either the gcc libc runtime (cygwin), the mingw runtime (mingw port/fork of gcc) or the Visual Studio C++ runtime. There are also others, but these are the three that seem to be most commonly used. Which would be appropriate for ActivePerl? I cannot provide a pre-built binary; I'm out of the office and away from my Windows development machine until next week. I can try to provide guidance re: using cmake to build it, however. The complicating factor will be libexpat; you will need to find/build a copy of libexpat built with the same compiler as appropriate for ActivePerl. I recall having to do this to get UDUNITS2 compiling with MSVC, but I would have to go back and dig through my notes. |
Hi @WardF , |
@WardF - for the record, we are building expat in the same repo as previous link (https://github.com/SciTools/conda-recipes-scitools/blob/master/expat/bld.bat) |
Hello @mengla; following the link you provide from stackoverflow I cannot find for sure what environment is needed, but it appears that perhaps it is mingw? Have you tried contacting the "Fossies" project for support? Without knowing anything about ActivePerl and not knowing what the state of libexpat under mingw is, it's unclear if I could build anything that would be of use to you and, if so, when I'd have a chance to sit down and figure it out. So, you may want to proceed trying to compile udunits2 manually; what errors are you receiving from cmake? My guess would be that they are related to libexpat, unless you already have a mingw compatible copy? |
Update; I see now that I misread the following:
This information is out of date, as I know for sure that 32 and 64-bit Visual Studio builds are also supported. This does set us back, however, as my guess that MinGW is the appropriate environment is now unsubstantiated. Before proceeding we would need to know what the appropriate environment was. |
Hi @WardF , |
Okay, I use command line way now: cmake CC="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe" CXX="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe" -DEXPAT_LIBRARY=c:\expat32\Bin\libexpat.dll .. |
Not a problem; using the Microsoft compiler actually makes this easier for me, since I am more familiar with cmake+MSVC on Windows than I am mingw. You will want to make the following changes:
Finally, once cmake finishes configuring, you will build from the command line using:
You may need to specify that you want a 'release' build. Muscle memory is failing me but you would do the following I believe:
After this you should be able to search for udunits2.dll and udunits2.lib. Note that the later is the import library you would link against, not the dll directly in any project which links against us units when compiling. Please note I'm currently on my phone so I can't double check file names or option names, but everything should be correct or nearly so. |
Okay, I will try your latest too. Right now, I am trying to implement your solution from August 6, 2014. |
Here is my latest command--it still can't find the Expat library: cmake DEXPAT_INCLUDE_DIR=c:\expat32\source\lib -DEXPAT_LIBRARY=c:\expat32\Bin\libexpat.lib CC="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe" CXX="C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe" --build . --config Release --target libudunits2 --build . --config Release --target udunits2 .. |
And here is even latest command--note, I have now referencing osGeo' as well as expat32 folders; no compile error but still no DLL; I must be close?! |
Here is the screen cap of the last output: https://img42.com/NcjPV |
Probably even closer; after the above commands, I also ran: cmake --build . --config Release and now I see one fatal error: expat.h not found in a vsxproj ; so I must have not included the Expath Library correctly? |
Aha ha! Even closer: cmake .. -DCMAKE_PREFIX_PATH=c:\expat32 -G "Visual Studio 11" -DEXPAT_INCLUDE_DIR=C:\expat32\Source\lib -DEXPAT_LIBRARY=c:\expat32\Bin\libexpat.lib and then: Plenty of Warnings but no error... |
Hello, sorry for the delayed response I've just seen all of your messages at once. Still on my phone :). Warnings are acceptable! As I recall there were plenty of them for me as well. Unfortunately, the test programs depend on ctest, which is not available on windows. This was an issue with the initial porting as well, and my announcement more or less was that I will assume it works until I am told that it does not. Congratulations on your perseverance! Hopefully this should be what you need to proceed with your initial project! |
Update: upon reflection is is not ctest upon which the tests depend, but some other framework which is unavailable on windows but whose name escapes me. |
CUnit Regards, On Thu, Apr 16, 2015 at 12:52 PM, Ward Fisher [email protected]
|
Thank you all again, especially @WardF ; my Release folder has 3 files: udunits2.dll, udunits2.lib, and udunits2.exp ; I presume I could simply copy them into C:\Perl64\lib\auto folder and call like simply call, something like: https://community.activestate.com/node/10060 ? I know, it is probably not in the scope of this page but thought to do a quick check. The legacy code is calling like: use UDUNITS; and then initializing: UDUNITS::init('/usr/local/udunits/etc/udunits.dat'); |
Well, I don't know how to use the fruit of my hard work (the .DLL) in a Perl script! I posted at Stackoverflow but not getting anywhere so far: https://stackoverflow.com/questions/29685765/using-a-custom-made-dll-inside-active-perl-scripts |
Never mind--my own ignorance! Compiling to a DLL was probably not the way; I need to look into making a PERL module from the UDUNITS2... |
Hello, I have a problem in the instalation ncview-1.2.7 Could not find the expat library despite the fact that the udunits2 library is installed. This probably means some sort of configuration file error. Please consult with the package maintainer. |
@lucianainpa Is the Expat development package installed? If not, can you install it? |
Hi @semmerson |
1 similar comment
Hi @semmerson |
Hello everyone, Makefile:1070: recipe for target 'check-TESTS' failed |
@lucianainpa You should do what the error message said and send the output to [email protected]. |
@WardF , I tried building UDUNITS2 with CMAKE following your directions:
but got back:
The text was updated successfully, but these errors were encountered: