PDA

View Full Version : Compiling an app from Sourceforge




ThatSoundAgain
Jan 11, 2006, 03:09 PM
Hi,

I'm really interested in running this (http://sharp3d.sourceforge.net/mediawiki/index.php/Main_Page) app that I found on sourceforge. (source (http://sourceforge.net/projects/sharp3d)).

It says it's for "All POSIX (Linux/BSD/UNIX-like OSes)".

However, I lack the expertise to compile it. I've tried the instructions that comes with the source, but I get errors. Particularly "make install" gives me: "nothing to be done for install."

What does it require to compile such an app? Is there a guide somewhere to compiling and installing UNIX-like programs?

Thanks in advance!



mwpeters8182
Jan 11, 2006, 03:56 PM
Hi,

I'm really interested in running this (http://sharp3d.sourceforge.net/mediawiki/index.php/Main_Page) app that I found on sourceforge. (source (http://sourceforge.net/projects/sharp3d)).

It says it's for "All POSIX (Linux/BSD/UNIX-like OSes)".

However, I lack the expertise to compile it. I've tried the instructions that comes with the source, but I get errors. Particularly "make install" gives me: "nothing to be done for install."

What does it require to compile such an app? Is there a guide somewhere to compiling and installing UNIX-like programs?

Thanks in advance!

When you ran the configure script, did it give you any errors? the output from ./configure might be useful to see what's gone wrong.

caveman_uk
Jan 11, 2006, 04:07 PM
Just an aside (as you're interested in 3D stuff). Have you had a look at Blender (www.blender.org)? It's free, open-source and has a pre-built binary for Mac OS X.

AlmostThere
Jan 11, 2006, 04:17 PM
From the README:
Some notes on hardware:
* You need at least a semi-recent processor. Anything with SSE should be
fine; for example, a Pentium III.
Which very strongly suggests that need an Intel processor ... that new iMac arrived already?

Secondly, from having spent 15 minutes trying to compile this app, which does look quite cool, it seems that many of the dependencies have not yet been updated on fink (which I generally use for Unix libraries). There is a good chance there are a large number of libraries you need to compile in addition to this app alone (assuming the author has handled all SSE dependencies). I compiled a couple but they just keep coming.

I don't think this is an easy task to build on OS X and probably needs proper porting.

ThatSoundAgain
Jan 11, 2006, 05:06 PM
From the README:

Which very strongly suggests that need an Intel processor ... that new iMac arrived already?

No, I'm on a last-gen 15" G4 PB. I took that section of the readme as a recommendation for a bare minimum, as I don't see any assembly in the source code (and it's a linux app so the libraries should be obtainable).

I remember seeing the page a week ago, and that it said OS X under operating systems. I'm not completely sure I remember correctly, but if I do, maybe it tells us something that it was removed.


I don't think this is an easy task to build on OS X and probably needs proper porting.

I suspected that, but wanted to check with someone in the know. Thanks for the response.

Caveman_uk, yes, I was in fact hoping to use it in combination with Blender, which is a very cool app. Actually, I'm kind of the Mac rebel in my game art class, where we're currently doing a mod for Far Cry, mainly with 3DS Max and ZBrush on Windows. I want to learn something I can use on programs I can run (and own), which is why I'm looking for some of the functionalities of ZBrush. There's this script (http://www.elysiun.com/forum/viewtopic.php?t=56101) for Blender, but for really high-poly work you need a dedicated app. It's fun, though.

AlmostThere
Jan 11, 2006, 05:29 PM
It uses compiler intrinsics rather than assembly (in Optimised.cc/h) but hopefully the configure script will detect whether or not these are supported.

I assume you have the Developer Kit and X11 installed.

I checked on darwinports and they have a Mac version of GTK+ 2.8.x which was the first failed dependency I found. Darwinports will download, build and install that for you if you want to get started trying to build this (it will take some time though, more than I have right now...). Maybe they can meet the dependencies that fink doesn't.

ThatSoundAgain
Jan 11, 2006, 07:33 PM
It uses compiler intrinsics rather than assembly (in Optimised.cc/h) but hopefully the configure script will detect whether or not these are supported.


OK. I don't know much about it, but is this a way of doing cross-processor low level programming, or is it i386 specific?


I assume you have the Developer Kit and X11 installed.


Yes, I have both installed.


I checked on darwinports and they have a Mac version of GTK+ 2.8.x which was the first failed dependency I found. Darwinports will download, build and install that for you if you want to get started trying to build this (it will take some time though, more than I have right now...). Maybe they can meet the dependencies that fink doesn't.

My configure fails at pkg-config (see below). I have Darwinports and will look into it.

Actually, I'm such a newbie at the terminal / unixy side of things that the question I was trying to ask in the OP was this:


./configure
make
make install

Are the above the correct commands to compile and install a program from source?

When you ran the configure script, did it give you any errors? the output from ./configure might be useful to see what's gone wrong.

Apologies to the above poster, I overlooked your post when I first answered. Below is the point at which ./configure stops:


checking for pkg-config... no
*** The pkg-config script could not be found. Make sure it is
*** in your path, or set the PKG_CONFIG environment variable
*** to the full path to pkg-config.
*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.
configure: error: Library requirements (sigc++-2.0 >= 2.0.6) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.

AlmostThere
Jan 11, 2006, 08:23 PM
Compiler intrinsics are basically a way of calling specific assembly instructions through C code, with C-language variables. The GNU compiler uses them for altivec code and SSE instructions.

OK, for a message like the one below, you are missing a programme called pkgconfig (annoyingly not pkg-config) which creates the correct compiler flags and a library called libsigc++ (which it can't find either because you probably don't have it and it is expecting pkgconfig to tell it where it is).

This is where you want some UNIX package management system. Coming from Debian, I have always favoured fink but this does not have sufficiently up to date packages in this case. In which case you want to head over to darwinports.org and download and install their package.

Then open a console and type:

$sudo port install pkgconfig

which will download, build and install that package.


You might do well to read their documents, though as you will need to repeat this for each unmet dependency (feel free to post them here).

For libsigc++, a little more detail - search for libsigc++:

$port search sigc
libsigc++ devel/libsigc++ @1.2.7 C++ signal callback system
libsigc++1 devel/libsigc++1 @1.0.4 C++ callback system (version 1.0.x)
libsigc++2 devel/libsigc++2 @2.0.16 C++ signal callback system


revealing libsigc++2 version 2.0.16 which we can see from the message configure: error: Library requirements (sigc++-2.0 >= 2.0.6) not met; will satisfy the requirement.

Also : you are building version 0.11 aren't you (I downloaded 0.10 by accident).

AlmostThere
Jan 11, 2006, 08:34 PM
Oh, and yes you are doing the right thing.
./configure needs to create a Makefile before the next stages will run.

ThatSoundAgain
Jan 11, 2006, 08:41 PM
This is fun! I'm actually learning something. I figured out about the dependencies from your replies, and had gotten both pkgconfig and libsigc+ through darwinports before your reply. GTK seems to be a tough one to build, though - I'll look around for a binary instead.

I was actually building 0.10, because Sourceforge called it the latest stable release - but I guess "stable" is a bit much to ask from an alpha. So I'll download 0.11 and start over.

In any case I'll be sure to post my results here.

Thanks for taking the time to put me on the right track!

mwpeters8182
Jan 12, 2006, 12:00 AM
There should be a port for gtk in either darwinports or fink. That should make things easier.

MP

ThatSoundAgain
Jan 12, 2006, 10:37 AM
Yes, now I've gotten GTK and dependancies off Darwinports. The next problem is something called gtkglextmm, which is neither on Darwinports or Fink.

I've downloaded the source for that.


./configure
make
sudo make install


gives me what looks like a clean build and a directory that looks like the list in the bottom of my post. But SharpConstruct's configure still won't recognise it. Does "make install" build a file that I have to execute to install? I've tried bashing both "install-sh" and "setup-gtkglextmm.sh". The latter says it's missing an argument:


Usage: setup-gtkglextmm.sh <unpacked prefix dir>

Example: ./setup-gtkglextmm.sh c:/gtkglextmm


Can anyone see from this what I'm doing wrong?

Thanks in advance!


TSAs-powerbook58:~/documents/dl/gtkglextmm-1.1.0 sbn$ ls
AUTHORS
COPYING
COPYING.LIB
ChangeLog
ChangeLog.pre-1-0
INSTALL
Makefile
Makefile.am
Makefile.in
NEWS
README
README.win32
TODO
aclocal.m4
build_shared
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
configure.in
depcomp
docs
examples
gdkglext
gdkglextmm-1.2-uninstalled.pc
gdkglextmm-1.2.pc
gdkglextmm-uninstalled.pc
gdkglextmm-uninstalled.pc.in
gdkglextmm-x11-1.2-uninstalled.pc
gdkglextmm-x11-1.2.pc
gdkglextmm.pc
gdkglextmm.pc.in
gtkglext
gtkglextmm-1.2-uninstalled.pc
gtkglextmm-1.2.pc
gtkglextmm-uninstalled.pc
gtkglextmm-uninstalled.pc.in
gtkglextmm-x11-1.2-uninstalled.pc
gtkglextmm-x11-1.2.pc
gtkglextmm.nsi
gtkglextmm.nsi.in
gtkglextmm.pc
gtkglextmm.pc.in
gtkglextmm.spec
gtkglextmm.spec.in
install-sh
libtool
ltmain.sh
m4macros
missing
mkinstalldirs
setup-gtkglextmm.sh
stamp-h1
tools

AlmostThere
Jan 12, 2006, 11:35 AM
Can you post the last few lines from the output from the Sharp configure script that show the error?

make install is the installation process - you should have seen lots of installation lines flying past the screen after running it - but it might have installed it somewhere the Sharp configure script doesn't know about (probably /usr/local if you have built from source rather than a package).

ThatSoundAgain
Jan 12, 2006, 11:47 AM
Can you post the last few lines from the output from the Sharp configure script that show the error?


Sure:


checking for gtkglextmm... configure: error: Package requirements (gtkglextmm-1.2 >= 1.0.0) were not met.
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively you may set the gtkglextmm_CFLAGS and gtkglextmm_LIBS environment variables
to avoid the need to call pkg-config. See the pkg-config man page for
more details.


I've been looking at the pkg-config man page, but don't know what to make of it. Environment variables and CFLAGS are new concepts to me - i wouldn't know how to set them.

Once again thanks for taking the time to help me, AlmostThere. It's especially rewarding to have my very basic (dumb) questions answered, so I not only make progress with the actual build, but get to understand the commands and the logic behind it a little better, as well.

AlmostThere
Jan 12, 2006, 12:25 PM
No worries, takes me back to what Linux used to be like a good few years ago. Things like fink (and the Linux equivalents) are god sends for sorting out this sort of dependency nightmare ... I remember using gtkglextmm a few years ago, too.

There are several options:
Possibly the easiest is to check that gtkglextmm is actually installed. At the command line, try

$find /opt -name '*.pc'
$find /usr -name '*.pc'

Hopefully it will identify gtkglextmm.pc probably in /usr/local/somewhere, in which case you might need to type

$export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/the/path/to/the/pcfile/


which should enable the pkgconfig programme to identify the path to the configuation file (that's gtkglextmm.pc). Don't include the actual file in the path above.

Alternatively, you could try rebuilding gtkglextmmm but at the start specify

./configure --prefix=/opt

which will then install gtkglextmm into the darwinports directory.

Short explanation
The reason for all this is that pkgconfig is basically a programme that reads configuration files and tells the build process where all the dependencies -libraries and such like - are.

I don't know what the default search paths (i.e. where it expects the configuation files to be) for pkgconfig are, the man page says that this is tied to the configure --prefix option when it was built, which means it is probably only looking in /opt/lib/pkgconfig (darwinports installs everything into /opt so I assume software is compiled with that option).

Setting the environment variable PKG_CONFIG_PATH should customise this path, but it might be a good idea to install all your Unix stuff into the same directory.

I hope it actually works in the end ... and you haven't changed your mind about the fun bit you mentioned earlier. Hey, at least it is educational if you ever want to learn about programming or fancy becoming a Unix system admin!

ThatSoundAgain
Jan 12, 2006, 03:52 PM
Yes!

After looking around for gtkglextmm.pc (partly using the finder, i admit), I found it in /opt/lib/pkgconfig/ , so setting the environment variable worked. There's another pkgconfig dir in /opt/local/lib/ where all the other stuff from Darwinports is installed. Can't really explain how the other directory got there.

The good news is that ./configure got done all the way through - the bad news is that now I get compiler errors when i try to make. Specifically, a boatload from optimized.h, and then this:

Brush.cc: In member function 'unsigned int SharpConstruct::Brush::Radius() const':
Brush.cc:128: warning: converting to 'unsigned int' from 'float'
make[1]: *** [Brush.o] Error 1
make: *** [all-recursive] Error 1


Oh well, it was worth a shot. As you said, this program probably needs proper porting.

I hope it actually works in the end ... and you haven't changed your mind about the fun bit you mentioned earlier. Hey, at least it is educational if you ever want to learn about programming or fancy becoming a Unix system admin!

Actually, I've dabbled a bit in programming but never the terminal before. All the OSS software I use makes me wish I knew enough to start contributing - at least with portfiles for Darwinports and other small bits.

Maybe one day I'll know enough to do more than rescuing people's data off their virus-infested harddrives.

Again, thanks for all the help!

ThatSoundAgain
Jan 12, 2006, 03:57 PM
Oh, by the way, the dependencies were a grand total of:

- pkg-config
- gtk2
- libglademm

- gtkglextmm

The first three were on Darwinports, the last you know about. Especially gtk2 took a couple of hours by itself, it had lots of dependencies in turn.