gdl icon indicating copy to clipboard operation
gdl copied to clipboard

HDF4/windows is in conflict with bsd-xdr/windows (via include/rpc/xdr.h)

Open maynardGK opened this issue 4 years ago • 9 comments

When running a test of build_gdl.sh it caught a feature of my mingw64 installation, whereby HDF4 is not installed because it over-writes the rpc/ files wanted by bsd-xdr (I have been building GDL with -DHDF=OFF)

$ ls
AUTHORS               config.h.cmake  INSTALL.plplot  quick_start_GDL.sh*  scripts/
bsd-xdr-1.0.0/        COPYING         MAP_INSTALL     README               src/
bsd-xdr-1.0.0.tar.gz  doc/            NEWS            README.GRIB          testsuite/
CMakeLists.txt        HACKING         obsolete/       README.md
CMakeModules/         INSTALL.CMake   PYTHON.txt      resource/

greg@i7Wx MSYS /d/archive/testgdl/gdl
$ ls bsd-xdr-1.0.0
doc/  LICENSE    Makefile         Makefile.unix  NEWS    rpc/  stamp-mingw
lib/  licenses/  Makefile.msvc80  mingw/         README  src/

greg@i7Wx MSYS /d/archive/testgdl/gdl
$ ls bsd-xdr-1.0.0/rpc
types.h  xdr.h

greg@i7Wx MSYS /d/archive/testgdl/gdl

maynardGK avatar Jul 01 '21 22:07 maynardGK

MinGW64 HDF4 doesn't seem to overwrite rpc/xdr.h: https://packages.msys2.org/package/mingw-w64-x86_64-hdf4

pjb7687 avatar Jul 01 '21 23:07 pjb7687

Right, it appears to be libxdr.a and libxdr.dll.a where the conflict is. hdf4 uses types.h, xdr.h from /include (no rpc)

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                             [###############################] 100%
(1/1) checking package integrity                           [###############################] 100%
(1/1) loading package files                                [###############################] 100%
(1/1) checking for file conflicts                          [###############################] 100%
error: failed to commit transaction (conflicting files)
mingw-w64-x86_64-hdf4: /mingw64/lib/libxdr.a exists in filesystem
mingw-w64-x86_64-hdf4: /mingw64/lib/libxdr.dll.a exists in filesystem
Errors occurred, no packages were upgraded.

maynardGK avatar Jul 01 '21 23:07 maynardGK

I think we can change the target lib name of bsd-xdr, e.g. libbsdxdr.dll

pjb7687 avatar Jul 01 '21 23:07 pjb7687

Ok I think that will work with a change in CMakeModules/FindXdr.cmake:

find_library(XDR_LIBRARY NAMES bsdxdr xdr)

That works to build. My system isn't picking up the /bin directory libraries as it did for the old artifacts.

alias gdltst='bash -c "export PATH=.:$PATH && /c/usr/gdltst/install/bin/gdl"'
alias gdl32='bash -c "export PATH=.:$PATH && /c/usr/gdl32/install/gdl/bin/gdl"'
alias gdl64='bash -c "export PATH=.:$PATH && /c/usr/gdl64/install/gdl/bin/gdl"'

$ gdltst
C:/usr/gdltst/install/bin/gdl.exe: error while loading shared libraries: zlib1.dll: cannot open shared object file: No such file or directory
(gdl64 and gdl32 are working)
When it is run from the screen, it says code not executed because libgd.dll was not found.    

I don;t know if it is system upgrade (win10 w/ mingw) or what, the old links are not working.

<CmakeList.txt modified to accomodate pacman-installed plplot, FindXDR.cmake >
greg@i7Wx MINGW64 /d/bld/gdl/mingw64-git
$ tail make.out
[ 96%] Building CXX object src/CMakeFiles/gdl.dir/where.cpp.obj
[ 97%] Building CXX object src/CMakeFiles/gdl.dir/widget.cpp.obj
[ 97%] Building CXX object src/CMakeFiles/gdl.dir/Shapefiles.cpp.obj
[ 98%] Building CXX object src/CMakeFiles/gdl.dir/sax.cpp.obj
[ 98%] Building RC object src/CMakeFiles/gdl.dir/C_/msys64/mingw64/include/wx-3.0/wx/msw/wx.rc.obj
[100%] Building CXX object src/CMakeFiles/gdl.dir/gdl.cpp.obj
[100%] Linking CXX executable gdl.exe
[100%] Built target gdl
Scanning dependencies of target copy_gdl
[100%] Built target copy_gdl

greg@i7Wx MINGW64 /d/bld/gdl/mingw64-git
$ src/gdl
D:/bld/gdl/mingw64-git/src/gdl.exe: error while loading shared libraries: zlib1.dll: cannot open shared object file: No such file or directory

maynardGK avatar Jul 02 '21 00:07 maynardGK

I wonder if we could not just add the very basix xdr code needed in GDL. This is only about coding/encoding in wrting/reading files, noticeably save files. Not fancy RPC procedures.

GillesDuvert avatar Jul 02 '21 08:07 GillesDuvert

I wonder if we could not just add the very basix xdr code needed in GDL. This is only about coding/encoding in wrting/reading files, noticeably save files. Not fancy RPC procedures.

It seems GDL references at least more than 10 xdr routines, I think it would not be super easy to reimplement this.

pjb7687 avatar Jul 02 '21 13:07 pjb7687

Opened a PR: https://github.com/gnudatalanguage/gdl/pull/988 I will merge it after running some test

pjb7687 avatar Jul 02 '21 13:07 pjb7687

I don;t know if it is system upgrade (win10 w/ mingw) or what, the old links are not working.

You might need to add your python path to the PATH variable.

pjb7687 avatar Jul 02 '21 13:07 pjb7687

You might need to add your python path to the PATH variable.

In that last example I built GDL from my usual cmake command, without any python.
Excluding python (editing the script to set PYTHON=OFF) was required for win10 on another computer, using a fresh msys2 installation. Regarding the title topic, this GDL was cloned and built after today's PR creating libbsdxdr, so that seems to be ok. I installed (mingw64) python, numpy but the build didn't catch it). On this computer I was able to successfully run GDL:


97% tests passed, 6 tests failed out of 190

Total Test time (real) =  50.18 sec

The following tests did not run:
        127 - test_mpi.pro (Skipped)
        146 - test_python.pro (Skipped)

The following tests FAILED:
          9 - test_bug_2555865.pro (Failed)
         12 - test_bug_2876150.pro (Failed)
         30 - test_bug_3147146.pro (Failed)
         31 - test_bug_3147181.pro (Failed)
         51 - test_bug_3572473.pro (Failed)
        175 - test_tic_toc.pro (Failed)
Errors while running CTest

also, to run it from a CMD console works fine:

C:\Users\Greg>C:\msys64\usr\bin\bash -c "export PATH=.:$PATH && ~/test/install/bin/gdl"
  GDL - GNU Data Language, Version 1.0.0-rc.3 git
- For basic information type HELP,/INFO
- Default library routine search path used (GDL_PATH/IDL_PATH env. var. not set): C:/msys64/home/Greg/test/install/share/gnudatalanguage/lib
- Using WxWidgets as graphics library (windows and widgets).
- No startup file read (GDL_STARTUP/IDL_STARTUP env. var. not set).
- Please report bugs, feature or help requests and patches at: https://github.com/gnudatalanguage/gdl

GDL>

maynardGK avatar Jul 03 '21 00:07 maynardGK