Ticket #17405 (closed update: fixed)
different boost update
| Reported by: | andrew@… | Owned by: | sanchom@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.6.0 |
| Keywords: | Cc: | mcalhoun@… | |
| Port: | boost |
Attachments
Change History
comment:1 Changed 4 years ago by macsforever2000@…
- Owner changed from macports-tickets@… to sanchom@…
- Keywords boost removed
- Type changed from defect to enhancement
comment:3 Changed 4 years ago by andrew@…
Yay! Fun! The mpi module now loads if the python26 variant is used! I'm so happy I could just cry! :-) Not sure about 2.5, though... but here's to hoping...
comment:4 Changed 4 years ago by andrew@…
Updating the patch to 1.37 revision 2 to change the python mpi.so module. This puts it in
"${prefix}/Library/Frameworks/Python.framework/Versions/${pyversion}/lib/python${pyversion}/site-packages/boost/"
so it can be loaded with
import boost.mpi as mpi
in order to avoid namespace conflicts.
comment:5 Changed 4 years ago by andrew@…
Okay, okay - I'm really sorry to be constantly updating this - but I'm a python newbie and (sheepish grin) I forgot to add the init.py file.
Now the following program works without damn import errors:
#/usr/bin/env python2.6 import boost.mpi as mpi # OR 'from boost import mpi' (both work) print "I am process %d of %d." % (mpi.rank, mpi.size)
This is Revision 3. Sorry. I hope this is the last update.
comment:6 Changed 4 years ago by andrew@…
Even better - the whole boost-python interface appears to work.
Makefile :
YFRM = /opt/local/Library/Frameworks/Python.framework/Versions/2.6
PYINC = -I$(PYFRM)/include/python2.6 -L/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/config
MACPT = -I/opt/local/include -L/opt/local/lib
LIBS = -dynamiclib -lboost_python-xgcc40-mt -lpython2.6
hello.so : hello.cpp
$(CXX) $(MACPT) $(PYINC) $? $(LIBS) -o $@
.PHONY : test clean
test : test.py
./test.py
clean :
rm -f hello.so
hello.cpp :
char const* greet()
{
return "hello, world";
}
#include <boost/python.hpp>
BOOST_PYTHON_MODULE(hello)
{
using namespace boost::python;
def("greet", greet);
}
test.py :
#!/usr/bin/env python2.6
import sys
sys.path.append('.')
import hello
print hello.greet()
comment:9 Changed 4 years ago by sanchom@…
Agree. We should close this. If there are issues with the r43281, we should open new tickets to patch against that revision.
comment:10 Changed 4 years ago by mcalhoun@…
- Status changed from new to closed
- Resolution set to fixed
comment:12 Changed 4 years ago by anonymous
- Milestone Port Updates deleted
Milestone Port Updates deleted


Assigning to maintainer.