Compiling in OpenSolaris

Asked by James Shaw on 2010-05-12

I'm trying to install LinuxDC++ latest (1.0.3) on the latest Opensolaris and am getting this error.
I've been following this guide http://openfacts.berlios.de/index-en.phtml?title=Ldcpp_Manual

"pfexec scons
scons: Reading SConscript files ...

scons: warning: The Options class is deprecated; use the Variables class instead.
File "/home/taemun/linuxdcpp-1.0.2/SConstruct", line 50, in <module>

scons: warning: The BoolOption() function is deprecated; use the BoolVariable() function instead.
File "/home/taemun/linuxdcpp-1.0.2/SConstruct", line 53, in <module>

scons: warning: The PathOption() function is deprecated; use the PathVariable() function instead.
File "/home/taemun/linuxdcpp-1.0.2/SConstruct", line 56, in <module>
Checking for g++ >= 3.4...(cached) yes
Checking for pkg-config... (cached) yes
Checking for gtk+-2.0 >= 2.8... (cached) yes
Checking for gthread-2.0 >= 2.4... (cached) yes
Checking for libglade-2.0 >= 2.4... (cached) yes
Checking for C header file time.h... (cached) yes
Checking for C header file signal.h... (cached) yes
Checking for C header file unistd.h... (cached) yes
Checking for C library pthread... (cached) yes
Checking for C library z... (cached) yes
Checking for C library bz2... (cached) yes
Checking for C library crypto... (cached) yes
Checking for C library ssl... (cached) yes
Checking for C header file iconv.h... (cached) yes
Checking for iconv(0, (const char **)0, 0, (char**)0, 0) in C library iconv... (cached) no

scons: warning: The env.Copy() method is deprecated; use the env.Clone() method instead.
File "/home/taemun/linuxdcpp-1.0.2/linux/SConstruct", line 27, in <module>
scons: done reading SConscript files.
scons: Building targets ...
g++ -o build/client/HashManager.o -c -I. -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_DATADIR='"/usr/local/share"' -R/usr/lib -R/lib client/HashManager.cpp
client/HashManager.cpp: In member function `bool HashManager::Hasher::fastHash(const std::string&, uint8_t*, TigerTree&, int64_t, CRC32Filter*)':
client/HashManager.cpp:612: error: `madvise' undeclared (first use this function)
client/HashManager.cpp:612: error: (Each undeclared identifier is reported only once for each function it appears in.)
scons: *** [build/client/HashManager.o] Error 1
scons: building terminated because of errors."

Question information

Language:
English Edit question
Status:
Solved
For:
LinuxDC++ Edit question
Assignee:
No assignee Edit question
Solved by:
James Shaw
Solved:
2010-07-01
Last query:
2010-07-01
Last reply:
2010-05-14
Razzloss (razzloss) said : #1

Latest commit fixed that and few other problems in building with OpenSolaris. You have two options, either get the latest branch (install bazaar and grab the branch with bzr branch https://launchpad.net/linuxdcpp/trunk linuxdcpp and then follow the same instructions as for 1.0.3, except you'll need to install boost libraries if you don't have them installed already) or you can use this patch with 1.0.3 http://pastebin.ca/1871918 . Should apply with patch -p1 < filenameyousavedwith (in linuxdcpp source directory) but I haven't tested this. That patch is from the guy who sent the fixes for the latest trunk version also.

--RZ

James Shaw (thebeastmyster) said : #2

Thanks for the quick reply and sorry for being such a n00b.

I tried installing bazaar so I got the latest version of it and the gtk GUI. but as it turns out they don't play nice. I need to know how to uninstall the 2.2b and then reinstall the 2.1.0 (I guess) then the gtk again...wow this is getting confusing. Someone told me that the boost libraries are already integrated into the latest OpenSolaris but I'm not sure about that...

How do you even use launchpad to find documentation. I keep going around in circles an all I want to find is some nice:
"This is what this program does" and a more than man or --help explanation.

I'm sorry I'm really new at all this.

Steven Sheehy (steven-sheehy) said : #3

Launchpad is just a project hosting site, it doesn't really have documentation on anything (except for Launchpad itself).

Sorry, I don't really know how to use OpenSolaris. Your best bet is to probably find the OpenSolaris IRC chat room and ask the experts there.

James Shaw (thebeastmyster) said : #4

@Razzloss
I'm finding it really difficult to get bzr working under OpenSolaris. So I'm trying to go for the second option which is the patch, however the link you gave me http://pastebin.ca/1871918 doesn't appear to be working. I'm inside a fairly tight proxy window, so if you could give me another that would be good.
Also I'm not sure what you mean when you say "Should apply with patch -p1 < filenameyousavedwith".
my linuxdcpp-1.0.3 folder has build (because of scons?), client, glade, linux, pixmap, SConstruct in it, just tell me where to put the patch and I'll do that and scons again.

Also scons doesn't appear to be persistent. I have to run these commands http://ultravioletos.blogspot.com/2008/10/installing-scons-101-on-solaris-sxce.html every time in a new session. If anyone knows anything about that would be great.

@Steven Sheehy
I don't understand about the 'no documentation' thing. I mean surely bazaar has a build and usage/command guide somewhere?

James Shaw (thebeastmyster) said : #5

Ok I think I have the right branch and my problem is
"scons
scons: Reading SConscript files ...
Checking for g++ >= 4.1...(cached) no
Compiler version check failed. g++ 4.1 or later is needed"

the problem now is that there isn't a gcc package later than 4.1 available for OpenSolaris yet...

Steven Sheehy (steven-sheehy) said : #6

Oh, you meant wanted documentation on bazaar, not Launchpad. Bazaar has a separate website where you can find documentation: http://doc.bazaar.canonical.com/bzr.2.1/en/

I'm surprised OpenSolaris doesn't have at least g++ 4.1 available. It's over four years old now. You might try http://www.opencsw.org.

Razzloss (razzloss) said : #7

I asked the creator of that patch about gcc he used to build this on OpenSolaris and heres the response:

08:11:15 < DerSaidin> oh right, comments
08:12:43 < DerSaidin> pkg:/developer/gcc/gcc-43@4.3.3-0.133
08:14:18 < DerSaidin> its in /dev repository
08:14:28 < DerSaidin> which pretty much everyone uses
08:15:38 < DerSaidin> well, maybe not
08:20:23 < DerSaidin> http://www.dersaidin.net/other/linuxdcpp1.0.3_osol.diff
08:20:26 < DerSaidin> so theres the patch
08:21:13 < DerSaidin> To switch to the /dev repository (OpenSolaris development releases, see the IPS version in /topic): pfexec pkg
                      set-publisher -O http://pkg.opensolaris.org/dev opensolaris.org && pfexec pkg install SUNWipkg && pfexec pkg
                      image-update -v # Then wait. You *must* read the release notes before starting out or you *will* be unhappy.
                      See also: ips mirrors
08:21:27 < DerSaidin> then pkg install pkg:/developer/gcc/gcc-43@4.3.3-0.133
08:21:56 < DerSaidin> that verson of GCC probably won't be in the path, so set it before running scons

He also offered to help you if you come to the IRC channel #linuxdc++ at irc.freenode.org .

--RZ

James Shaw (thebeastmyster) said : #8

just thought I'd give an update: Finally got it working after some time

the basic steps were

get scons
get bzr
branch linuxdcpp trunk with bzr
make sure gcc43 is installed (pkg install ~) (it is critical you have build 134+ of open solaris to get this working)
export PATH="/usr/gcc/4.3/bin/:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin"
get boost libraries
unpack to somewhere
export CXXFLAGS=-I/tank/temp/boost_1_43_0
pkg install x11/header x11/header/header-xorg
build

done working
Thanks for the help, but basically it was down to OpenSolaris not having the latest g++ verion