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

Use dynamic dependencies on UNIX #697

Merged
merged 10 commits into from
May 29, 2018
Merged

Use dynamic dependencies on UNIX #697

merged 10 commits into from
May 29, 2018

Conversation

Mizux
Copy link
Collaborator

@Mizux Mizux commented May 23, 2018

Use dynamic dependencies on unix instead of static libs.

Fix #684: Split CBC in five
Fix #379: don't use coin-or.org to download packages
EDIT: Create PR to get CI feedback...

@Mizux Mizux added Feature Request Missing Feature/Wrapper Lang: Java Java wrapper issue Lang: .NET .Net wrapper issue Lang: Python Python wrapper issue Lang: C++ Native implementation issue labels May 23, 2018
@Mizux Mizux added this to the v6.8 milestone May 23, 2018
@Mizux Mizux self-assigned this May 23, 2018
PYTHON_SETUP_DEPS=
ifeq ($(UNIX_GFLAGS_DIR),$(OR_TOOLS_TOP)/dependencies/install)
ifeq ($(PLATFORM),MACOSX)
PYTHON_SETUP_DEPS += , 'libgflags.2.2.$L'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be $(PYTHON_SWIG_SUFFIX) on MacOS i.e. python look for .so even on Mac -_-

Copy link
Collaborator Author

@Mizux Mizux May 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's ok this is dynamic dependencies not pywrappers so on MacOS they are still suffixed by .dylib

Mizux added 10 commits May 28, 2018 08:08
- useful when grepping these defs
cd is available on all platform -> no need for a CD def
$S is for Makefile shell cmd not target or prerequisite syntax.
i.e. always use / in path.
Unix:
- Rename install_directories rule
  this target creates dependencies/install dir not ortools install dir
- replace $(LIB_SUFFIX) by $L to be consistent with $E and $O suffix
- fix rpath, no need anymore patchelf
  -> remove prerequisite $(PATCHELF) in install_cc
- use build_cmake as build directory
  note: MacOS is case insensitive when creating directory
  and bazel file is named BUILD -> `mkdir build` won't work
- Fix CMD_LNK on mac
- Fix MacOS LINK_FLAGS
- MacOS also use LIB_DIR = lib

Win:
- Fix windows lib suffix $L

Protobuf:
- Need to use PROTOC (like MONO) to add LD_LIBRARY_PATH hack
  -> PROTOC = LD_LIBARY_PATH="..." protoc
  -> replace $(PROTOBUF_DIR)/bin/protoc by $(PROTOC)
- Remove uneeded PROTOBUF_DIR defs
- Apply patch to protobuf to use @rpath on MacOS
- Add rpath to protobuf install rules

Coin-OR
- Use coin-or github repos mirror instead of the svn repo (Fix #379)
- Use the splited Cbc (CoinUtils, Osi, Clp, Cgl, Cbc)
note: usually distro use this layout cf https://repology.org/metapackage/coin-or-cbc/badges
- Fix rpath for all coin-or libraries at post-install using patchelf (linux) or otools (osx)
libortools:
- Rename LD_FLAGS to LDFLAGS
- Update LDFLAGS
- Add install_name to LDFLAGS on MacOS
- use OR_TOOLS_LIBS as target name

libraries:
- Rename OR_TOOLS_LD_FLAGS to OR_TOOLS_LDFLAGS
- Add OR_TOOLS_LNK and OR_TOOLS_LDFLAGS
- add install_name on MacOS

Misc:
- Rework LINK_FLAGS
- Replace ortools$Sgen by $(GEN_DIR)
- Fix install_cc rules
- Update detect_cc target
- Fix DYNAMIC_LD on MacOS
- Fixup @rpath in python wrapper
- Rework clean_python target
- Cleaning rpy target
- Echo test_python rules
- Add all *vrp* samples to test_python
- Rework pypi_archive target
  - Copy shared library to python tempDir
  - Update setup.py
- Echo install_python rules (i.e. remove of @)
- Add uninstall_python target
- Update detect_python target
@Mizux Mizux merged commit 2beffa1 into master May 29, 2018
@Mizux
Copy link
Collaborator Author

Mizux commented May 29, 2018

I do my best to rewrite all rpath and carefully ship all dependencies in the bundle so python user should be not impacted i.e. will still ship a working standalone python package (ed: it also requires six and protobuf python package since v6.6 if I remember well).

Please note that now we use Coin-OR Cbc from github mirror(s) which is splitted in five repos (CoinUtils, Osi, Clp, Cgl, Cbc). We also do this since most distro ship coin-or-cbc etc... like this (and coin-or.org is regularly down...)

The ultimate goal is to prepare or-tools to be able to build and package it without its dependencies so we could integrate libortools to any linux/brew distro as a regular package which depends on other libraries...
note: Experimental homebrew package here https://github.com/Mizux/homebrew-or-tools (only --HEAD is working) I'll try to push it to homebrew-core once we release the v6.8

Feedback or question are welcome !

@Mizux Mizux deleted the mizux/shared branch June 4, 2018 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Missing Feature/Wrapper Lang: C++ Native implementation issue Lang: Java Java wrapper issue Lang: .NET .Net wrapper issue Lang: Python Python wrapper issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants