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

Unclear how to build #1

Closed
mcriley opened this issue Apr 18, 2012 · 5 comments
Closed

Unclear how to build #1

mcriley opened this issue Apr 18, 2012 · 5 comments

Comments

@mcriley
Copy link

mcriley commented Apr 18, 2012

While there are dependencies on at least gmp and mpfr, it is not clear what to do with them in order to build headmaster.

I already have the developer packages for each installed on Ubuntu 11.10, but the headmaster build process appears to require these be separately retrieved, and placed in some particular location, which is not specified.

Please provide sufficient information about what to do with these dependencies to allow one to execute the make file and build this tool, as I am very interested in its capabilities.

@ytomino
Copy link
Owner

ytomino commented Apr 18, 2012

Hello, mcriley. I'm glad you try it!
And sorry for my insufficiency description.

I installed GMP and MPFR into /usr/local/include and /usr/local/lib.
So, there is no special specification in my makefile.
(Perhaps, MPC is required too. It's unused but remains in makefile because of my omission.)

I do not know multiarch of Ubuntu and imagine that the package manager(apt?) probably install the libraries into different directory, as long as your talk is heard.
GMP does not support pkg-config.
So I added makefile variables WITH_GMP and WITH_MPFR.

I tested them by that install GMP and MPFR into separated directories with Homebrew (A package manager in OSX), mv /usr/local/include and /usr/local/lib to another place, and make WITH_GMP=/Applications/Homebrew/Cellar/gmp/5.0.4/ WITH_MPFR=/Applications/Homebrew/Cellar/mpfr/3.1.0/ , then, it works.

Please try the commit 56d5343 (latest devel-0.21 branch), pull the submodule in lib/gmp to 5e01593 (latest master of gmp-ocaml).

Here is my build log for reference: https://github.com/ytomino/headmaster/wiki/Build

@mcriley
Copy link
Author

mcriley commented Apr 19, 2012

I do not understand how your makefile build is supposed to work on a Linux system.

When I invoke the plain make as follows:

 make -C main install BINDIR=$HOME/bin

The result is:

make: Entering directory `/home/wintermute/devel/libxml2ada/headmaster/main'
make -C ../lib/gmp install DESTDIR=/home/wintermute/devel/libxml2ada/headmaster/main/build WITH=gmp,mpfr
make[1]: Entering directory `/home/wintermute/devel/libxml2ada/headmaster/lib/gmp'
make[1]: *** No rule to make target `install'.  Stop.
make[1]: Leaving directory `/home/wintermute/devel/libxml2ada/headmaster/lib/gmp'
make: *** [build/gmp.cmxa] Error 2
make: Leaving directory `/home/wintermute/devel/libxml2ada/headmaster/main'

The headmaster/lib/gmp directory is empty, there's no makefile or anything there to build.

I tried another approach by creating a gmp and mpfr directory and soft-linking in the appropriate files from /usr/include/ and /usr/lib. I then invoke make as:

make -C main WITH_GMP=~/devel/libxml2ada/headmaster/gmp WITH_MPFR=~/devel/libxml2ada/headmaster/mpfr install BINDIR=$HOME/bin

And I get exactly the same results as invoking it without the makefile variables.

Perhaps if you listed your headmaster directory hierarchy (ls -R) that would help me find out what is missing.

@ytomino
Copy link
Owner

ytomino commented Apr 19, 2012

The headmaster/lib/gmp directory is empty

Eureka!

Do git clone --recursive (or git submodule init && git submodule update) to clone a repository having submodules. (.gitmodules exists)
Please read http://help.github.com/submodules/

Perhaps if you listed your headmaster directory hierarchy (ls -R) that would help me find out what is missing.

I added it into https://github.com/ytomino/headmaster/wiki/Build

@mcriley
Copy link
Author

mcriley commented Apr 20, 2012

I was able to successfully build headmaster on Ubuntu Linux 11.10, though I had to make some minor makefile changes.

In each of makefile-gmp, makefile-mpfr, and makefile-mpc I had to add "-fPIC" to the CFLAGS variable.

When building on Ubuntu Linux, the following packages needed to be installed:

  • libgmp-dev
  • libmpfr-dev
  • libmpc-dev
  • ocaml (and its supporting packages)
  • ocaml-native-compilers

As one who uses git only to retrieve source repositories from github, I was not aware that one would have to use the --recursive option when cloning the headmaster repository. It would be a good thing to mention that :-)

@ytomino
Copy link
Owner

ytomino commented Apr 20, 2012

Good.

In each of makefile-gmp, makefile-mpfr, and makefile-mpc I had to add "-fPIC" to the CFLAGS variable.

I added -fPIC, too.

ytomino/gmp-ocaml@f59e6ce

It would be a good thing to mention that :-)

Ah, yes. I will add attention about --recursive into readme.rst to show it in this project page.

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

No branches or pull requests

2 participants