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

Errors while compiling on OS X 10.8 #8

Open
pygy opened this issue Feb 13, 2013 · 10 comments
Open

Errors while compiling on OS X 10.8 #8

pygy opened this issue Feb 13, 2013 · 10 comments
Assignees

Comments

@pygy
Copy link

pygy commented Feb 13, 2013

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).

@franko
Copy link
Owner

franko commented Feb 13, 2013

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.

@ghost ghost assigned franko Feb 13, 2013
@pygy
Copy link
Author

pygy commented Feb 13, 2013

$ 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.

@franko
Copy link
Owner

franko commented Feb 14, 2013

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>

@pygy
Copy link
Author

pygy commented Feb 14, 2013

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

@pygy pygy closed this as completed Feb 14, 2013
@pygy
Copy link
Author

pygy commented Apr 21, 2014

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 pygy reopened this Apr 21, 2014
@franko
Copy link
Owner

franko commented Apr 22, 2014

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.

@pygy
Copy link
Author

pygy commented Apr 22, 2014

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
Copy link
Author

pygy commented Apr 27, 2014

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.

@franko
Copy link
Owner

franko commented Apr 27, 2014

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 :-)

@pygy
Copy link
Author

pygy commented May 11, 2014

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.

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