[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Issues with neq package iqtree (use Debian packaged zlib in cmake build and others)



Hi Andreas

Il Lunedì 31 Agosto 2015 15:57, Andreas Tille <andreas@an3as.eu> ha scritto:
>

>CMakeFiles/iqtree.dir/gzstream.cpp.o: In function `gzstreambuf::underflow()':
>/tmp/buildd/iqtree-1.3.8+dfsg/gzstream.cpp:91: undefined reference to `gzread'
>CMakeFiles/iqtree.dir/gzstream.cpp.o: In function `gzstreambuf::open(char const*, int)':
>/tmp/buildd/iqtree-1.3.8+dfsg/gzstream.cpp:62: undefined reference to `gzopen'
>CMakeFiles/iqtree.dir/gzstream.cpp.o: In function `gzstreambuf::close()':
>
>).  I wonder if there is some kind of default "include zlib wherever you
>find it to make upstream happy with a sensible patch)

>

of course it doesn't link if you remove zlib from target_link_libraries!

you might want to do something like:
find_package(ZLIB)
if(ZLIB_FOUND)
  include_directories(${ZLIB_INCLUDE_DIRS}) #this one is actually not needed, but meh
else(ZLIB_FOUND)

  add_subdirectory(TheOneYouCommentedOut)

endif(ZLIB_FOUND)


instead of target_link_libraries zlibstatic you might want to use
http://www.cmake.org/cmake/help/v3.0/module/FindZLIB.html
"ZLIB_LIBRARIES"

and patch the CMakeLists.txt on zlib-1.2.7 subdirectory to 


+set (ZLIB_LIBRARIES zlibstatic)


another way is:

find_package(ZLIB)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS}) #this one is actually not needed, but meh
target_link_libraries(iqtree ${ZLIB_LIBRARIES})
else(ZLIB_FOUND)
add_subdirectory(TheOneYouCommentedOut)

target_link_libraries(iqtree zlibstatic)endif(ZLIB_FOUND)


this find_package relies on the findZLIB.cmake file available in 
/usr/share/cmake-3.0/Modules/FindZLIB.cmake

the same for eigen3
/usr/share/cmake-3.0/Modules/FindEigen3.cmake

(BTW the target link libraries needs to be moved after iqtree definition (add_executable))

attaching a patch to make Eigen and Zlib found in the right way(TM)



>I was not lucky in excluding sprng at all since upstream seems to have
>changed the interface in the copy shipped with the upstream source.  I
>tried to document the issue in the according (deactivated) patch[2] and
>left the code copy inside the tarball for the moment.
>
>I'd be happy to get some help at least for the zlib issue.  Any hint how
>to use the packaged sprng would be welcome as well for sure.>


I don't think I can help here :)

seems a new parameter has been added, so I guess you just need to find which one
and add it or add some NULL instead (I did add a NULL and the build completed).

I got some undefined references to init_rng and so on, but I guess you know how to
solve them now :)

HTH

Gianfranco

Attachment: patch
Description: Binary data


Reply to: