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

ZLIB cannot be found on Mac OS X 14 #876

Closed
Timchenkovich opened this issue Mar 10, 2025 · 2 comments · May be fixed by #877
Closed

ZLIB cannot be found on Mac OS X 14 #876

Timchenkovich opened this issue Mar 10, 2025 · 2 comments · May be fixed by #877

Comments

@Timchenkovich
Copy link

Timchenkovich commented Mar 10, 2025

XCode command line tools comes with bundled zlib, which has .tld extension. this cmake file sets static lib usage for zlib, which would make static library preferred, although FindZLIB.cmake from cmake installation uses this variable to set up static linking exclusively. This results in zlib being not found, as it only searches for .a files.

# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
  if(ZLIB_USE_STATIC_LIBS)
    if(WIN32)
      set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
    else()
      set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
    endif()
  endif()

Similar example for protobuf.

# Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
if( Protobuf_USE_STATIC_LIBS )
  set( _protobuf_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
  if(WIN32)
    set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
  else()
    set(CMAKE_FIND_LIBRARY_SUFFIXES .a )
  endif()
endif()

build-log-debug-find.txt
build-log-trace.txt

Is setting static only linking of above libraries a requirement? Definition of USERVER_USE_STATIC_LIBS suggests that those settings are unwanted.

@fdr400
Copy link
Member

fdr400 commented Mar 11, 2025

Hello @Timchenkovich! Please, try to use recommended cmake options and download recommended packages to build userver on MacOS: https://userver.tech/de/db9/md_en_2userver_2build_2dependencies.html#autotoc_md187

As you can see, we expected zlib is downloaded with homebrew (not the system zlib).
Also, protobuf must be build from source on Mac, because homebrew has too fresh version, which is incompatible with our grpc driver implementation

@Timchenkovich
Copy link
Author

thank you, missed it somehow

@fdr400 fdr400 closed this as completed Mar 12, 2025
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