PhyloCSF icon indicating copy to clipboard operation
PhyloCSF copied to clipboard

Unbound module Gsl

Open pingguoilove opened this issue 11 years ago • 21 comments

Dear Mike Lin: I follow the "Obtaining the PhyloCSF software" step on the wiki page,but when I execute make command under PhyloCSF folder,Errors occur:

zhangjun@ubuntu:/usr/local/src/PhyloCSF$ make make -C lib/CamlPaml reinstall make[1]: Entering directory /usr/local/src/PhyloCSF/lib/CamlPaml' make uninstall make[2]: Entering directory/usr/local/src/PhyloCSF/lib/CamlPaml' ocamlfind remove CamlPaml ocamlfind: [WARNING] No such directory: /home/zhangjun/.opam/system/lib/CamlPaml make[2]: Leaving directory /usr/local/src/PhyloCSF/lib/CamlPaml' make install make[2]: Entering directory/usr/local/src/PhyloCSF/lib/CamlPaml' ocamlbuild CamlPaml.cma CamlPaml.cmxa Finished, 1 target (0 cached) in 00:00:00.

  • ocamlfind ocamlc -c -g -pp ocaml+twt -o P.cmo P.ml File "P.ml", line 3, characters 14-31: Error: Unbound module Gsl Command exited with code 2. Compilation unsuccessful after building 46 targets (0 cached) in 00:00:04. make[2]: *** [lib] Error 10 make[2]: Leaving directory /usr/local/src/PhyloCSF/lib/CamlPaml' make[1]: *** [reinstall] Error 2 make[1]: Leaving directory/usr/local/src/PhyloCSF/lib/CamlPaml' make: *** [CamlPaml] Error 2

Could you help me solve this problem?

pingguoilove avatar Jun 18 '13 08:06 pingguoilove

Hi, Can you check the status of the gsl OPAM package? Hoping to see something like this:

$ opam info gsl
             package: gsl
             version: 1.11.0
            homepage: https://bitbucket.org/mmottl/gsl-ocaml
             authors: Olivier Andrieu <[email protected]>, Markus Mottl <[email protected]>
             license: GPL-3+
             depends: ocamlfind
   installed-version: gsl.1.11.0 [4.00.1]
         description: GSL - Bindings to the GNU Scientific Library

This version branched off from Olivier Andrieu's distribution
(ocamlgsl) and includes contains patches by Markus Mottl as well as
numerous API improvements.
$

Please also make sure you have done eval $(opam config env) in the shell where you later run make for PhyloCSF.

mlin avatar Jun 18 '13 23:06 mlin

Thanks for your reply, Mike. I will check it later.

2013/6/19 Mike Lin [email protected]

Hi, Can you check the status of the gsl OPAM package? Hoping to see something like this:

$ opam info gsl package: gsl version: 1.11.0 homepage: https://bitbucket.org/mmottl/gsl-ocaml authors: Olivier Andrieu [email protected], Markus Mottl [email protected] license: GPL-3+ depends: ocamlfind installed-version: gsl.1.11.0 [4.00.1] description: GSL - Bindings to the GNU Scientific Library

This version branched off from Olivier Andrieu's distribution (ocamlgsl) and includes contains patches by Markus Mottl as well as numerous API improvements. $

Please also make sure you have done eval $(opam config env) in the shell where you later run make for PhyloCSF.

— Reply to this email directly or view it on GitHubhttps://github.com/mlin/PhyloCSF/issues/13#issuecomment-19651016 .

pingguoilove avatar Jun 19 '13 16:06 pingguoilove

Hi Mike, I just check the status of gsl OPAM,and I see something like yours.I run eval $(opam config env) before I run make for PhyloCSF. But I got the same errors. I follow all 3 steps on Github wiki page, but failed on the last step.

2013/6/19, 张军 [email protected]:

Thanks for your reply, Mike. I will check it later.

2013/6/19 Mike Lin [email protected]

Hi, Can you check the status of the gsl OPAM package? Hoping to see something like this:

$ opam info gsl package: gsl version: 1.11.0 homepage: https://bitbucket.org/mmottl/gsl-ocaml authors: Olivier Andrieu [email protected], Markus Mottl [email protected] license: GPL-3+ depends: ocamlfind installed-version: gsl.1.11.0 [4.00.1] description: GSL - Bindings to the GNU Scientific Library

This version branched off from Olivier Andrieu's distribution (ocamlgsl) and includes contains patches by Markus Mottl as well as numerous API improvements. $

Please also make sure you have done eval $(opam config env) in the shell where you later run make for PhyloCSF.

― Reply to this email directly or view it on GitHubhttps://github.com/mlin/PhyloCSF/issues/13#issuecomment-19651016 .

pingguoilove avatar Jun 20 '13 02:06 pingguoilove

Sorry, I'm not exactly sure what the problem is then. What OS & version are you using? For reference I was able to run PhyloCSF using http://www.instantserver.io/ with this exact series of commands:

# install OPAM and some other apt packages (based on the OPAM Quick Install instructions)
sudo sh -c 'echo "deb [arch=amd64] http://www.recoil.org/~avsm/ wheezy main" >> /etc/apt/sources.list'
sudo apt-get update
sudo apt-get install -y --force-yes make m4 libgsl0-dev ocaml camlp4-extra opam
# set up OPAM
opam init # asks some questions, gives some instructions that you follow
eval $(opam config env)
# install OPAM packages
opam install batteries ocaml+twt gsl
# download & install PhyloCSF
git clone git://github.com/mlin/PhyloCSF.git
cd PhyloCSF
make
./PhyloCSF 12flies PhyloCSF_Examples/tal-AA.fa

A couple of the apt packages (ocaml, camlp4-extra) weren't strictly necessary because the opam installer will compile them if they're not already present; installing them in advance just saves some time.

mlin avatar Jun 20 '13 04:06 mlin

Hi mike, I tried Ubuntu 10.x and 12.x,but all failed.I ran that series of commands you gave to me and it works. I will try 13.04 on my own machine.

Thanks for your help!

2013/6/20 Mike Lin [email protected]

Sorry, I'm not exactly sure what the problem is then. What OS & version are you using? For reference I was able to run PhyloCSF using http://www.instantserver.io/ with this exact series of commands:

install OPAM and some other apt packages (based on the OPAM Quick Install instructions)

sudo sh -c 'echo "deb [arch=amd64] http://www.recoil.org/~avsm/ wheezy main" >> /etc/apt/sources.list' sudo apt-get update sudo apt-get install -y --force-yes make m4 libgsl0-dev ocaml camlp4-extra opam

set up OPAM

opam init # asks some questions, gives some instructions that you follow eval $(opam config env)

install OPAM packages

opam install batteries ocaml+twt gsl

download & install PhyloCSF

git clone git://github.com/mlin/PhyloCSF.git cd PhyloCSF make ./PhyloCSF 12flies PhyloCSF_Examples/tal-AA.fa

— Reply to this email directly or view it on GitHubhttps://github.com/mlin/PhyloCSF/issues/13#issuecomment-19730240 .

pingguoilove avatar Jun 20 '13 12:06 pingguoilove

Hmm...I used the same script successfully on a fresh Ubuntu 12.04 instance I launched inside EC2. I can only speculate there might be something particular to your environment that is throwing off the package manager. Sorry about that!

mlin avatar Jun 20 '13 17:06 mlin

Yeah,I have already compiled successfully on ubuntu 13.04(fresh). I'm very exciting now. But when I ran ./PhyloCSF 12files PhyloCSF_Examples/tal-AA.fa there came out another error: ./PhyloCSF 12files PhyloCSF_Examples/tal-AA.fa Fatal error: exception Failure("could not find required parameter file /home/xxx/PhyloCSF/PhyloCSF_Parameters/12files.nh")

I go to /home/xxx/PhyloCSF/PhyloCSF_Parameters/ dictionary but to find that the 12files.nh exists. I believe that you can solve the problem ^_^.

pingguoilove avatar Jun 20 '13 17:06 pingguoilove

The file name should be "12flies" not "12files".

On Jun 20, 2013, at 1:52 PM, Jhon.Chang wrote:

Yeah,I have already compiled successfully on ubuntu 13.04. I'm very exciting now. But when I ran ./PhyloCSF 12files PhyloCSF_Examples/tal-AA.fa there came out another error: ./PhyloCSF 12files PhyloCSF_Examples/tal-AA.fa Fatal error: exception Failure("could not find required parameter file /home/zebrafish/PhyloCSF/PhyloCSF_Parameters/12files.nh")

I go to /home/zebrafish/PhyloCSF/PhyloCSF_Parameters/ dictionary but to find that the 12files.nh exists. I believe that you can solve the problem ^_^.

— Reply to this email directly or view it on GitHub.

iljungr avatar Jun 20 '13 18:06 iljungr

Oh,yeah.Thanks very much!

2013/6/20 iljungr [email protected]

The file name should be "12flies" not "12files".

On Jun 20, 2013, at 1:52 PM, Jhon.Chang wrote:

Yeah,I have already compiled successfully on ubuntu 13.04. I'm very exciting now. But when I ran ./PhyloCSF 12files PhyloCSF_Examples/tal-AA.fa there came out another error: ./PhyloCSF 12files PhyloCSF_Examples/tal-AA.fa Fatal error: exception Failure("could not find required parameter file /home/zebrafish/PhyloCSF/PhyloCSF_Parameters/12files.nh")

I go to /home/zebrafish/PhyloCSF/PhyloCSF_Parameters/ dictionary but to find that the 12files.nh exists. I believe that you can solve the problem ^_^.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHubhttps://github.com/mlin/PhyloCSF/issues/13#issuecomment-19772291 .

pingguoilove avatar Jun 21 '13 08:06 pingguoilove

Getting the same error on Mac OS X 10.8.5, when running make:

make -C lib/CamlPaml  reinstall
make uninstall
ocamlfind remove CamlPaml
ocamlfind: [WARNING] No such directory: /Users/jowkar/.opam/system/lib/CamlPaml
make install
ocamlbuild CamlPaml.cma CamlPaml.cmxa
Finished, 1 target (0 cached) in 00:00:00.
+ ocamlfind ocamlc -c -g -pp ocaml+twt -o P.cmo P.ml
File "P.ml", line 3, characters 14-31:
Error: Unbound module Gsl
Command exited with code 2.
Compilation unsuccessful after building 46 targets (0 cached) in 00:00:01.
make[2]: *** [lib] Error 10
make[1]: *** [reinstall] Error 2
make: *** [CamlPaml] Error 2

OPAM was installed using the installer script as mentioned on http://opam.ocaml.org/doc/Quick_Install.html, namely:

sh ./opam_installer.sh /usr/local/bin system

After that, I used

opam install batteries ocaml+twt,

Note the exclusion of gsl, which was instead installed using homebrew (as installing gsl with opam did not work).

Next I did

git clone git://github.com/mlin/PhyloCSF.git cd PhyloCSF make

which caused the above failure.

jowkar avatar Mar 14 '14 10:03 jowkar

brew install gsl will install the GNU Scientific Library, while opam install gsl will install the OCaml bindings to that library. The library is needed for the bindings, and the bindings are needed for PhyloCSF. Please opam install gsl to install the bindings now that you have the library and try building PhyloCSF again. I'll clarify this on the wiki page.

mlin avatar Mar 14 '14 18:03 mlin

Thank you for the clarification. Installing the bindings after the library, as you suggested, worked and PhyloCSF now builds. As a sidenote, in this case there was also a simultaneous issue with installing the opam gsl package due to this bug in opam (or rather, in the latest Xcode release, depending on whom you ask): https://github.com/ocaml/opam-repository/issues/1787.

jowkar avatar Mar 15 '14 18:03 jowkar

Hi, I'm having the same problem as jowkar, on RHEL 6.2 The gsl library is already installed, but in a non-standard location: /home/software/gsl/gsl-1.15/lib. I'm using an ocamlbrew install of ocaml: /home/rob/ocamlbrew/ocaml-4.01.0/

When I do opam install gs

I get:

-bash-4.1$ opam install gsl The following actions will be performed:

  • install gsl.1.15.0 1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

=-=-= Installing gsl.1.15.0 =-=-= Building gsl.1.15.0: ocaml setup.ml -configure --prefix /home/rob/ocamlbrew/ocaml-4.01.0/.opam/system ocaml setup.ml -build ocaml setup.ml -install [ERROR] The compilation of gsl.1.15.0 failed. Removing gsl.1.15.0. ocamlfind remove gsl

ERROR while installing gsl.1.15.0

opam-version 1.1.1 os linux command ocaml setup.ml -configure --prefix /home/rob/ocamlbrew/ocaml-4.01.0/.opam/system path /panfs/home/rob/ocamlbrew/ocaml-4.01.0/.opam/system/build/gsl.1.15.0 compiler system (4.01.0) exit-code 1 env-file /panfs/home/rob/ocamlbrew/ocaml-4.01.0/.opam/system/build/gsl.1.15.0/gsl-15083-ffb3fd.env stdout-file /panfs/home/rob/ocamlbrew/ocaml-4.01.0/.opam/system/build/gsl.1.15.0/gsl-15083-ffb3fd.out stderr-file /panfs/home/rob/ocamlbrew/ocaml-4.01.0/.opam/system/build/gsl.1.15.0/gsl-15083-ffb3fd.err

ocaml do_const.ml --mli > lib/const.mli

make: gsl-config: Command not found /bin/sh: gsl-config: command not found Exception: End_of_file. make: *** [post-conf] Error 2 E: Failure("Command 'make post-conf' terminated with error code 2")

'opam install gsl' failed.

I suspect I need to help opam find the library. I tried setting LD_LIBRARY_PATH, but that didn't help.

Thanks for any assistance,

Rob

robertbjornson avatar Mar 24 '14 15:03 robertbjornson

Find the executable named gsl-config (most likely somewhere in your GSL installation directory) and include its directory in your PATH. gsl-config is a program included with GNU Scientific Library that helps programs using the library with setting the necessary compiler and linker options.

mlin avatar Mar 24 '14 15:03 mlin

Hi Mike,

That solved my problem. Thanks very much for your quick and accurate help.

Rob

On Mon, Mar 24, 2014 at 11:41 AM, Mike Lin [email protected] wrote:

Find the executable named gsl-config (most likely somewhere in your GSL installation directory) and include its directory in your PATH. gsl-configis a program included with GNU Scientific Library that helps programs using the library with setting the necessary compiler and linker options.

Reply to this email directly or view it on GitHubhttps://github.com/mlin/PhyloCSF/issues/13#issuecomment-38459836 .

robertbjornson avatar Mar 24 '14 16:03 robertbjornson

Hi Mike,

I also get the problem when running opam install gsl. I already install the gsl, and add the gsl-config directory "/home/MYNAME/usr/gsl/bin" to the PATH. When running opam install gsl, I get the error:

opam install gsl The following actions will be performed:

  • install gsl.1.17.2 1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

=-=-= Installing gsl.1.17.2 =-=-= Building gsl.1.17.2: ocaml setup.ml -configure --prefix /home/huiwang/.opam/system ocaml setup.ml -build ocaml setup.ml -install [ERROR] The compilation of gsl.1.17.2 failed. Removing gsl.1.17.2. ocamlfind remove gsl

===== ERROR while installing gsl.1.17.2 ===== opam-version 1.1.1 os linux command ocaml setup.ml -build path /home/huiwang/.opam/system/build/gsl.1.17.2 compiler system (4.01.0) exit-code 1 env-file /home/huiwang/.opam/system/build/gsl.1.17.2/gsl-25386-ffb3fd.env stdout-file /home/huiwang/.opam/system/build/gsl.1.17.2/gsl-25386-ffb3fd.out stderr-file /home/huiwang/.opam/system/build/gsl.1.17.2/gsl-25386-ffb3fd.err

stdout

...[truncated] lib/mlgsl_bspline.c: In function 'ml_gsl_bspline_knots_uniform': lib/mlgsl_bspline.c:35: warning: implicit declaration of function 'gsl_bspline _knots_uniform' lib/mlgsl_bspline.c:35: error: 'gsl_bspline_workspace' undeclared (first use i n this function) lib/mlgsl_bspline.c:35: error: expected expression before ')' token lib/mlgsl_bspline.c:35: warning: left-hand operand of comma expression has no effect lib/mlgsl_bspline.c: In function 'ml_gsl_bspline_eval': lib/mlgsl_bspline.c:41: warning: implicit declaration of function 'gsl_bspline _eval' lib/mlgsl_bspline.c:41: error: 'gsl_bspline_workspace' undeclared (first use i n this function) lib/mlgsl_bspline.c:41: error: expected expression before ')' token Command exited with code 2.

stderr

W: Cannot find source file matching module 'gsl' in library gsl E: Failure("Command ''/home/huiwang/local/bin/ocamlbuild' lib/libgsl_stubs.a l ib/dllgsl_stubs.so lib/gsl.cma lib/gsl.cmxa lib/gsl.a lib/gsl.cmxs examples/blas _ex.native examples/blas_speed_test.native examples/bspline_ex.native examples/c heb_ex.native examples/combi_ex.native examples/const_ex.native examples/deriv_e x.native examples/eigen_ex.native examples/fft_c.native examples/fft_c2.native e xa...[truncated]

'opam install gsl' failed.

Could you help me fix it out?

Thanks,

Hui

huiwangsimm avatar Jul 24 '14 00:07 huiwangsimm

Hi: I also got a problem when I install the PhyloCSF flolllow the website (https://github.com/mlin/PhyloCSF/wiki). I got the error: make -C lib/CamlPaml reinstall make[1]: Entering directory /public/software/PhyloCSF_bak/lib/CamlPaml' make uninstall make[2]: Entering directory/public/software/PhyloCSF_bak/lib/CamlPaml' ocamlfind remove CamlPaml ocamlfind: [WARNING] No such directory: /usr/local/lib/ocaml/site-lib/CamlPaml make[2]: Leaving directory /public/software/PhyloCSF_bak/lib/CamlPaml' make install make[2]: Entering directory/public/software/PhyloCSF_bak/lib/CamlPaml' ocamlbuild -use-ocamlfind CamlPaml.cma CamlPaml.cmxa

  • ocamlfind ocamldep -package gsl -pp ocaml+twt -modules Newick.mli > Newick.mli.depends ocamlfind: Package gsl' not found Command exited with code 2. Compilation unsuccessful after building 1 target (0 cached) in 00:00:00. make[2]: *** [lib] Error 10 make[2]: Leaving directory/public/software/PhyloCSF_bak/lib/CamlPaml' make[1]: *** [reinstall] Error 2 make[1]: Leaving directory `/public/software/PhyloCSF_bak/lib/CamlPaml' make: *** [CamlPaml] Error 2

But I have already installed the gsl, I run "opam info gsl", and got the information: package: gsl version: 1.18.0 repository: default upstream-url: https://github.com/mmottl/gsl-ocaml/releases/download/v1.18.0/gsl-ocaml-1.18.0.tar.gz upstream-kind: http upstream-checksum: bcc05ce00239ae2cec7cdc36f3ce7a94 homepage: http://mmottl.github.io/gsl-ocaml author: Olivier Andrieu [email protected], Markus Mottl [email protected] license: GPL-3+ depends: ocamlfind & camlp4 & conf-gsl installed-version: available-versions: 1.11.0, 1.13.0, 1.14.0, 1.15.0, 1.15.2, 1.15.3, 1.15.4, 1.17.1, 1.17.2, 1.18.0 description: GSL - Bindings to the GNU Scientific Library This version branched off from Olivier Andrieu's distribution (ocamlgsl) and includes contains patches by Markus Mottl as well as numerous API improvements.

I don't know how to fix this problem.Thanks for any assistance.

xdkong

xdkong avatar Jan 29 '15 13:01 xdkong

@xdkong unfortunately I can't tell for sure what the problem is. Is the OCaml version up-to-date?

If you're familiar with Docker, I've published a PhyloCSF Dockerfile. I hope this is useful, either directly or to see the installation sequence.

mlin avatar Jan 31 '15 22:01 mlin

Hi Mike, I tried to install PhyloCSF on a local Centos cluster and failed, then on the local machine. Similar to the previous post, opam claims that gsl is present (ran opam info gsl), but when I do make, it get the same error as in the previous post:

make -C lib/CamlPaml reinstall make uninstall ocamlfind remove CamlPaml ocamlfind: [WARNING] No such directory: /Users/aardvark/.opam/system/lib/CamlPaml make install ocamlbuild -use-ocamlfind CamlPaml.cma CamlPaml.cmxa

  • ocamlfind ocamldep -package gsl -pp ocaml+twt -modules Newick.mli > Newick.mli.depends ocamlfind: Package `gsl' not found Command exited with code 2. Compilation unsuccessful after building 1 target (0 cached) in 00:00:00. make[2]: *** [lib] Error 10 make[1]: *** [reinstall] Error 2 make: *** [CamlPaml] Error 2

My gsl version is 1.19.1. Furthermore, the command "opam install batteries ocaml+twt gsl" does not work. [ERROR] No package named ocaml+twt found.

Cheers, Nenad

nbartonicek avatar Oct 11 '16 04:10 nbartonicek

Hi: I have installed gsl, and used "opam install gsl" to check it.

Then, I use "opam install batteries ocaml+twt gsl" ,but it does not work. [ERROR] No package named ocaml+twt found.

Thanks for any assistance,

zpspring avatar Oct 21 '16 08:10 zpspring

Hi Mike Owing to not being a sudoer, I have installed gsl by github packages, so how to link it to opam to find the installed gsl?

DooYal avatar Nov 02 '23 02:11 DooYal