Forum rss-feed

Forum

Developers: Building EigenD on Lion

Most Recent

written by: dhjdhj

Never mind --- forgot to change /Developer to /Developer-old

(sigh)

written by: barnone

Fri, 16 Sep 2011 20:48:09 +0100 BST

Some issues building EigenD on Lion.

I have XCode 3.2.6 and XCode 4.1 installed. Seems that 4.1 tries to remove gcc 4.0. I thought this was the problem as EigenD build could not find gcc++-4.0.

There is a version left here
/Developer-3.2.6/usr/bin

Soft linked to that.

Scons seems to have issues finding my standard BSD libraries even though they exist.

[Chaos-3:/Developer-3.2.6/Projects/Eigenlabs-EigenD-184a209] chrislloyd% make
scons: Reading SConscript files ...
platform: macosx-i386 python: /usr/pi/bin/python
clearing /Developer-3.2.6/Projects/Eigenlabs-EigenD-184a209/tmp/stage
clearing /Developer-3.2.6/Projects/Eigenlabs-EigenD-184a209/tmp/pkg
pip: tmp/bin/pip
building release 1.4.5-experimental
scons: done reading SConscript files.
scons: Building targets ...
tmp/obj/lib_alpha2/src/a2dump.o (g++-4.0)
lib_alpha2/src/a2dump.cpp:24:20: error: unistd.h: No such file or directory
lib_alpha2/src/a2dump.cpp:30:18: error: cstdio: No such file or directory
lib_alpha2/src/a2dump.cpp:31:19: error: cstring: No such file or directory
lib_alpha2/src/a2dump.cpp:32:19: error: cstdlib: No such file or directory


In the same folder if I create a file called x.c with these contents


// BTW, these imports Had angle brackets around them but forum is stripping // them, so they are shown with quotes here.
#include "math.h";
#include "unistd.h";
#include "stdlib.h";

int main(void) { return 0; }

The compile it

gcc++-4.0 x.c

It has no issues finding the same libraries.

I'm not familiar with using SCons. Seems to rely on Python.

I did note that it's using python here
platform: macosx-i386 python: /usr/pi/bin/python

This is an older version

Python 2.5.1 (r251:54863, May 27 2007, 10:54:54)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin

The Python version in my system path is
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

Have you guys had any issues building on Lion?

Any ideas?

Thx.




written by: barnone

Fri, 16 Sep 2011 20:51:45 +0100 BST

Alright I figured it out. Although, took a bit to sort out what was happening since I haven't used scons before.

By following the scons code as it built the tool chain, I found this file.

./tools/select_tools.py

Inside there is a switch for Lion

def posix_Darwin_x86_64():
import darwin_tools
env = darwin_tools.PiDarwinEnvironment('macosx-i386')
env.Replace(MACOSXSDK='/Developer-old/SDKs/MacOSX10.4u.sdk')
env.Replace(IS_MACOSX_86=True)
return env

Problem is that it has a hardcoded path to /Developer-old

When I installed XCode 4.1, it renamed this folder to /Developer-3-2-6

So I simply renamed the folder to /Developer-old and seems the build is finding the files and g+++-4.0 as well.

There are so lany changes to the tool chain in Lion, It's a bit disorienting.


written by: geert

Fri, 16 Sep 2011 20:59:23 +0100 BST

Yes, this follows a tutorial that I found on the internet, can't remember which one. It seems they change how this folder is names, since it was named Developer-old for me. Glad you figured it out.


written by: GoneCaving

Fri, 16 Sep 2011 21:59:28 +0100 BST

Seems to me that expecting to find the 10.4 SDK and failing if its not found is the wrong approach. Wouldn't it make more sense to test for 10.4 and fall back to the 10.5 or 10.6 SDKs make more sense?

D


written by: barnone

Fri, 16 Sep 2011 23:42:44 +0100 BST

Unfortunately it seems a but more complicated since Apple seems to have gone to great lengths to remove gcc 4.0 options from Lion.

If you bump to 10.6 it wants gcc 4.2. If you do that then there are some unsupported compiler flags, etc. So looks like a bit more work to be done to support 4.2.

Anyway, I have some simple instructions now for Lion. I ran into another issue with ctags as well.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Building on Lion - NOTES

I've you upgraded from Snow Leopard and then installed XCode 4.1, Apple will have renamed your old /Developer folder to /Developer-3.2.6 or possibly /Developer-old

They also remove the symlinks to gcc 4.0 that you need in /usr/bin

I renamed my old Developer folder to /Developer_old which is what was in the build scripts for EigenD 1.4.5.

I recreated the following softlinks below
[Chaos-3:/usr/bin] chrislloyd% ls -la
lrwxr-xr-x 1 root wheel 30 Sep 16 14:34 g++-4.0 -> /Developer-old/usr/bin/g++-4.0
lrwxr-xr-x 1 root wheel 30 Sep 16 14:34 gcc-4.0 -> /Developer-old/usr/bin/gcc-4.0

In the EigenD source dist, check out the lines in the folowing files.

./tools/darwin_tools.py
self.Replace(MACOSXSDK='/Developer-old/SDKs/MacOSX10.4u.sdk')

select_tools.py
env.Replace(MACOSXSDK='/Developer-old/SDKs/MacOSX10.4u.sdk')

darwin_tools was not set to Developer_old and I got some link errors.

The last issue was that ctags step failed with some invalid commandline params.

if you simply set the PI_NOTAGS environment variable to something, it will skip this step as only needed for editors.

[Chaos-3:/Developer/SDKs] chrislloyd% echo $PI_NOTAGS
true

This is all a bit of a workaround, but it might save someone the hassle.

[edit] one more thing. I thought I could simply symlink the 10.4 SDK into the original location like so...
[Chaos-3:/Developer/SDKs] chrislloyd% sudo ln -s /Developer-old/SDKs/MacOSX10.4u.sdk/MacOSX10.4u.sdk

Doesn't work, dependencies are not properly resolved.

Chris


written by: geert

Sat, 17 Sep 2011 00:16:39 +0100 BST

I followed these instructions to get it all to work:
http://hints.macworld.com/article.php?story=20110318050811544

There are some major incompatibilities with GCC bigger than 4.0 in the way symbol visibility is handled. We can't just change the GCC version, it takes quite some work. This is planned for EigenD 2.0 since it's even more tricky to get this to play nicely with the Windows builds.

I'm building EigenD daily on Lion after the instructions above.

The ctags problem is because you need the GNU version I think, I vaguely remember installing it with MacPorts. This is my version:
Mac:eigend-gpl gbevin$ ctags --help
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
Compiled: Nov 2 2010, 10:01:09

Hope this helps,

Geert


written by: barnone

Sat, 17 Sep 2011 01:13:05 +0100 BST

Thx Geert. Yeah I assumed that getting off 4.0 would be a big deal. I'm not worried about it.

I'm a bit amazed at how aggressively Apple is deprecating platforms though.

Thx for the instructions.


written by: dhjdhj

Wed, 5 Oct 2011 23:44:23 +0100 BST

This is not new ---- Apple was the first to dump floppy drives, then the first to drop serial ports and then the first to add firewire support. The MacBook Air doesn't come with a CD drive.

Some of the stuff they do makes it painful for developers (no question) but they're clearly doing something right!

I'm a bit amazed at how aggressively Apple is deprecating platforms though.


written by: fzzzy

Tue, 18 Oct 2011 09:06:19 +0100 BST

Ok, I uninstalled Xcode, installed Xcode 3, Installed Xcode 4, followed the symlink instructions available several places on the internet, and edited the select_tools.py script, changing Developer-old to Developer. It's finally building! :-) Really looking forward to hacking on EigenD.


written by: barnone

Tue, 18 Oct 2011 16:48:02 +0100 BST

Woot!

Take a look at the sample OSC agent that geert and jim added in 1.4 branch.

[edit] Oh nm, you already did. Saw your photo on twitter. Nice!


written by: dhjdhj

Sat, 19 Nov 2011 03:15:51 +0000 GMT

Well, I'm now getting the error

g++-4.0: installation problem, cannot exec '/usr/bin/i686-apple-darwin10-g++-4.0.1': No such file or directory

That message is correct --- that version of g++ is found in /Developer-old/usr/bin

I'm VERY skeptical about polluting /usr/bin with old stuff from /Developer-old/usr/bin

Is there an alternative approach?


written by: barnone

Sat, 19 Nov 2011 03:16:08 +0000 GMT

create a soft link from where it is expecting it to the Developer_old location


written by: dhjdhj

Sat, 19 Nov 2011 13:30:51 +0000 GMT

I appreciate the tip, barnone. However, if possible I really want to avoid creating symbolic links back into /usr/bin for the reasons above.

if I change the arguments for CXX and CC in darwin_tools.py to the new values below, compilation seems to proceed.

self.Replace(CXX='/Developer-old/usr/bin/i686-apple-darwin10-g++-4.0.1')
self.Replace(CC='/Developer-old/usr/bin/i686-apple-darwin10-gcc-4.0.1')

However, 100 files later, I'm getting errors in Juce. I think I have to go find the Steinberg VST SDK.

Well....at least I'm making progress :-)


written by: dhjdhj

Sat, 19 Nov 2011 13:54:34 +0000 GMT

Will I get bitten later if I just turn off JUCE_PLUGINHOST_VST in SConscript?

---update---
Looks like I actually need to turn off various values in Juce_AppConfig.h

and that seems to have done the trick --- compilation now continues, many hundreds more files getting compiled.


written by: dhjdhj

Sat, 19 Nov 2011 14:03:30 +0000 GMT

OK --- last thing I had to do was Chris's suggestion of defining PI_NOTAGS to something and I now seem to have a fully built system.

Will try it later today if I can and hopefully I can figure out how to get that OSC agent working


written by: dhjdhj

Wed, 7 Dec 2011 12:54:01 +0000 GMT

Not sure what's going on here. I had successfully built the previous version (Eigenlabs-EigenD-f7a8d53) and just pulled down the latest version (Eigenlabs-EigenD-774aeff) to try and build again to get the MIDI LED support.

However, after making the same changes to the files to allow building to work, I'm getting errors like the following when I build --- the question is why can't the build process find the standard include files....did something else get changed in this build?
(I am still able to rebuild the older version, by the way)


Thanks,
D


lib_alpha2/src/a2dump.cpp:24:20: error: unistd.h: No such file or directory
lib_alpha2/src/a2dump.cpp:30:18: error: cstdio: No such file or directory
lib_alpha2/src/a2dump.cpp:31:19: error: cstring: No such file or directory
lib_alpha2/src/a2dump.cpp:32:19: error: cstdlib: No such file or directory
..... many more


written by: dhjdhj

Wed, 7 Dec 2011 13:07:35 +0000 GMT

Never mind --- forgot to change /Developer to /Developer-old

(sigh)



Please log in to join the discussions