LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   help building mod_python in freebsd, error: cannot find -lpython2.6 (http://www.linuxquestions.org/questions/%2Absd-17/help-building-mod_python-in-freebsd-error-cannot-find-lpython2-6-a-719345/)

hedpe 04-15-2009 01:52 PM

help building mod_python in freebsd, error: cannot find -lpython2.6
 
Hi all, I am trying to build mod_python via "portinstall mod_python" but I keep getting the error: "cannot find -lpython2.6"

I have libpython2.6.so:
Code:

lrwxr-xr-x  1 root  wheel  17 Apr 15 13:17 /usr/local/lib/libpython2.6.so -> libpython2.6.so.1
Code:

--->  Upgrading 'mod_python-3.3.1' to 'mod_python-3.3.1_2' (www/mod_python3)
--->  Building '/usr/ports/www/mod_python3'
===>  Cleaning for mod_python-3.3.1_2

===>  Vulnerability check disabled, database not found

===>  Extracting for mod_python-3.3.1_2

=> MD5 Checksum OK for mod_python-3.3.1.tgz.

=> SHA256 Checksum OK for mod_python-3.3.1.tgz.

===>  Patching for mod_python-3.3.1_2

===>  Applying FreeBSD patches for mod_python-3.3.1_2

===>  mod_python-3.3.1_2 depends on file: /usr/local/bin/python2.6 - found

===>  mod_python-3.3.1_2 depends on file: /usr/local/sbin/apxs - found

===>  Configuring for mod_python-3.3.1_2

checking for gcc... cc

checking for C compiler default output file name... a.out

checking whether the C compiler works... yes

checking whether we are cross compiling... no

checking for suffix of executables...

checking for suffix of object files... o

checking whether we are using the GNU C compiler... yes

checking whether cc accepts -g... yes

checking for cc option to accept ANSI C... none needed

checking for ar... ar

checking for a BSD-compatible install... /usr/bin/install -c -o root -g wheel

checking whether make sets $(MAKE)... yes

checking for main in -lm... yes

checking for an ANSI C-conforming const... yes

checking your blood pressure... a bit high, but we can proceed

configure: checking whether apxs is available...

checking for --with-apxs... /usr/local/sbin/apxs executable, good

checking Apache version... 2.2.11

checking for Apache libexec directory... /usr/local/libexec/apache22

checking for Apache include directory... -I/usr/local/include/apache22

checking for --with-python... /usr/local/bin/python2.6

checking Python version... 2.6

checking Python install prefix... /usr/local

checking checking where python libraries are installed... /usr/local/lib/python2.6

checking for Py_NewInterpreter in -lpython2.6... yes

checking what libraries Python was linked with... -lpython2.6 -lpython2.6 -lutil -lm -lthr           

checking linker flags used to link Python...

checking where Python include files are... -I/usr/local/include/python2.6

checking for --with-python-src... no

checking for --with-mutex-dir... no

Using MUTEX_DIR /tmp

checking for --with-max-locks... no

Using 8 MAX_LOCKS.

checking for --with-flex... no

configure: WARNING: flex no not found

  You can generally ignore this warning unless you need to regenerate

  psp_parser.c from psp_parse.l.  If you do need regenerate psp_parser.c,

  use --with-flex to specify the location of flex.

  See the README for more information.

configure: creating ./config.status

config.status: creating Makefile

config.status: creating src/Makefile

config.status: creating Doc/Makefile

config.status: creating src/include/mod_python.h

config.status: creating test/Makefile

config.status: creating test/testconf.py

config.status: creating dist/setup.py

config.status: creating dist/Makefile

===>  Building for mod_python-3.3.1_2



Compiling for DSO.



/usr/local/sbin/apxs -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6 -c mod_python.c _apachemodule.c requestobject.c tableobject.c util.c  serverobject.c connobject.c filterobject.c hlist.c  hlistobject.c finfoobject.c -L/usr/local/lib/python2.6/config  -Wl,--export-dynamic -lm  -lpython2.6 -lpython2.6 -lutil -lm -lthr

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o mod_python.lo mod_python.c && touch mod_python.slo

mod_python.c: In function 'python_init':

mod_python.c:826: warning: initialization from incompatible pointer type

mod_python.c: In function 'get_interpreter':

mod_python.c:290: warning: passing argument 1 of 'make_obcallback' discards qualifiers from pointer target type

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o _apachemodule.lo _apachemodule.c && touch _apachemodule.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o requestobject.lo requestobject.c && touch requestobject.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o tableobject.lo tableobject.c && touch tableobject.slo

tableobject.c:329: warning: initialization from incompatible pointer type

tableobject.c:1092: warning: initialization from incompatible pointer type

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o util.lo util.c && touch util.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o serverobject.lo serverobject.c && touch serverobject.slo

serverobject.c:387: warning: initialization from incompatible pointer type

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o connobject.lo connobject.c && touch connobject.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o filterobject.lo filterobject.c && touch filterobject.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o hlist.lo hlist.c && touch hlist.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o hlistobject.lo hlistobject.c && touch hlistobject.slo

/usr/local/build-1/libtool --silent --mode=compile cc -prefer-pic -O -pipe -march=athlon64 -I/usr/include  -I/usr/local/include -I/usr/local/include/apache22  -I/usr/local/include/apr-1  -I/usr/local/include/apr-1 -I/usr/local/include -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/apache22 -I/usr/local/include/python2.6  -c -o finfoobject.lo finfoobject.c && touch finfoobject.slo

finfoobject.c:278: warning: 'intargfunc' is deprecated

finfoobject.c:278: warning: initialization from incompatible pointer type

/usr/local/build-1/libtool --silent --mode=link cc -o mod_python.la  -rpath /usr/local/libexec/apache22 -module -avoid-version    finfoobject.lo hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_python.lo -L/usr/local/lib/python2.6/config -Wl,--export-dynamic -lm -lpython2.6 -lpython2.6 -lutil -lm -lthr

ln -s ../lib/python/mod_python mod_python

ln -s ../src src

`psp_parser.c' is up to date.

/usr/local/bin/python2.6 setup.py build

running build

running build_py

creating build

creating build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6

creating build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/testhandler.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/Cookie.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/publisher.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/__init__.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/util.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/cgihandler.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/apache.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/importer.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/psp.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/Session.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/cache.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

copying /usr/ports/www/mod_python3/work/mod_python-3.3.1/lib/python/mod_python/python22.py -> build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python

running build_ext

building 'mod_python._psp' extension

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1

creating build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src

cc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O -pipe -march=athlon64 -fPIC -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/python2.6 -c /usr/ports/www/mod_python3/work/mod_python-3.3.1/src/psp_string.c -o build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/psp_string.o

cc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O -pipe -march=athlon64 -fPIC -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/python2.6 -c /usr/ports/www/mod_python3/work/mod_python-3.3.1/src/psp_parser.c -o build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/psp_parser.o

psp_parser.c:1436: warning: 'yyunput' defined but not used

cc -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -O -pipe -march=athlon64 -fPIC -I/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/include -I/usr/local/include/python2.6 -c /usr/ports/www/mod_python3/work/mod_python-3.3.1/src/_pspmodule.c -o build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/_pspmodule.o

/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/_pspmodule.c:32: warning: 'yy_init_globals' defined but not used

gcc -shared -O -pipe -march=athlon64 build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/psp_string.o build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/psp_parser.o build/temp.freebsd-7.0-RELEASE-p3-amd64-2.6/usr/ports/www/mod_python3/work/mod_python-3.3.1/src/_pspmodule.o -lpython2.6 -o build/lib.freebsd-7.0-RELEASE-p3-amd64-2.6/mod_python/_psp.so

/usr/bin/ld: cannot find -lpython2.6

error: command 'gcc' failed with exit status 1

*** Error code 1



Stop in /usr/ports/www/mod_python3/work/mod_python-3.3.1/dist.

*** Error code 1



Stop in /usr/ports/www/mod_python3/work/mod_python-3.3.1.

*** Error code 1



Stop in /usr/ports/www/mod_python3.

** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portinstall.45460.0 env UPGRADE_TOOL=portupgrade UPGRADE_PORT=mod_python-3.3.1 UPGRADE_PORT_VER=3.3.1 make FETCH_BEFORE_ARGS=-q
** Fix the problem and try again.
** Listing the failed packages (*:skipped / !:failed)
        ! www/mod_python3 (mod_python-3.3.1)        (new compiler error)
--->  Packages processed: 0 done, 0 ignored, 0 skipped and 1 failed


kentyler 04-16-2009 09:01 AM

It looks like your /usr/local/lib is not in the ld.so.conf or library path. If you add it then the linker should find it after running ldconfig -v.

You could copy the library to /usr/lib also and do ldconfig -v

The scripts can find it because they look everyplace by default, the linker can't because it looks in place that are defined in the config.


All times are GMT -5. The time now is 11:34 PM.