Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

User-space installer for liblinear #26774

Open
UnixJunkie opened this issue Oct 22, 2024 · 7 comments
Open

User-space installer for liblinear #26774

UnixJunkie opened this issue Oct 22, 2024 · 7 comments

Comments

@UnixJunkie
Copy link
Contributor

Hello,

I am trying to create an opam package that can install liblinear in user-space.
It should install two executables in opam's bin directory (liblinear-train and liblinear-predict).

The goal is to be able to install stufffs that require liblinear (e.g. the opam linwrap package),
even if the system has no liblinear installed system-wide.
To do this, you would just depend on the opam package liblinear instead of conf-liblinear.

Here is my current trial:

opam-version: "2.0"
authors: "https://www.csie.ntu.edu.tw/~cjlin/liblinear/contributors.html"
homepage: "https://www.csie.ntu.edu.tw/~cjlin/liblinear"
maintainer: "https://www.csie.ntu.edu.tw/~cjlin/index.html"
bug-reports: "https://github.com/ocaml/opam-repository/issues"
license: "BSD-3-Clause"
build: [
  ["sh" "-c" "wget https://github.com/cjlin1/liblinear/archive/refs/tags/v247.tar.gz"]
  ["sh" "-c" "tar -C . xzvf v247.tar.gz"]
  ["sh" "-c" "mv liblinear-247/* ./"]
  [make]
  ["cp" "liblinear-train"   "%{bin}%/liblinear-train"]
  ["cp" "liblinear-predict" "%{bin}%/liblinear-predict"]
]
depexts: [
  ["conf-make"]
  ["conf-gcc"]
  ["conf-g++"]
]
available: os != "win32"
synopsis: "User-space installer for liblinear"
description: """
Attempt a user-space installation of liblinear.
If successful, liblinear-train and liblinear-predict will be installed
into opam's bin directory.
"""
dev-repo: "git://https://github.com/cjlin1/liblinear.git"
url {
  src: "https://github.com/cjlin1/liblinear/archive/refs/tags/v247.tar.gz"
  checksum: [
    "sha256=a62c46f20a01a4626260462c905721f5471da4550d38c3b68ffacf0aa64067b4"
  ]
}

It does not work of course.

Any help to make it work is greatly appreciated.

Thanks,
F.

@UnixJunkie
Copy link
Contributor Author

liblinear is a very famous kind of chainsaw for machine-learning work

@UnixJunkie
Copy link
Contributor Author

related to UnixJunkie/svmwrap#12

@mseri
Copy link
Member

mseri commented Oct 23, 2024

This is redundant: ["sh" "-c" "wget https://github.com/cjlin1/liblinear/archive/refs/tags/v247.tar.gz"]
Since the url is already that one, opam is already putting you in the root of the extracted tarballs. Without that it should work I think

@UnixJunkie
Copy link
Contributor Author

The install stage fails if the destination directory (OPAMROOT) is on top of NFS:
cp: cannot create regular file '/nfs_mount/opam_dir/5.1.1/bin/liblinear-train': Read-only file system

I also tried the install command instead of cp, to no avail.

@UnixJunkie
Copy link
Contributor Author

related to #26781

@UnixJunkie
Copy link
Contributor Author

@mseri do you manage to install this package? I hope you are not on NFS, so that would make a different environment from mine.

@UnixJunkie
Copy link
Contributor Author

a user-space installer for liblinear is included in this PR: #26781

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

No branches or pull requests

2 participants