Menu

#102 Minimum changes for gdl-0.9.6 to build on windows

Unstable (example)
closed
nobody
None
5
2018-04-20
2016-01-18
GregJung
No

The attached file, "gitdiff.patch" will take the baseline (gdl-0.9.6v2.tgz distribution) and with minimal changes
make the appropriate patches so that it builds smoothly in windows under mingw.
(This presumes the appropriate support libraries are available)

After testing the builds in the two mingw platforms I re-tested the result in my linux system (opensuse 13.2).

So when it is used on linux I use:
$ cmake -DWXWIDGETS=ON

make check result (on linux):

99% tests passed, 2 tests failed out of 173

Total Test time (real) =  78.71 sec

The following tests FAILED:
         40 - test_bug_3285659.pro (Failed)
         87 - test_file_move.pro (Failed)

Contents:

-The defaults for the difficult options that are normally set ON are set OFF:
PSLIB, NETCDF, HDF4, HDF5, WXWIDGETS PYTHON

WXWIDGETS: you have to get real lucky for this to work in mingw of any flavor.

PSLIB: since the outset I've run into trouble using the PSLIB I built. It is
still at version 0.xx afaik. SVG makes nice output so PSLIB is defaulted OFF.

NETCDF, HDF4, HDF5
These are large additions, difficult to build, and useful to a small percentage
of users.

PYTHON: requires a python implementation native to the build system;
to my knowledge mingw-org does not provide one, and msys2 pacman does
(in both 32- and 64- bit mingw-w64).
Including PYTHON in the gdl build would greatly increase time to compile.

- CMakeLists.txt:
   If plplot is detected as a static library then the 
  plplot macros are set manually (the normal procedures don't work)
  to values found in plplot-5.11 and above.

- FindPlplot.cmake
libplplot is picked up in preference to libplplotd, which would
be the old version. (Double precision is automatic in newer plplot).
If names libplplot or libplplotd are not found,
libplplot-custom.a and libplplotcxx-custom.a would be picked up.
PLPLOT_INCLUDE_DIR  is found only in the sibling include directory
 (old routine can get plplot/plplot.h from the wrong directory).

-gdlwinstream.hpp
  since cursor needs a windows callback, mingw-org will not recognize unless
you reassure it that the windows' version is late enough  (WINVER >= 0x0500),
which is not normally the case in the mingw headers.

-gdlwinstream.cpp
  ::c_plclear() appears to be an unneccesary call and it is clearing windows
in test_tv when Clear() is called.  TV works when this statement is nulled.

One additional set of source file changes is mildly gratuitous,
taken from Ole's create_shared_library.patch for the files, 
src/basic_fun.cpp and gdl.cpp;
it is a necessary first step towards decomposing gdl into
a core shareable library and a small-size gdl; None of the CMakeLists.txt changes made here, are made towards that end - only so that it builds in mingw-org and mingw-w64 without intervention. (And also in linux, which
I just tested)

Also attached is the script, 'saveCMake.sh', which will backup your CMakeLists.txt files and
your CMakeModules directory to a similar tree under saveCMake/xx/ where xx = 00, 01, ... etc.

The patch file was created by making a subdirectory of gdl-0.9.6/gdl and sequestering the original versions
to that tree; I then ran the following script from that tree:

#!/bin/sh
# 
if [ "x$1" = "x" ]; then
   top=.
else
   top=$1
fi
for f in ${top}/* ; do 
  if [[ -d $f ]] ; then
         $0 ${f}
  elif [[ -f $f ]] ; then
     git diff ${f} ../$f
  fi

then run sed (I'm forgetting how exactly the sed commands needed to be:
sed -e 's;a/./;a/;' -e 's;b/../;b/; -i diffresult.patch

2 Attachments

Discussion

  • Sylwester Arabas

    • status: open --> closed
     
  • Sylwester Arabas

    Greg, as the attached patch contains quite some unrelated changes (default values of CMake settings, static plplot handling (also for non-windows IIUC and command_line_args modifications; and most importantly as there is apparent overlap with the ogoing development and this patch, let me close this one and ask for single-change pull requests at github. Thanks!

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.