Skip to content

[cmake] download instead of bundle gl2ps and bump from 1.3.1 to 1.4.2, and use CMake target#21895

Open
ferdymercury wants to merge 10 commits intoroot-project:masterfrom
ferdymercury:bgl2ps
Open

[cmake] download instead of bundle gl2ps and bump from 1.3.1 to 1.4.2, and use CMake target#21895
ferdymercury wants to merge 10 commits intoroot-project:masterfrom
ferdymercury:bgl2ps

Conversation

@ferdymercury
Copy link
Copy Markdown
Collaborator

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 12, 2026

Test Results

    22 files      22 suites   3d 3h 7m 15s ⏱️
 3 833 tests  3 832 ✅  1 💤 0 ❌
75 650 runs  75 632 ✅ 18 💤 0 ❌

Results for commit 4b62fa6.

♻️ This comment has been updated with latest results.

…, and use CMake target

[cmake] simplify dependency check

matches 6.40 release notes

[cmake] use canonical names

[cmake] fix case

[cmake] fix case and simplify check

[graf3d] add dependency on builtin

[cmake] simplify check

[cmake] fix freetype builtins

[cmake] fix deprecation error

[gl2ps] do not depend on PNG or ZLIB

since only EPS backend is used by ROOT graf3d plotter
@ferdymercury ferdymercury marked this pull request as ready for review April 12, 2026 20:24
@bellenot
Copy link
Copy Markdown
Member

gl2ps creates a gl2ps.dll on Windows, which is not found when running the tests. Looking at this code:

  add_library(lib STATIC gl2ps.c gl2ps.h)
  set_target_properties(lib PROPERTIES OUTPUT_NAME gl2ps)

  add_library(shared SHARED gl2ps.c gl2ps.h)
  target_link_libraries(shared ${EXTERNAL_LIBRARIES})
  set_target_properties(shared PROPERTIES OUTPUT_NAME gl2ps
    VERSION ${GL2PS_MAJOR_VERSION}.${GL2PS_MINOR_VERSION}.${GL2PS_PATCH_VERSION}
    SOVERSION ${GL2PS_MAJOR_VERSION})
  if(WIN32 OR CYGWIN)
    set_target_properties(shared PROPERTIES
        COMPILE_FLAGS "-DGL2PSDLL -DGL2PSDLL_EXPORTS")
  endif()
  install(TARGETS lib shared RUNTIME DESTINATION bin
                             LIBRARY DESTINATION lib${LIB_SUFFIX}
                             ARCHIVE DESTINATION lib${LIB_SUFFIX})

That simply cannot work. It creates a DLL and a static library with the same name, so at the end only the DLL is valid...

@ferdymercury
Copy link
Copy Markdown
Collaborator Author

@bellenot it seems we need your magic here ;)

Everything compiles perfectly fine on Windows but we are getting a runtime error with interpreted scripts.

cling::DynamicLibraryManager::loadLibrary(): LoadLibrary: returned 126: The specified module could not be found.
Error in <TInterpreter::TCling::AutoLoad>: failure loading library libRGL.dll (returns -1)

So it seems that something seems incorrect with Windows RPaths ?

@bellenot
Copy link
Copy Markdown
Member

bellenot commented Apr 13, 2026

So we have two options here. We either patch the CMakeLists.txt to produce a static library (e.g. gl2ps_static.lib) or we need to install the gl2ps.dll into the ROOT' bin directory. I would prefer to use a static library.
I just tried the static/patch and it works.

@ferdymercury
Copy link
Copy Markdown
Collaborator Author

So we have two options here. We either patch the CMakeLists.txt to produce a static library (e.g. gl2ps_static.lib) or we need to install the gl2ps.dll into the ROOT' bin directory. I would prefer to use a static library. I just tried the static/patch and it works.

Thanks!
I see. In Linux it creates simultaneously a .so and .a that do not conflict each other.
The patch for static would be great, yeah!

@ferdymercury
Copy link
Copy Markdown
Collaborator Author

Could you try directly with this patch as backport? https://gitlab.onelab.info/gl2ps/gl2ps/-/commit/eb23884c2c43f54f6dc2df9d5243c520a5ec7393
Then we do not need anything self-made

@bellenot
Copy link
Copy Markdown
Member

So here are my builtins/gl2ps/CMakeLists.txt and builtins/gl2ps/gl2ps_add_static_suffix.patch files
CMakeLists.txt
gl2ps_add_static_suffix.patch

git checkout 092901a4f53b003f66d5a7a3b100c3a933005130
git format-patch HEAD~7..HEAD --stdout > changes.patch
@bellenot
Copy link
Copy Markdown
Member

Could you try directly with this patch as backport? https://gitlab.onelab.info/gl2ps/gl2ps/-/commit/eb23884c2c43f54f6dc2df9d5243c520a5ec7393 Then we do not need anything self-made

The commit doesn't look good to me, but I'll try it nevertheless

@ferdymercury
Copy link
Copy Markdown
Collaborator Author

The commit doesn't look good to me, but I'll try it nevertheless

(I've joined several commits on that dev branch and added -DBUILD_SHARED_LIBS=OFF), it's in the CI now

@bellenot
Copy link
Copy Markdown
Member

The commit doesn't look good to me, but I'll try it nevertheless

(I've joined several commits on that dev branch and added -DBUILD_SHARED_LIBS=OFF), it's in the CI now

Yes, I've seen that. Will try right after ftgl that I'm trying now...

Co-authored-by: ferdymercury <ferdymercury@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants