Skip to content
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

[WIP] Windows support for Radx #11

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

jbuonagurio
Copy link

@jbuonagurio jbuonagurio commented Jul 10, 2017

This adds support for building a native Radx library for Windows using MSVC 14.0 (Visual Studio 2015) and CMake. I am currently able to build Ncxx and Radx as static libraries and use basic functions as in RadxTest.cc.

Other than the build system, few changes needed to be made, summarized below:

  • Replaced <arpa/inet.h> with <winsock2.h>, which is just used for network-to-host byte order conversions and vice-versa, e.g. ntohs().
  • Replaced <sys/types.h> with and change typedefs to use C++ standard integer types.
  • Replaced code using POSIX gettimeofday() function for wall clock time with new C++11 code based on std::chrono, in RadxTime::set and RadxTime::getCurrentTimeAsDouble. Other approaches are possible here.
  • Added some compatibility headers implementing strcasestr(), based on strcasestr.c in FreeBSD, and dirent.h from tronkko/dirent. I wasn't sure where to fit these in the project structure, so I just put them under codebase/compat.

I am using the following versions of external dependencies, all built as static libraries in release mode with CMake:

  • bzip2 1.0.6
  • HDF5 1.8.19
  • netCDF-C 4.4.1.1
  • netCDF-4 C++ 4.3.0
  • UDUNITS 2.2.25
  • Expat 2.2.1

Also required is an implementation of pthreads for Win32. I am using pthreads-win32 from sourceware.org.

Remaining items:

  • Add CMakeLists.txt files for subdirectories in Radx/src/ and Ncxx/src/, to match current style of having Makefile in individual source directories.
  • Remove dependency on pthreads. Since Radx mainly just uses mutexes from pthreads, I should be able to make those call Win32 API equivalents, e.g. pthread_mutex_lock becomes EnterCriticalSection.
  • Add support for NOAA HRD files. Not currently building on Windows.
  • Start work on porting some of the Radx applications e.g. RadxConvert. This will likely be a bit more difficult.

This work is still at an early stage, but review and comments on this pull request are much appreciated.

Thank you for your work on this nice library and making it available to the weather community.

John

@leavesntwigs
Copy link
Collaborator

Thank you for all the work in porting the code to a Windows platform!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants