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

Does cmake build work for plugins on cygwin? #2980

Closed
edwardhartnett opened this issue Aug 15, 2024 · 5 comments · Fixed by #2985
Closed

Does cmake build work for plugins on cygwin? #2980

edwardhartnett opened this issue Aug 15, 2024 · 5 comments · Fixed by #2985

Comments

@edwardhartnett
Copy link
Contributor

Does the cmake build work for plugins on cygwin?

The autotools build does work on cygwin, and produces these files for plugins:

[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 75856 Aug 15 17:48 cyg__nch5bzip2.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 58685 Aug 15 17:48 cyg__nch5deflate.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 59395 Aug 15 17:48 cyg__nch5fletcher32.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 60684 Aug 15 17:50 cyg__nch5misc.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 77113 Aug 15 17:50 cyg__nch5noop.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 77113 Aug 15 17:50 cyg__nch5noop1.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 58267 Aug 15 17:48 cyg__nch5shuffle.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 61201 Aug 15 17:48 cyg__nch5szip.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 58489 Aug 15 17:50 cyg__nch5unknown.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 75478 Aug 15 17:48 cyg__nch5zstd.dll
[run_zstd_test.sh] -rwxrwxr-x+ 1 runneradmin None 74573 Aug 15 17:50 cyg__nczmisc.dll
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  3192 Aug 15 17:48 H5checksum.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None 20795 Aug 15 17:48 H5Zbzip2.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  3385 Aug 15 17:48 H5Zdeflate.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  2159 Aug 15 17:48 H5Zfletcher32.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4800 Aug 15 17:50 H5Zmisc.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None 21868 Aug 15 17:50 H5Znoop.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None 21868 Aug 15 17:50 H5Znoop1.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  3363 Aug 15 17:48 H5Zshuffle.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  5524 Aug 15 17:48 H5Zszip.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  2471 Aug 15 17:50 H5Zunknown.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   693 Aug 15 17:50 H5Zutil.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None 20463 Aug 15 17:48 H5Zzstd.o
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4322 Aug 15 17:48 lib__nch5bzip2.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    20 Aug 15 17:48 lib__nch5bzip2.la -> ../lib__nch5bzip2.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   973 Aug 15 17:48 lib__nch5bzip2.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4372 Aug 15 17:48 lib__nch5deflate.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    22 Aug 15 17:48 lib__nch5deflate.la -> ../lib__nch5deflate.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   981 Aug 15 17:48 lib__nch5deflate.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  7836 Aug 15 17:48 lib__nch5fletcher32.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    25 Aug 15 17:48 lib__nch5fletcher32.la -> ../lib__nch5fletcher32.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   993 Aug 15 17:48 lib__nch5fletcher32.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  5632 Aug 15 17:50 lib__nch5misc.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    19 Aug 15 17:50 lib__nch5misc.la -> ../lib__nch5misc.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  1016 Aug 15 17:50 lib__nch5misc.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  5032 Aug 15 17:50 lib__nch5noop.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    19 Aug 15 17:50 lib__nch5noop.la -> ../lib__nch5noop.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   988 Aug 15 17:50 lib__nch5noop.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  5058 Aug 15 17:50 lib__nch5noop1.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    20 Aug 15 17:50 lib__nch5noop1.la -> ../lib__nch5noop1.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   992 Aug 15 17:50 lib__nch5noop1.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4372 Aug 15 17:48 lib__nch5shuffle.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    22 Aug 15 17:48 lib__nch5shuffle.la -> ../lib__nch5shuffle.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   981 Aug 15 17:48 lib__nch5shuffle.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4298 Aug 15 17:48 lib__nch5szip.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    19 Aug 15 17:48 lib__nch5szip.la -> ../lib__nch5szip.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   969 Aug 15 17:48 lib__nch5szip.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4416 Aug 15 17:50 lib__nch5unknown.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    22 Aug 15 17:50 lib__nch5unknown.la -> ../lib__nch5unknown.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  1000 Aug 15 17:50 lib__nch5unknown.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  4298 Aug 15 17:48 lib__nch5zstd.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    19 Aug 15 17:48 lib__nch5zstd.la -> ../lib__nch5zstd.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   969 Aug 15 17:48 lib__nch5zstd.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None  3656 Aug 15 17:50 lib__nczmisc.dll.a
[run_zstd_test.sh] lrwxrwxrwx  1 runneradmin None    18 Aug 15 17:50 lib__nczmisc.la -> ../lib__nczmisc.la
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None   984 Aug 15 17:50 lib__nczmisc.lai
[run_zstd_test.sh] -rw-rw-r--+ 1 runneradmin None 21214 Aug 15 17:50 NCZmisc.o

And my tst_zstd works with autotools.

But my tst_zstd does not work with the cmake build on cygwin, and the following files are produced:

HDF5_PLUGIN_PATH=/cygdrive/d/a/netcdf-c/netcdf-c/build/plugins
total 953
-rw-rw-r--+ 1 runneradmin None  7067 Aug 15 17:46 cmake_install.cmake
drwxrwxr-x+ 1 runneradmin None     0 Aug 15 17:46 CMakeFiles
-rw-rw-r--+ 1 runneradmin None   297 Aug 15 17:46 CTestTestfile.cmake
-rwxr-x---+ 1 runneradmin None  3559 Aug 15 17:46 findplugin.sh
-rw-rw-r--+ 1 runneradmin None  7024 Aug 15 17:46 H5Znoop1.c
-rwxrwxr-x+ 1 runneradmin None 75856 Aug 15 17:47 lib__nch5bzip2.dll
-rwxrwxr-x+ 1 runneradmin None 58685 Aug 15 17:47 lib__nch5deflate.dll
-rwxrwxr-x+ 1 runneradmin None 59395 Aug 15 17:47 lib__nch5fletcher32.dll
-rwxrwxr-x+ 1 runneradmin None 60684 Aug 15 17:47 lib__nch5misc.dll
-rwxrwxr-x+ 1 runneradmin None 77113 Aug 15 17:47 lib__nch5noop.dll
-rwxrwxr-x+ 1 runneradmin None 77113 Aug 15 17:47 lib__nch5noop1.dll
-rwxrwxr-x+ 1 runneradmin None 582[67](https://github.com/edwardhartnett/netcdf-c/actions/runs/10408027267/job/28824548073?pr=2#step:10:68) Aug 15 17:47 lib__nch5shuffle.dll
-rwxrwxr-x+ 1 runneradmin None 61201 Aug 15 17:47 lib__nch5szip.dll
-rwxrwxr-x+ 1 runneradmin None 58489 Aug 15 17:47 lib__nch5unknown.dll
-rwxrwxr-x+ 1 runneradmin None 75478 Aug 15 17:47 lib__nch5zstd.dll
-rwxrwxr-x+ 1 runneradmin None 79621 Aug 15 17:47 lib__nczhdf5filters.dll
-rwxrwxr-x+ 1 runneradmin None 74573 Aug 15 17:47 lib__nczmisc.dll
-rwxrwxr-x+ 1 runneradmin None 737[70](https://github.com/edwardhartnett/netcdf-c/actions/runs/10408027267/job/28824548073?pr=2#step:10:71) Aug 15 17:47 lib__nczstdfilters.dll
-rw-rw-r--+ 1 runneradmin None 30255 Aug 15 17:46 Makefile
set HDF5_PLUGIN_PATH: /cygdrive/d/a/netcdf-c/netcdf-c/build/plugins

*** Testing netcdf-4 zstd compression.
*** testing netcdf-4 zstd with float...error: NetCDF: Filter error: undefined filter encountered
Sorry! Unexpected result, /cygdrive/d/a/netcdf-c/netcdf-c/nc_test4/tst_zstd.c, line: 47

On cygwin I think we should expect .a files, yet the cmake build only produces .dll files.

@DWesl
Copy link
Contributor

DWesl commented Aug 16, 2024

Cygwin plugins would use .dll files; the test problems are likely because those are lib__*.dll files rather than cyg__*.dll files. There might be corresponding .dll.a files used by the compiler during linking to ensure there's a definition for all symbols/functions a program uses, but that's not relevant for plugins. There might also be plain .a files, which are not quite a tarball of .o files with an index, which are also not relevant for plugins.

You could modify findplugin.sh again to revert the lib__cyg__ changes I made to get plugins working on Cygwin so Autotools and CMake agree about what files to create, then check where it determines what name to dlopen for the plugins to ensure that still agrees.

EDIT: Apparently Autotools does the lib*.acyg*.dll transformation on all shared libraries regardless of whether they are plugins/extension modules or regular shared libraries, while CMake only does that for regular shared libraries. I think it's straightforward to modify plugins/CMakeFiles.txt to make the change manually, but I don't remember where the plugin tests are to see if that worked.

@edwardhartnett
Copy link
Contributor Author

OK, thanks for the info, I am studying it carefully.

I wonder if you could elaborate on the changes needed to CMakeFiles.txt? They are not clear to me.

Also, I don't understand your comments about findplugin.sh, which I am not really familiar with...

@DWesl
Copy link
Contributor

DWesl commented Aug 16, 2024

This bit:

elseif(CYGWIN)
set(PLUGINEXT "dll")
set(PLUGINPRE "lib__nc")

disagrees with what Autotools does, as described in findplugin.in here:
elif test "x$TCYG" != x ; then
FP_PLUGIN_EXT="dll"
FP_PLUGIN_PRE="cyg__nc"

I'm pretty sure the Autotools way works, so changing plugins/CMakeLists.txt to match findplugin.in should be the simplest way to get everything matching and hopefully working.

I think I remember plugin tests from the Autotools build, but I can't remember where to find them so I can't speak on why CMake isn't running them.

@edwardhartnett
Copy link
Contributor Author

OK, thanks for the detail, I am trying it here: edwardhartnett#2

@edwardhartnett
Copy link
Contributor Author

Yea! It worked! Thanks @DWesl !

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 a pull request may close this issue.

2 participants