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

How to install project specific libraries for multiple platforms required for compiling? #20

Open
stohn opened this issue Apr 11, 2016 · 6 comments
Labels

Comments

@stohn
Copy link

stohn commented Apr 11, 2016

First let me say GREAT!
Exactly what I need for my project (I have to supply binaries for "normal" users for Linux/OSX/Windows).
I also plan to use this as a CI build env.

Now my question: I need some libraries in order to compile my project (e.g. libusb, ncurses).
Usually I use packet manager on the real platforms to install them (apt-get for Linux, brew for OSX and pacman for MSYS2-MinGW/Windows).

Do you have an idea / suggestion how to install (automated or manually) the different platform specific libraries?

Thanks,

Maik

@moul
Copy link
Member

moul commented Apr 11, 2016

Hi @stohn, interesting questions!


First ideas:

  • by mounting the local /usr/lib in the container using docker -v; Overriding the container's /usr/lib is a bad idea, so maybe we can mount it elsewhere and configure ldd to look at this path. I like this idea, it's very easy to automate, but it will probably only works for Linux

  • by inheriting the Docker image and apt-get install the missing libraries

    FROM multiarch/crossbuild
    RUN apt-get install toto-dev

Is your project open-source ? I would love to try to fix this issue against a real library-based project in Linux, OSX and Windows

@stohn
Copy link
Author

stohn commented Apr 11, 2016

Yes project is open source. I had to change my github account recently and now having 2 both connected to other projects. So sometimes using old one by accident.

The project is here:
http://github.com/MaikStohn/UP3D

It's just at the begin so any change can be made easily.

@moul
Copy link
Member

moul commented Apr 11, 2016

Ok perfect, can you give me instructions to get/install libraries for each architectures ? Do not worry about the Docker part, just instructions/url for one of the projects of your repo; Thanks!

@stohn
Copy link
Author

stohn commented Apr 11, 2016

The relevant parts of the project for now are:
"UP3DTRANSCODE" (no dependencies)
and
"UP3DTOOLS" (requires libusb / ncurses)

Inside of each directory is a small "make.sh" which already handles all platform specific stuff.

-> All resulting apps are console based apps.

For library installation a made a small note in the appropriate "make.sh" in the directories. Here my full notes for compilation on each platform:

Linux (debian/ubuntu):

 apt-get install gcc
 apt-get install libusb-1.0.0-dev
 apt-get install libncurses5-dev
  • compile using the appropriate "make.sh"

OSX:

  • install homebrew ( http://brew.sh )
  • use "brew" to install the required libraries:
 brew install pkg-config
 brew install libusb
 brew install homebrew/dupes/ncurses
  • compile using the appropriate "make.sh"

Windows:

  • install msys2 (which also brings mingw + pacman package manager)
  • open msys2 shell and use pacman to install
 pacman -S mingw32/mingw-w64-i686-gcc
 pacman -S mingw32/mingw-w64-i686-libusb
 pacman -S mingw32/mingw-w64-i686-ncurses
  • then close msys2 shell and open mingw32 shell to compile using the "make.sh"

EDIT: corrected / add more details to package manager instructions

@moul moul added the ready label Dec 21, 2016
@pkriens
Copy link

pkriens commented Sep 26, 2017

I guess I need exactly this functionality for, in my case, zlib. Are there instructions for this now since it is labeled ready?

@nioncode
Copy link

nioncode commented Jul 1, 2019

Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants