gsl-shell icon indicating copy to clipboard operation
gsl-shell copied to clipboard

Errors while compiling on OS X 10.8

Open pygy opened this issue 11 years ago • 10 comments

I installed all dependencies using Homebrew, and when try to compile the GSL Shell, I get the following: https://gist.github.com/pygy/bcc04edb58deb1d163d6

X11 is installed and works properly, as is Xcode (4.6) and its command line tools (it's all up to date).

pygy avatar Feb 13 '13 03:02 pygy

Hi,

the makefile is not very smart so you have to help him to locate the path of the include files. The relevant file is "makepackages" in the root directory.

The section concerned is:

else
  ifeq ($(HOST_SYS),Darwin)

# GWH: determined all of the following flags (except for pthread)
# using the pkg-config utility, except I had to add -lX11 to AGG_LIBS.

  AGG_INCLUDES = $(shell pkg-config libagg --cflags)
  AGG_LIBS = $(shell pkg-config libagg --libs) -lX11

The content was contributed by an Mac OS X user, I'm not able to test it myself. May be you don't have pkg-config installed. Try to run:

pkg-config libagg --cflags

Let me know what you find out.

Francesco

PS: just a precision, normally you cannot compile the FOX user interface on Mac OS X.

franko avatar Feb 13 '13 21:02 franko

$ pkg-config libagg --cflags
-I/Users/pygy/src/homebrew/Cellar/libagg/2.5/include/agg2

Adding -I/usr/X11R6/include/ to the AGG_INCLUDES in makepackage solved the problem, and removing -lsupc++ (reportedly not needed on recent versions of OS X) from fox-gui/Makefile allows to proceed further (the FOX GUI compiles, but doesn't work).

$ ./gsl-shell-gui
cannot create state: not enough memory

Now I have problems with an undeclared readline symbol:

$ make
...
Compiling completion.c
completion.c: In function ‘initialize_readline’:
completion.c:18: warning: assignment from incompatible pointer type
completion.c: In function ‘my_generator’:
completion.c:44: warning: implicit declaration of function ‘strlen’
completion.c:44: warning: incompatible implicit declaration of built-in function ‘strlen’
completion.c:47: warning: implicit declaration of function ‘strchr’
completion.c:47: warning: incompatible implicit declaration of built-in function ‘strchr’
completion.c:55: warning: implicit declaration of function ‘memcpy’
completion.c:55: warning: incompatible implicit declaration of built-in function ‘memcpy’
completion.c:75: warning: incompatible implicit declaration of built-in function ‘memcpy’
completion.c:90: warning: incompatible implicit declaration of built-in function ‘strchr’
completion.c:112: warning: implicit declaration of function ‘strncmp’
completion.c:119: error: ‘rl_completion_suppress_append’ undeclared (first use in this function)
completion.c:119: error: (Each undeclared identifier is reported only once
completion.c:119: error: for each function it appears in.)
make: *** [completion.o] Error 1

Homebrew installs http://ftpmirror.gnu.org/readline/readline-6.2.tar.gz from source, but the the default system readline (BSD) superseeds it.

pygy avatar Feb 13 '13 23:02 pygy

Wow, we have now several problems!! :-)

About the FOX GUI I'm afraid but I don't have any idea. Unfortunately this problem can be complicated to debug. If you are very interested I can give you some directions otherwise you can just use the X11 version of gsl shell.

For the problem related with readline you have two options:

  • ether you disable readline support from "makeconfig"
  • you solve your installation problem with two incompatibles readline. The problem is that if the BSD readline headers live in the standard include path I don't know any obvious option to avoid them. You may temporarily rename the file but that's ugly.

It seems also the "completion.c" is missing an

#include <string.h>

franko avatar Feb 14 '13 21:02 franko

I disabled readline, and it works (I hadn't seen the option in makeconfig). Thanks a lot for the help.

pygy avatar Feb 14 '13 23:02 pygy

I'm reopening this before sending a pull request to fix the OS X build.

What branch should I use as a basis?

On another note, it would be nice to be able to disable the GUI through makeconfig.

pygy avatar Apr 21 '14 23:04 pygy

Hi,

I thing that for the build tests you can use the master branch as well as the master-lj2.1, I'm always glad when people help me fix things on Mac OS X.

As for disable the GUI stuff I will give a look. It should be quite simple and it make sense, especially on OS X.

franko avatar Apr 22 '14 20:04 franko

The thing is, the current options probably work with an older version of OS X, but I don't know which one.

I'll be conservative, and restrict the parameters to OS X 10.8.

I can reliably detect the OS X version using this:

$ sw_vers | grep ProductVersion | sed "s/.*[^.]10\\./10./" | sed "s/\\.[0-9]*$//"
10.8

At one point, I got the GUI to work, but I tried to re-install the libraries from scratch, and, currently, the version of Fox provided by homebrew cannot be compiled on OS X 10.8 and 10.9.

pygy avatar Apr 22 '14 22:04 pygy

I got the GUI to work again. I'm waiting for the Homebrew guys to address the issues, and once it works out of the box, I'll send you a pull request with the correct parameters for OS X.

pygy avatar Apr 27 '14 01:04 pygy

Great ! Actually the Mac OS X build has been fixed many times and it always get broken in some way or another. Someone already reported in past that he was able to build the FOX GUI but this seems to be a difficult task. I guess that the FOX Library is non very popular on Mac OS X :-)

Feel free also to add in the "INSTALL" file some Mac OS X informations to build gsl shell if you think it can help other people.

Looking forward for your patch :-)

franko avatar Apr 27 '14 06:04 franko

I'm still waiting for the Homebrew guys to chime in on my issue with Fox on OS X 10.8.

I just sent a reminder. If I they let it linger I'll go ahead without Fox.

pygy avatar May 11 '14 22:05 pygy