Opened 7 years ago
Closed 7 years ago
#55748 closed defect (fixed)
rsgislib @2.1.20140825_3: build failure, update problems with Boost
Reported by: | ForTozs | Owned by: | Veence (Vincent) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.4.2 |
Keywords: | haspatch | Cc: | ryandesign (Ryan Carsten Schmidt) |
Port: | rsgislib |
Description
I just wanted to report that rsgislib currently fails to build. I'm probably wasting space here, but this was the error:
:info:build [ 17%] Building CXX object src/CMakeFiles/rsgis_utils.dir/utils/RSGISPlotPolygonsCSVParse.cpp.o :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_rsgislib/rsgislib/work/9135d61/src && /usr/bin/clang++ -Drsgis_utils_EXPORTS -I/opt/local -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_rsgislib/rsgislib/work/9135d61/src -pipe -Os -stdlib=libc++ -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wredundant-decls -Wno-long-long -DNDEBUG -arch x86_64 -mmacosx-version-min=10.13 -fPIC -o CMakeFiles/rsgis_utils.dir/utils/RSGISPlotPolygonsCSVParse.cpp.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_rsgislib/rsgislib/work/9135d61/src/utils/RSGISPlotPolygonsCSVParse.cpp :info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_rsgislib/rsgislib/work/9135d61/src/utils/RSGISGEOSFactoryGenerator.cpp:34:27: error: calling a protected constructor of class 'geos::geom::GeometryFactory' :info:build this->geomFactory = new geos::geom::GeometryFactory(this->pm); :info:build ^ :info:build /opt/local/include/geos/geom/GeometryFactory.h:453:2: note: declared protected here :info:build GeometryFactory(const PrecisionModel *pm); :info:build ^ :info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gis_rsgislib/rsgislib/work/9135d61/src/utils/RSGISGEOSFactoryGenerator.cpp:59:10: error: calling a protected destructor of class 'geos::geom::GeometryFactory' :info:build delete geomFactory; :info:build ^ :info:build /opt/local/include/geos/geom/GeometryFactory.h:474:10: note: declared protected here :info:build virtual ~GeometryFactory();
I'm trying to be more self-sufficient on MacPorts, so I tried to make my own patch. I directed the port to rsgislib version 3.4.9. With this I seem to be encountering some kind of problem with Boost, which seems to be a common problem recently, but I'm not sure how to fix the problem. My build failure happens at the very end (100%) and looks like this:
RSGISCmdHistoCube.cpp.o -Wl,-rpath,/opt/local/var/macports/build/_opt_local_var_macports_sources _rsync.macports.org_release_tarballs_ports_gis_rsgislib/rsgislib/work/rsgislib-3.4.9/src librsgis_calib.1.1.0.dylib librsgis_classify.1.1.0.dylib librsgis_filter.1.0.0.dylib librsgis_modeling.1.1.0.dylib librsgis_radar.1.1.1.dylib librsgis_registration.1.2.0.dylib librsgis_segmentation.1.0.0.dylib librsgis_histocube.1.0.0.dylib -L/opt/local - lboost_filesystem-mt -lboost_system-mt -lboost_date_time-mt -L/opt/local -lgdal -L/opt/local -lgsl -lgslcblas - L/opt/local -lCGAL -L/opt/local -lgeos -L/opt/local -lmuparser -L/opt/local -lhdf5 -lhdf5_hl -lhdf5_cpp -L/opt/local - lgmp -L/opt/local -lmpfr -L/opt/local -lkea -L/opt/local -lboost_filesystem-mt -lboost_system-mt -lboost_date_time-mt librsgis_vec.2.2.0.dylib librsgis_rastergis.2.0.0.dylib librsgis_img.3.0.0.dylib librsgis_geom.1.1.0.dylib librsgis_utils.1.1.0.dylib librsgis_maths.1.1.0.dylib librsgis_datastruct.1.1.0.dylib librsgis_commons.1.3.0.dylib -lgsl - lgslcblas -lCGAL -lgeos -lmuparser -lkea -lxerces-c -L/opt/local -lboost_filesystem-mt -lboost_system-mt - lboost_date_time-mt -lgdal -lhdf5 -lhdf5_hl -lhdf5_cpp -lgmp -lmpfr :info:build Undefined symbols for architecture x86_64: :info:build "boost::gregorian::greg_month::get_month_map_ptr()", referenced from: :info:build unsigned short boost::date_time::month_str_to_ushort<boost::gregorian::greg_month> (std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in RSGISCmdHistoCube.cpp.o :info:build ld: symbol(s) not found for architecture x86_64
I am not able to figure what is wrong here. It seems to be calling -lboost_date_time-mt, but is unable to link. This would be a great port to have up again, as py6S depends on it. It would also be valuable to me to see how this port is fixed. Thanks.
Attachments (2)
Change History (12)
Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | Portfile-rsgislib.diff added |
---|
Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | patch-CMakeLists.txt.diff added |
---|
comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Cc: | ryandesign added; Veence removed |
---|---|
Keywords: | haspatch added |
Owner: | set to Veence |
Status: | new → assigned |
Summary: | rsgislib +python27 2.1.20140825_3: build failure, update problems with Boost → rsgislib @2.1.20140825_3: build failure, update problems with Boost |
comment:2 Changed 7 years ago by ForTozs
Thanks so much Ryan. It is extremely helpful to see what you did. Hopefully, I can do a better job fixing similar issues in the future and help give back to the community. Unfortunately, I am getting the same error (the second one) after cleaning and patching. This is helpful though. At least now I know it is likely specific to my system.
comment:3 Changed 7 years ago by ForTozs
I managed to get it installed. Turns out my boost had the +gcc7 variant. I'm not sure if this is automatically selected when I have gcc7 selected with gcc_select, or if I had overlooked rebuilding with the default compiler. Setting:
sudo port select gcc mp-gcc5
and rebuilding boost/cgal/rsgislib fixed my issue. Thanks again.
EDIT: rsgislib will build fine with gcc set to gcc7, it just wouldn't build with the boost +gcc7 variant.
comment:4 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Boost's gcc variants cause problems and need to be removed; see #55604.
comment:5 follow-up: 9 Changed 7 years ago by Veence (Vincent)
I’m also bumping python variants to 35 and 36
comment:6 Changed 7 years ago by ForTozs
Although it is installing fine, I'm not sure rsgislib is installing properly. If I call:
import rsgislib.imagecalc
I get:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rsgislib/imagecalc/__init__.py", line 6, in <module> from ._imagecalc import * ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rsgislib/imagecalc/_imagecalc.cpython-35m-darwin.so, \ 2): Library not loaded: @rpath/librsgis_cmds.1.1.0.dylib Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rsgislib/imagecalc/_imagecalc.cpython-35m-darwin.so Reason: image not found
I've tested on both Python 2.7 and 3.5, and I get the same result from both.
comment:7 Changed 7 years ago by ForTozs
I'm new to all this, but I might have had a little luck (well, and Google). I am able to make the import after issuing the command:
sudo install_name_tool -add_rpath "/opt/local/lib" /opt/local/Library/Frameworks/ Python.framework/Versions/3.5/lib/python3.5/site-packages/rsgislib/imagecalc/ _imagecalc.cpython-35m-darwin.so
Now, this is likely not be the preferred way, but I imagine I may be able to execute this with my Portfile by using:
destroot { system "install_name_tool -add_rpath "/opt/local/lib" /opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/rsgislib/imagecalc/_imagecalc.cpython-35m-darwin.so" }
It is getting late over here and I won't be going any further tonight, but there are quite possibly many other rsgislib libraries that need to be linked properly. If anyone knows the best way to do this, please let me know.
comment:8 Changed 7 years ago by Veence (Vincent)
Ok, you’re right, it fails on my computer too. I wrongly assumed Ryan had tested it besides the strict building phase. Thanks for the patch, I’m going to implement it not today, because no time, but tomorrow. Thanks also for your patience.
comment:9 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)
Just so they get recorded in this ticket, Vincent's commits so far for this issue have been:
- [0af836f10f5733686f20cfa744f1cf05259f84a0/macports-ports]
- [fd078cb6ec5f68de9d652cce54e5b2e296609c5a/macports-ports]
- [60d0f2c9a1825776efc0b8e9ec6bac201c7ab63a/macports-ports]
What remains to be done?
comment:10 Changed 7 years ago by Veence (Vincent)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I’m not sure this is relevant anymore. I’ll close it. Reopen if necessary.
Here's a patch that worked for me.
The patch does many things:
-DINSTALL_PYTHON_USING_PREFIX=ON
.reinplace
that linked with multithreaded boost libraries if present into a patch that's always applied. We don't want ports to behave differently depending on what ports (or what variants of ports) are installed. And I don't think there's any variant of boost that causes it to build without the multithreaded libraries so it's fine to always use them.reinplace
that changed the documentation installation directory. Thereinplace
no longer changed anything in the CMakeLists.txt file, and I could not find any similar code there. It seems that no documentation is installed. I didn't look if it was still there somewhere.configure.args
.configure.args
.-DCMAKE_VERBOSE_MAKEFILE=ON
arg because the cmake portgroups already add that.