[C++-sig] Link trouble on OS X
Scott A. Smith
ssmith at magnet.fsu.edu
Thu May 23 15:21:35 CEST 2002
Hi Dave,
> > It is a problem with knowing where the libraries are. There was
> an
> >
> > export LD_LIBRARY_PATH
> >
> > command issued prior to the linking
> It gets set by the build command as it runs. If you're not seeing
> LD_LIBRAY_PATH=... on the immediately preceding line, it's getting set to
> something empty, which is probably a bug.
Correct, there is no line that sets LD_LIBRARY_PATH prior to the command
to export it. Do you know what it should be set to? If so, can set it
by hand and try things once more.
> > 3.) Using Fink Commander I installed (from sources) Python.
>
> What about CVS? I'd like to get the boost CVS state there.
Although I have not done this (opting for what I thought was a "safer"
route to getting Boost.Python running on OS X) but you can install CVS from
Fink Commander as well. Additionally, OS X has a terminal window (tsh) that
you can run unix commands in and you can install bash from F.C. too.
> There's absolutely no need for rebuilding Jam. All of the logic is
> happening in (interpreted) .jam files.
Point me to the one that sets things up for Boost.Python and I'll have
a look. The only thing I see is JamFile in libs/python/build.
> No, I'm saying that if you rebuild it under cygwin, the bjam executable
> won't work (for some reason). If you want to build cygwin versions of your
> other software, just use the prebuilt version of bjam you already
> have from your regular Windows command-shell.
I am using the prebuilt jam.
> > At the moment, I tried the pre-build jam but the build of Boost.Python
fails
> > because it never figures out where the Python includes are. It always
looks
> > in /usr/local/include regardless of what environment variables are set.
> I don't believe it. What environment variables are you setting?
> (Note that the pre-built bjam won't see any cygwin bash environment
> variables)
OK, then I must be doing something conceptually stupid. I am using the
pre-built bjam for Windows. I am working in a CygWin bash shell. When I have
bad or no environment variables set then running bjam just echoes a message
about how it cannot build Boost.Python with out them set. When I set them,
bjam attempts to build Boost.Python but cannot because it never sees the
Python includes. Here are the details:
I put Python 2.2.1 in C:\Program Files\Python22
I put Boost 1.28.0 in C:\Program Files\Boost\boost_1_28_0
I put the latest bjam in my path, C:\usr\local\bin
I opened a Cygwin bash shell and changed into directory
C:\Program Files\Boost\boost_1_28_0\libs\python\build
I set the environment variables from the bash shell this way
$ PYTHON_ROOT="C:\Program Files\Python22"
$ export PYTHON_ROOT
$ PYTHON_VERSION="2.2"
$ export PYTHON_VERSION
I can see these are set in the environment via the command "env"
I believe something is set for Jam since it tries to build Boost.Python
I run bjam with the following
bjam -sTOOLS=gcc -sBUILD=release
Here is part of the output from that
$ bjam -sTOOLS=gcc -sBUILD=release
...found 202 targets...
...updating 14 targets...
gcc-C++-action
..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\runt
ime-link-dynamic\types.obj
In file included from c:/Program
Files/Boost/boost_1_28_0/boost/python/errors.hpp:13,
from c:/Program
Files/Boost/boost_1_28_0/boost/python/detail/call_object.hpp:8,
from ../src\types.cpp:11:
c:/Program Files/Boost/boost_1_28_0/boost/python/detail/wrap_python.hpp:24:
patchlevel.h: No such file or directory
In file included from c:/Program
Files/Boost/boost_1_28_0/boost/python/errors.hpp:13,
from c:/Program
Files/Boost/boost_1_28_0/boost/python/detail/call_object.hpp:8,
from ../src\types.cpp:11:
c:/Program Files/Boost/boost_1_28_0/boost/python/detail/wrap_python.hpp:105:
Python.h: No such file or directory
In file included from c:/Program
Files/Boost/boost_1_28_0/boost/python/detail/cast.hpp:13,
from c:/Program
Files/Boost/boost_1_28_0/boost/python/detail/types.hpp:26,
from c:/Program
Files/Boost/boost_1_28_0/boost/python/detail/call_object.hpp:9,
from ../src\types.cpp:11:
.
.
.
Finally, here is why I mentioned /usr/local/include
g++ -c -Wall -ftemplate-depth-100 -DNDEBUG -DUSE_DL_IMPORT -DBOOST_PYTHON_
DYNAMIC_LIB -O3 -Wno-inline -fomit-frame-pointer -foptimize-sibling-calls
-I"..\..\..\libs\python\build" -I"." -I"c:\Program
Files\Boost\boost_1_28_0" -I"\usr\local\include\python2.2" -o
"..\..\..\libs\python\build\bin\boost_python.dll\gcc\release\inlining-on\run
time-link-dynamic\types.obj" "../src\types.cpp"
As you can see: -I"\usr\local\include\python2.2"
So, what in the above steps is wrong? Do I have to use CygWin's Python
rather
that that I downloaded? Do I need to use simpler install directories? Is it
true that the bash environment variables are not seen by Jam (It must see
something)?
I tried to alter the environment variables in case the space in "Program
Files" was
the problem, didn't work. I tried to move the Python directory to something
easy
(C:\Python22), didn't help. I tried copying the Python include directory to
/usr/local/inlcude
and that didn't work either.
My apologies for all the clutter, I'm sure you can help me overcome my
stupidiy.
Regards,
Scott
-----------------------------------------
-----------------------------------------
Dr. Scott A. Smith
Associate in Research
National High Magnetic Field Laboratory
1800 East Paul Dirac Drive
Tallahassee, FL 32310
phone: (850) 644-6348
FAX: (850) 644-1366
email: ssmith at magnet.fsu.edu
http://www.magnet.fsu.edu
http://gamma.magnet.fsu.edu
More information about the Cplusplus-sig
mailing list