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

[CMAKE] When using system Protobuf, protobuf::protoc is not defined. #2109

Closed
yurivict opened this issue Jul 20, 2020 · 4 comments
Closed

[CMAKE] When using system Protobuf, protobuf::protoc is not defined. #2109

yurivict opened this issue Jul 20, 2020 · 4 comments
Assignees
Labels
Build: CMake CMake based build issue Feature Request Missing Feature/Wrapper
Projects
Milestone

Comments

@yurivict
Copy link

protobuf::protoc gets into makefiles:

ortools/sat/boolean_problem.pb.cc: protobuf::protoc

Version: 7.7
OS: FreeBSD 11.2

@Mizux Mizux added Bug Build: Makefile Makefile based build issue labels Jul 21, 2020
@Mizux Mizux self-assigned this Jul 21, 2020
@Mizux
Copy link
Collaborator

Mizux commented Jul 21, 2020

Hi,
From where does google or-tools come from ? which branch if git clone ?
Which build system did you use ?
Which command did you run ?
Do you have a log to share ?

@Mizux Mizux added this to To do in ToDo via automation Jul 21, 2020
@Mizux Mizux added this to the v7.8 milestone Jul 21, 2020
@yurivict
Copy link
Author

yurivict commented Jul 21, 2020

I use the FreeBSD ports framework. cmake/ninja combination fails (cmake/gmake combination also fails).

For configuration cmake is run like this:

UNIX_CBC_DIR=/usr/local UNIX_CLP_DIR=/usr/local PKG_CONFIG=pkgconf XDG_DATA_HOME=/usr/ports/math/or-tools/work  XDG_CONFIG_HOME=/usr/ports/math/or-tools/work  HOME=/usr/ports/math/or-tools/work PATH=/usr/ports/math/or-tools/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin SHELL=/bin/sh CONFIG_SHELL=/bin/sh \
cmake \
-DCMAKE_C_COMPILER:STRING="cc"  -DCMAKE_CXX_COMPILER:STRING="c++"  -DCMAKE_C_FLAGS:STRING="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  -DCMAKE_C_FLAGS_DEBUG:STRING="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  -DCMAKE_CXX_FLAGS:STRING="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  -DCMAKE_CXX_FLAGS_DEBUG:STRING="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  -DCMAKE_EXE_LINKER_FLAGS:STRING=" -L/usr/local/lib -fstack-protector-strong "  -DCMAKE_MODULE_LINKER_FLAGS:STRING=" -L/usr/local/lib -fstack-protector-strong "  -DCMAKE_SHARED_LINKER_FLAGS:STRING=" -L/usr/local/lib -fstack-protector-strong "  -DCMAKE_INSTALL_PREFIX:PATH="/usr/local"  -DCMAKE_BUILD_TYPE:STRING="Release"  -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES  -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES  -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_DEPS:BOOL=OFF -DINSTALL_BUILD_DEPS:BOOL=OFF -DBUILD_PYTHON:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -GNinja

Failure log: https://people.freebsd.org/~yuri/or-tools-protobuf%3A%3Aprotoc-failure.log

I had to apply this patch:

@${REINPLACE_CMD} -e 's|protobuf::protoc|protoc -I${LOCALBASE}/include| ; s|protobuf$$:$$:protoc||' ${BUILD_WRKSRC}/build.ninja

to work around this issue, because cmake doesn't expand protobuf::protoc.

@Mizux
Copy link
Collaborator

Mizux commented Jul 22, 2020

ok so you are using the freebsd protobuf package.

You should try to fix https://github.com/google/or-tools/blob/stable/cmake/FindProtobuf.cmake instead which is currently more in its infancy (i.e. it's a skeleton) as you can see.
In the near future I hope to support system dependencies and ease the integration to any distro but it's currently out of the officially supported current scope.

note: concerning freeBSD hope to have soon a vagrant freebsd12 box to test the CMake build (ed using -DBUILD_DEPS=ON)
as first step. (see #2105 )

@Mizux Mizux added Build: CMake CMake based build issue Feature Request Missing Feature/Wrapper and removed Bug Build: Makefile Makefile based build issue labels Jul 22, 2020
@Mizux Mizux changed the title don't know how to make protobuf::protoc. Stop [CMAKE] When using system Protobuf, protobuf::protoc is not defined. Jul 22, 2020
@Mizux Mizux modified the milestones: v7.8, v7.9 Jul 22, 2020
@Mizux
Copy link
Collaborator

Mizux commented Jul 22, 2020

seems fixed on master by:
92fd9c5

@Mizux Mizux closed this as completed Jul 22, 2020
ToDo automation moved this from To do to Done Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: CMake CMake based build issue Feature Request Missing Feature/Wrapper
Projects
ToDo
  
Done
Development

No branches or pull requests

2 participants