Skip to content

Commit

Permalink
Add automatic way to get GSL CFLAGS and LDFLAGS set on Mac/UNIX to in…
Browse files Browse the repository at this point in the history
…stallation instructions [ci skip]
  • Loading branch information
jobovy committed Jul 17, 2020
1 parent d661a45 commit 323db78
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions doc/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ or to upgrade without upgrading the dependencies::

Installing with pip will automatically install the required
dependencies (``numpy``, ``scipy``, and ``matplotlib``), but not the
optional dependencies.
optional dependencies. On a Mac/UNIX system, you can make sure to include
the necessary GSL environment variables by doing (see :ref:`below <gsl_cflags>`)::

export CFLAGS="$CFLAGS -I`gsl-config --prefix`/include" && export LDFLAGS="$LDFLAGS -L`gsl-config --prefix`/lib" && pip install galpy

Latest version
--------------
Expand Down Expand Up @@ -310,9 +313,17 @@ to add the ``'-I/usr/include'`` and ``'-L/usr/lib'`` to them.
If you are on a Mac or UNIX system (e.g., Linux), you can find the correct ``CFLAGS`` and ``LDFLAGS``/``LD_LIBRARY_path`` entries by doing::

gsl-config --cflags
gsl-config --libs
gsl-config --prefix

where you should add ``/lib`` to the output of the latter. In a bash shell, you could also simply do::

export CFLAGS="$CFLAGS -I`gsl-config --prefix`/include" && export LDFLAGS="$LDFLAGS -L`gsl-config --prefix`/lib" && pip install galpy
or::

export CFLAGS="$CFLAGS -I`gsl-config --prefix`/include" && export LDFLAGS="$LDFLAGS -L`gsl-config --prefix`/lib" && python setup.py install

(don't include the ``-lgsl lgslcblas`` portion of the latter output.)
depending on whether you are installing using ``pip`` or from source.

I have defined ``CFLAGS``, ``LDFLAGS``, and ``LD_LIBRARY_PATH``, but the compiler does not seem to include these and still returns with errors
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down

0 comments on commit 323db78

Please sign in to comment.