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

make package compatible with homebrew #3

Closed
mlubin opened this issue Jun 9, 2013 · 18 comments
Closed

make package compatible with homebrew #3

mlubin opened this issue Jun 9, 2013 · 18 comments

Comments

@mlubin
Copy link
Member

mlubin commented Jun 9, 2013

According to the discussion here, if GLPK uses find_library to recognize hombrew/bundled libraries, then it can be included in the Julia distribution on OS X. I have a macbook that I can use to help with testing.

@carlobaldassi
Copy link
Collaborator

Hi Miles, I rewrote the build script and added the homebrew option. It's in the branch newbuild. Can you test it?

@mlubin
Copy link
Member Author

mlubin commented Jun 10, 2013

Seems to work great after fixing a typo:

ERROR: realod not defined
 in find_glpk_library at /Users/mlubin/.julia/GLPK/deps/ext.jl:32

@carlobaldassi
Copy link
Collaborator

Great, thanks. Typo fixed. Did you have to set up brew in some way to have it look in homebrew-science, or it does it by default?
Could you also test the source option, just to be sure there are no surprises?

@mlubin
Copy link
Member Author

mlubin commented Jun 10, 2013

I had to manually set up homebrew/science, otherwise it doesn't work. Build from source still works fine.

@carlobaldassi
Copy link
Collaborator

I see, thanks. In the meanwhile, I found some new issues with the new build system (in particular with the version checking machinery) and I'm trying to see if I can find workarounds. Not sure if this build scheme can be made to work properly with the strict version requirement that my GLPK wrapper has...

@mlubin
Copy link
Member Author

mlubin commented Jun 10, 2013

What's the source of the strict version requirement?

@carlobaldassi
Copy link
Collaborator

Each GLPK version has apparently an incompatible ABI to the previous one, so that version 4.45 is ABI 30 and version 4.48 is ABI 33. From one version to the next, some functions may disappear, the definition of the C structs may change etc. I removed the C wrapper some time ago, so I must make sure that everything is binary compatible.

@mlubin
Copy link
Member Author

mlubin commented Jun 10, 2013

That's a bit inconvenient. Well I'm not sure how to put the version requirement on homebrew, but we can at least make sure that the correct version is bundled with the Julia binary.

@mlubin
Copy link
Member Author

mlubin commented Jun 10, 2013

@staticfloat @ViralBShah

@mlubin
Copy link
Member Author

mlubin commented Jun 10, 2013

Maybe we could optionally bundle formula files with the Julia packages instead of relying on the homebrew repos? This would help me with CoinMP also because I have custom patches that don't really belong in homebrew-science.

@carlobaldassi
Copy link
Collaborator

Yes it is inconvenient, but with any binary dependency there would be some version requirement, so there should be a way to deal with that at some point.

BTW the issue I'm having is this one.

@staticfloat
Copy link
Contributor

When you install via homebrew, you can pass a full URL to brew to install from. This gives you the flexibility to host your own brew files anywhere and allows you to do whatever you want outside of homebrew repositories. If you don't have any custom dependencies, this will work fine. If you have custom dependencies, it's best to make a Tap, which is just a git repository with a homebrew- prefix. You can then tap it by typing brew tap <username>/<suffix>, and as long as there are no name conflicts between the formulae in your tap and that in any other tap installed by brew, you're good to go. (If there is a conflict, then depending on whether or not the user forces linkage of those conflicting formulae into brew's "global formula namespace", you could get your custom dependency used or not)

I setup a tap to install julia, and it has multiple dependencies. To avoid conflicts, I just threw a -julia onto the end of stuff.

@mlubin
Copy link
Member Author

mlubin commented Jul 30, 2013

It might be worth another attempt to do this given the recent work on BinDeps. BinDeps will choose the library at runtime and lets you provide a function to verify if a library is the right version.

@staticfloat
Copy link
Contributor

@mlubin, what help do you need to get this done?

@mlubin
Copy link
Member Author

mlubin commented Jul 30, 2013

With my qualifying exams coming up, first of all I need free time :). I was hoping @carlobaldassi could take a look.

@carlobaldassi
Copy link
Collaborator

I'll check it out in a few days (I was planning to look into the new BinDeps features since a while, never got the time), but from what you write I'm not very optimistic: the original issue was that running the test to check the version was preventing the right version to work; i.e. if I check the version and find it's the wrong one, I need to restart Julia before the right one can be chosen. AFAIK that issue is still open.

carlobaldassi added a commit that referenced this issue Aug 19, 2013
Fix #5
A step towards addressing #3
@carlobaldassi
Copy link
Collaborator

I just revamped the build script and added the homebrew option via BinDeps' provides.
The new build.jl file is amazingly better-looking now.
On linux, everything seems to work.
Even the issue I was having with the version checking seems fixed with the new BinDeps system.
Can someone (@mlubin, @staticfloat ...) please pull form GLPK.jl master and test that homebrew works? If not, please reopen.
It would also be nice if the source build was tested by someone on OS X, but I don't really expect troubles on that front.
Also (@loladiro), is there a way to make sure homebrew/science is used from BinDeps?
If everything works fine I'll publish the new version.

Another issue is with Windows: @loladiro, could you help me out with this one? In the current build.jl script, there is a directive which specifies where the Windows binaries can be found, but then I'd need to give instructions for unpacking the zip file + moving some files around, and I can't experiment with Windows to check.

Side note: I'm not including AptGet since the version provided by Ubuntu (and I guess Debian too) is too old, but if other distributions provide the correct 4.48 version (e.g. via Yum) and someone is aware of that, please let me know (or issue pull requests).

@staticfloat
Copy link
Contributor

BTW, I'm fairly certain that you can "brew install homebrew/science/glpk",
so you can just pass that as the formula name. We could even search for
taps via the slash characters and ensure that the proper taps are tapped.
On Aug 19, 2013 7:45 AM, "Carlo Baldassi" [email protected] wrote:

I just revamped the build script and added the homebrew option via
BinDeps' provides.
The new build.jl file is amazingly better-looking now.
On linux, everything seems to work.
Even the issue I was having with the version checking seems fixed with the
new BinDeps system.
Can someone (@mlubin https://github.com/mlubin, @staticfloathttps://github.com/staticfloat...) please pull form GLPK.jl master and test that homebrew works? If not,
please reopen.
It would also be nice if the source build was tested by someone on OS X,
but I don't really expect troubles on that front.
Also (@loladiro https://github.com/loladiro), is there a way to make
sure homebrew/science is used from BinDeps?
If everything works fine I'll publish the new version.

Another issue is with Windows: @loladiro https://github.com/loladiro,
could you help me out with this one? In the current build.jl script,
there is a directive which specifies where the Windows binaries can be
found, but then I'd need to give instructions for unpacking the zip file +
moving some files around, and I can't experiment with Windows to check.

Side note: I'm not including AptGet since the version provided by Ubuntu
(and I guess Debian too) is too old, but if other distributions provide the
correct 4.48 version (e.g. via Yum) and someone is aware of that, please
let me know (or issue pull requests).


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-22877023
.

carlobaldassi added a commit that referenced this issue Aug 20, 2013
Fix #5
A step towards addressing #3
carlobaldassi added a commit that referenced this issue Aug 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants