Closed mofoyoda closed 8 years ago
Sorry but you have not followed the requested steps on the Troubleshooting page: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
Please follow (all of) these steps and post the information here so we can help you with your problem.
Thanks!
I can reproduce on 10.9.5.
Build logs: https://gist.github.com/32be25ac30ab554fbb5b
This was a build done with HOMEBREW_MAKE_JOBS=1 brew install -v --build-from-source open-scene-graph --with-collada-dom --with-dcmtk --with-docs --with-ffmpeg --with-gdal --with-gnuplot --with-jasper --with-librsvg --with-openexr
.
Same error on 10.9.5 with the default options: HOMEBREW_MAKE_JOBS=1 brew install -v --build-from-source open-scene-graph
https://gist.github.com/e82958822cbdd78ec258
I also see the same error on 10.11 if I build OpenSceneGraph from its distribution outside Homebrew using its default options. I can't reproduce under Homebrew on 10.11 because it's failing due to #46372, which may be masking this issue.
Okay.
Undefined symbols for architecture x86_64:
"__libiconv_version", referenced from:
OFCharacterEncoding::getLibraryVersionString() in libofstd.a(ofchrenc.cc.o)
From the build log, we can see that this is being pulled in from /usr/local/lib/libofstd.a
.
/usr/local/Library/ENV/4.3/clang++ -std=c++11 ... /usr/local/lib/libofstd.a
That file is supplied by the dcmtk
formula.
$ ls -la /usr/local/lib/libofstd.a
lrwxr-xr-x 1 janke admin 45 Nov 25 21:48 /usr/local/lib/libofstd.a -> ../Cellar/dcmtk/3.6.1-20150924/lib/libofstd.a
I think this means that the build command should also be linking against libiconv if it uses dcmtk
. I'm not sure if that is something the formula should be supplying, or if it's an upstream issue with OSG's build system.
As a workaround, uninstalling dcmtk
with brew rm dcmtk
and not using --with-dcmtk
seems to fix this. In that case for me, the build gets further and fails with #43536 instead. Removing collada-dom
and --with-collada-dom
then get it to build all the way.
Removing --with-dcmtk
option still results in the failing build with the same libiconv link error
Did you also uninstall dcmtk with brew rm dcmtk
or brew unlink dcmtk
? If not, OSG's build script will still autodetect it and attempt to build against it.
Looks like the issue is that OSG's build script for their dicom
plugin assumes that dcmtk
was not built against libiconv
, so it doesn't attempt to link iconv
. But dcmtk
's build script autodetects libiconv, and since OS X ships with libiconv, it discovers and builds against it.
Seems like OSG should be querying dcmtk to see whether it was built with libiconv, or at least detecting libiconv on the system and assuming dcmtk was built against it if present, and include it in the libraries to link against.
We could patch it to link against libiconv. Though to be correct, we should check dcmtk
to see whether it was built against the system libiconv or the Homebrew dupes libiconv, and link against the same one.
diff --git a/src/osgPlugins/dicom/CMakeLists.txt b/src/osgPlugins/dicom/CMakeLists.txt
index 55c2a57..e6e3f4a 100644
--- a/src/osgPlugins/dicom/CMakeLists.txt
+++ b/src/osgPlugins/dicom/CMakeLists.txt
@@ -5,7 +5,7 @@ IF (DCMTK_FOUND)
SET(TARGET_SRC ReaderWriterDICOM.cpp )
- LINK_LIBRARIES(${DCMTK_LIBRARIES} ${ZLIB_LIBRARY})
+ LINK_LIBRARIES(${DCMTK_LIBRARIES} iconv ${ZLIB_LIBRARY})
ADD_DEFINITIONS(-DUSE_DCMTK)
The dcmtk
installation includes a lib/cmake/dcmtk/DCMTKConfig.cmake
file which could be pulled in by the OSG CMake scripts to detect whether dcmtk
was built with iconv. I don't know enough CMake to know how to pull that in, though.
brew rm dcmtk
works for me, thanks. Seems like no other formula is using it, so removing it doesn't affect anything except OSG. Still had to hardcode collada-dom path, because I need collada models support in OSG.
Okay, here's a PR that will get OSG building even when dcmtk
is installed, and should get --with-dcmtk
working again. #46388
Looks like this should have been fixed. If not: we'll accept PRs for this but we're not actively working on it at this time.
I've got an error trying to build open-scene-graph
I'm building with:
brew install --with-collada-dom --with-dcmtk --with-docs --with-ffmpeg --with-gdal --with-gnuplot --with-jasper --with-librsvg --with-openexr --verbose openscenegraph
and getting a make error here:
any clues?