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

Review README & build instructions #1

Open
antoinemine opened this issue Jan 10, 2019 · 7 comments
Open

Review README & build instructions #1

antoinemine opened this issue Jan 10, 2019 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@antoinemine
Copy link
Owner

No description provided.

@antoinemine antoinemine added the enhancement New feature or request label Jan 10, 2019
@antoinemine antoinemine self-assigned this Jan 10, 2019
@antoinemine
Copy link
Owner Author

README and build instructions for Linux and Windows have been reviewed.
The README for Mac is not up-to-date though.

@jmid
Copy link

jmid commented Jul 9, 2020

Here are some instructions to install Apron on Mac OS X.
I'm using Macports. Others use Homebrew where things may be located in different directories or named differently...

To install the mlgmpidl dependency this worked for me:

  env CFLAGS="-I/opt/local/include/" LDFLAGS="-L/opt/local/lib/" opam install mlgmpidl

I could not install Apron though opam.
Instead the following steps to compile from scratch seems to work:

   env GMP_PREFIX=/opt/local MPFR_PREFIX=/opt/local ./configure -prefix /opt/local -no-java -no-ppl -absolute-dylibs
   make
   sudo make install

Below follows the error I get from an opam install attempt.
Suggestions for how to communicate the above options (-prefix, ...) as environment variables through opam are welcome!

$ env CFLAGS="-I/opt/local/include/" LDFLAGS="-L/opt/local/lib/" GMP_PREFIX=/opt/local MPFR_PREFIX=/opt/local opam install apron
The following actions will be performed:
  - install apron v0.9.12

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[apron.v0.9.12] found in cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of apron failed at "/Users/jmid/.opam/opam-init/hooks/sandbox.sh build make -j3".

#=== ERROR while compiling apron.v0.9.12 ======================================#
# context     2.0.6 | macos/x86_64 | ocaml-base-compiler.4.09.0 | https://opam.ocaml.org/#541efd87
# path        ~/.opam/4.09.0/.opam-switch/build/apron.v0.9.12
# command     ~/.opam/opam-init/hooks/sandbox.sh build make -j3
# exit-code   2
# env-file    ~/.opam/log/apron-80570-ad8886.env
# output-file ~/.opam/log/apron-80570-ad8886.out
### output ###
# [...]
# ld: library not found for -lmpfr
# ld: library not found for -lmpfr
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# File "caml_startup", line 1:
# Error: Error during linking
# File "caml_startup", line 1:
# Error: Error during linking
# make[1]: *** [apron.d.cmxs] Error 2
# make[1]: *** Waiting for unfinished jobs....
# make[1]: *** [apron.cmxs] Error 2
# make: *** [ml] Error 2



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build apron v0.9.12
+- 
- No changes have been performed

@jberdine
Copy link
Contributor

jberdine commented Jul 9, 2020

I encountered the same linking error, and #28 fixed it for me.

@caterinaurban
Copy link
Contributor

caterinaurban commented Jul 9, 2020

To install Apron on Mac OS X using Homebrew I did the following:

  1. Installed GMP and MPFR
    brew install gmp and brew install mpfr
  2. Linked the installed GMP and MPFR from /usr/local
    ln -s /usr/local/Cellar/gmp/ /usr/local/ and ln -s /usr/local/Cellar/mpfr/ /usr/local/
  3. Installed Apron from sources

In my case, I configured the latter step with -no-cxx -no-java -no-ocaml -no-ppl but it shouldn't be a problem to allow at least C++ and Ocaml. I couldn't find a better way around step 2) (the GMP_PREFIX and MPFR_PREFIX options were not happy about looking things up in /usr/local/Cellar/...).

@antoinemine
Copy link
Owner Author

I've merged #28, which should help. Jan, Caterina, could you confirm that it works? (without symlinks!)

I imagine you still need to specify GMP_PREFIX and MPFR_PREFIX by hand, though, and the value depends on Homebrew vs. Macports.
It would be nice to fix the ./configure and the apron.opam to get this automatically on MacOS, though (and possibly for mlgmpidl as well). Opam already knows that you need --absolute-dylibs. Any idea?

@jmid
Copy link

jmid commented Jul 10, 2020

I can confirm that I can now install using opam.
I downloaded the latest the Apron version with #28 and locally installed as follows:

  env GMP_PREFIX=/opt/local MPFR_PREFIX=/opt/local opam install .

I don't expect any issues once this makes its way to the opam repository and gets downloaded automatically by opam from there.

In my current Macports setup I have installed the GNU toolchain from binutils and put them in the PATH.
Hence something like this to reproduce:

 sudo port install binutils
 export PATH=/opt/local/libexec/gnubin:$PATH
 env GMP_PREFIX=/opt/local MPFR_PREFIX=/opt/local opam install .

@jberdine
Copy link
Contributor

For the record, I haven't needed to set environment variables to install using opam with gmp and mpfr installed via homebrew. Note though that e.g. the conf-mpfr package expects homebrew to install the libraries into /usr/local/lib and macports to install them into /opt/local/lib. I think I have a default setup of homebrew, which does populate /usr/local/lib with symlinks into /usr/local/Cellar. I don't know if there is a better way / one with fewer hard-coded assumptions.

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

No branches or pull requests

4 participants