Failure to compile on Arch

Issue #2 resolved
Izaak Meckler created an issue

Using opam to install this package fails on my machine with the following output.

===== ERROR while installing libsvm.0.9.2 =====
# opam-version 1.1.1 (99e433fbf7626f17ad65a2e5c42d3ae6dfdad1e4)
# os           linux
# command      ocaml setup.ml -build
# path         ~/.opam/system/build/libsvm.0.9.2
# compiler     system (4.01.0)
# exit-code    1
# env-file     ~/.opam/system/build/libsvm.0.9.2/libsvm-48405-ffb3fd.env
# stdout-file  ~/.opam/system/build/libsvm.0.9.2/libsvm-48405-ffb3fd.out
# stderr-file  ~/.opam/system/build/libsvm.0.9.2/libsvm-48405-ffb3fd.err
### stdout ###
# ...[truncated]
# pkg_sexplib_syntax: .................................. ~/.opam/system/lib/sexplib
# 
# /usr/bin/ocamlopt.opt unix.cmxa -I /usr/lib/ocaml/ocamlbuild /usr/lib/ocaml/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/lib/ocaml/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# ocamlfind ocamlc -ccopt -g -ccopt -O2 -ccopt -fPIC -ccopt -DPIC -c lib/libsvm_stubs.c
# + ocamlfind ocamlc -ccopt -g -ccopt -O2 -ccopt -fPIC -ccopt -DPIC -c lib/libsvm_stubs.c
# lib/libsvm_stubs.c:37:24: fatal error: libsvm/svm.h: No such file or directory
#  #include <libsvm/svm.h>
#                         ^
# compilation terminated.
# Command exited with code 2.
### stderr ###
# E: Failure("Command ''/usr/bin/ocamlbuild' lib/libsvm_stubs.a lib/dllsvm_stubs.so lib/svm.cma lib/svm.cmxa lib/svm.a lib/svm.cmxs examples/xor.native examples/svm_cli.native test/svm_test.native -tag debug' terminated with error code 10")

I have libsvm 3.17-2 installed, but libsvm isn't in the pkg-config db, so perhaps this is causing the error.

Comments (6)

  1. Oliver Gu repo owner

    Hi, it seems to me that the C compiler cannot find the svm.h header file. Therefore, installing the development files should solve your problem, e.g. with APT: apt-get install libsvm-dev.

  2. Izaak Meckler reporter

    I don't think that was quite the issue as I was able to get it to compile (and work properly) by changing <libsvm/svm.h> to <svm.h>.

  3. Oliver Gu repo owner

    Great! However, the issue is that the compiler could not find the header file in the libsvm subdirectory. If you create an libsvm subdirectory in the directory of your svm.h file and copy it in this folder, then there should be no need to modify the source file.

  4. Log in to comment