build mod_wsgi on solaris

169 views
Skip to first unread message

michael

unread,
Mar 3, 2009, 1:19:51 PM3/3/09
to modwsgi
hello,

I will publish my mercurial-repositories with apache 2.2 at my Open
Solaris-Box (Build 108) I found a tutorial at
http://www.selenic.com/mercurial/wiki/index.cgi/modwsgi

my machine:
root@trantor mod_wsgi-2.3 $ uname -a
SunOS trantor 5.11 snv_108 i86pc i386 i86pc


If I will build this module I get errors:

root@trantor mod_wsgi-2.3 $ ./configure
checking for apxs2... no
checking for apxs... /usr/bin/apxs
checking Apache version... 2.2.11
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile
root@trantor mod_wsgi-2.3 $ make
/usr/bin/apxs -c -I/usr/include/python2.4 -DNDEBUG mod_wsgi.c -L/usr/
lib/python2.4/config -lpython2.4 -lsocket -lnsl -ldl
/usr/apr/1.3/build/libtool --silent --mode=compile /opt/SUNWspro/bin/
cc -prefer-pic -xO3 -m32 -xchip=pentium -xspace -Xa -xildoff -xc99=all
-DSSL_EXPERIMENTAL -DSSL_ENGINE -xO4 -DSOLARIS2=11 -
D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT -mt -D_LARGEFILE_SOURCE -
D_FILE_OFFSET_BITS=64
-I/usr/apache2/2.2/include -I/usr/apr/1.3/include -I/usr/apr-util/
1.3/include -I/usr/include/python2.4 -DNDEBUG -c -o mod_wsgi.lo
mod_wsgi.c &&
touch mod_wsgi.slo
env: No such file or directory
apxs:Error: Command failed with rc=65536
.
*** Error code 1
make: Fatal error: Command failed for target `mod_wsgi.la'
root@trantor mod_wsgi-2.3 $

I think the environment is wrong and some shell-variables are missing.
Has anyone an idea to solve this problem/build the module

cheers
Michael

Graham Dumpleton

unread,
Mar 3, 2009, 6:47:18 PM3/3/09
to mod...@googlegroups.com
2009/3/4 michael <michael....@sun.com>:

Looks to be an issue with your Apache apxs installation rather than mod_wsgi.

I'll think about it, but not sure right now what to suggest as apxs is
a horrible perl script.

What do you get if you run:

/usr/bin/apxs -q CFLAGS

Ie., does it even run properly.

Also, do you have Sun C compiler installed. Your apxs is set up to
require it. Can't have just gcc.

Graham

michael

unread,
Mar 4, 2009, 1:48:12 AM3/4/09
to modwsgi
Hello,

root@trantor mod_wsgi-2.3 $ /usr/bin/apxs -q CFLAGS
-xO3 -m32 -xchip=pentium -xspace -Xa -xildoff -xc99=all -
DSSL_EXPERIMENTAL -DSSL_ENGINE -xO4

I have also the gcc 3.4.3 in my path
root@trantor mod_wsgi-2.3 $ gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs
Configured with: /builds2/sfwnv-gate/usr/src/cmd/gcc/gcc-3.4.3/
configure --prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as --
with-ld=/usr/ccs/bin/ld --without-gnu-ld --enable-languages=c,c+
+,f77,objc --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-20050802)

root@trantor mod_wsgi-2.3 $ /usr/bin/apxs -q CC
/opt/SUNWspro/bin/cc

The apache ist installed by the packageing-system. It is my first
apache_module, that I will build... Can I overwrite the CC and CFLAGS-
variables in the make-file? Then I can use the gnu compiler.

cheers
Michael

Graham Dumpleton

unread,
Mar 4, 2009, 1:56:15 AM3/4/09
to mod...@googlegroups.com
2009/3/4 michael <michael....@sun.com>:

If you truly don't have /opt/SUNWspro/bin/cc available, it isn't as
simple as changing stuff in mod_wsgi Makefile. This is because all the
compiler information specific to Sun C compiler is defined within apxs
configuration.

I have had to do it before, so can work, but necessary to copy apxs
script as well as the directory where its configuration is. Then
modify your apxs copy to point at your copy of the configuration. Then
hack on the copy of the configuration to change it to use gcc and
replace any Sun C specific compiler options with gcc equivalents.

I have to run out the door right now, but when get a chance I'll try
and explain the actual changes you need to make.

Graham

BraneSKS

unread,
Mar 4, 2009, 2:22:44 AM3/4/09
to mod...@googlegroups.com
I ran into similar problems on my OpenSolaris install. If you
installed everything else through PKG then what I would do is:

1. Uninstall Apache and everything else associated with it.
2. Uninstall Sun Studio 12

3. Reinstall amp-dev
4. Reinstall Sun Studio 12

5. Try to compile again.

Link to what I did: http://branesks.blogspot.com/2009/01/installing-modwsgi-on-opensolaris.html

Chris Miles

unread,
Mar 4, 2009, 2:49:50 AM3/4/09
to mod...@googlegroups.com, Chris Miles
I recently installed mod_wsgi on OpenSolaris 2008.11 for the Sun-
supplied Apache 2.2 and didn't have to jump through any hoops.

My quick summary would be:

Install Apache 2.2 if it isn't there already (check existence of /usr/
apache2/2.2/):
$ pfexec pkg install SUNWapch22

Install Sun Studio Express with:
$ pfexec pkg install sunstudioexpress

(note that it is larger than normal packages, about 660MB).

It installs /usr/bin/cc so I had to actually make my own symlink for /
opt/SUNWspro/bin/cc
$ pfexec ln -s /usr/bin/cc /opt/SUNWspro/bin/cc

Then build mod_wsgi.

Note that I didn't bother installing amp or amp-dev.

If you really don't want Sun Studio for some reason (besides the
sizeable download, I see no reason not to have it) then I'd suggest
uninstalling SUNWapch22 and build Apache yourself using gcc.

Hope that helps.

Cheers,
Chris Miles
Reply all
Reply to author
Forward
0 new messages