Hi Nick,
In
the meantime, I have gotten this to compile/run on our server, so I am guessing that the problem is not with the CMake script but rather with my local setup.
The
CMake script has these lines
target_link_libraries
(motify ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(motify
${SEQAN_LIBRARIES})
target_link_libraries(motify
${ZLIB})
and
it is trying to link to libz
/usr/bin/cmake
-E cmake_link_script CMakeFiles/motify.dir/link.txt --verbose=1
/usr/bin/c++
-g -Wall -pedantic -std=c++14 -rdynamic CMakeFiles/motify.dir/main.cpp.o CMakeFiles/motify.dir/ArgParse.cpp.o CMakeFiles/motify.dir/NmerCounter.cpp.o CMakeFiles/motify.dir/NucOdometer.cpp.o -o motify -lpthread -lrt -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
-lz mafParse/libmafParse.a
but
I get this
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/stream_compressor.h:382:
undefined reference to `inflateInit2_'
mafParse/libmafParse.a(TargetedRegions.cpp.o):
In function `zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>, std::allocator<char>, unsigned char, std::allocator<unsigned char> >::~basic_unzip_streambuf()':
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/iostream_zip_impl.h:282:
undefined reference to `inflateEnd'
mafParse/libmafParse.a(TargetedRegions.cpp.o):
In function `zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>, std::allocator<char>, unsigned char, std::allocator<unsigned char> >::basic_unzip_streambuf(std::istream&, unsigned long, unsigned long, unsigned long)':
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/iostream_zip_impl.h:268:
undefined reference to `inflateInit2_'
mafParse/libmafParse.a(TargetedRegions.cpp.o):
In function `unsigned long seqan::_decompressBlock<char, unsigned long, char, unsigned int>(char*, unsigned long, char*, unsigned int, seqan::CompressionContext<seqan::Tag<seqan::BgzfFile_> >&)':
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/stream_compressor.h:473:
undefined reference to `inflate'
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/stream_compressor.h:476:
undefined reference to `inflateEnd'
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/stream_compressor.h:480:
undefined reference to `inflateEnd'
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/stream_compressor.h:489:
undefined reference to `crc32'
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/stream_compressor.h:489:
undefined reference to `crc32'
mafParse/libmafParse.a(TargetedRegions.cpp.o):
In function `zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>, std::allocator<char>, unsigned char, std::allocator<unsigned char> >::unzip_from_stream(char*, long)':
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/iostream_zip_impl.h:336:
undefined reference to `inflate'
/home/robinp/GIT/jax-egtk/build/seqan/include/seqan/stream/iostream_zip_impl.h:339:
undefined reference to `inflateReset'
collect2:
error: ld returned 1 exit status
CMakeFiles/motify.dir/build.make:174:
recipe for target 'motify' failed
make[2]:
*** [motify] Error 1
make[2]:
Leaving directory '/home/robinp/GIT/jax-egtk/build'
CMakeFiles/Makefile2:67:
recipe for target 'CMakeFiles/motify.dir/all' failed
make[1]:
*** [CMakeFiles/motify.dir/all] Error 2
make[1]:
Leaving directory '/home/robinp/GIT/jax-egtk/build'
Makefile:140:
recipe for target 'all' failed
make:
*** [all] Error 2
->
As far as I can see now, I have all of the libz libraries installed, but I am going to explore here. I would like to be able to get CMake to give an error message before using make....
If you want cmake to emit an error message during the configuration step you need to compile some cxx source before. Something that tries to use the zlib, e.g. SeqAn's gzip streams.
In this case, if there is a compile or linker error you can check and test for it.
Otherwise, your script did not reveal any major issues to me. The only thing I am wondering about is why you need to build seqan. It suffices to download it and to link against it as you do already.
But since you are building it already I am wondering why there is no linker error?
You can also define the option SEQAN_FIND_DEBUG and it would print some information at the end of the find seqan step.
cheers,
René
thanks!
Peter
Robinson
Professor
and Donald A. Roux Chair, Genomics and Computational Biology
The
Jackson Laboratory for Genomic Medicine
860.837.2095
t | peter.robinson@jax.org | https://robinsongroup.github.io/
Peter
Robinson
________________________________________
From:
Leon Kuchenbecker <lkuchenb@inf.fu-berlin.de>
Sent:
Friday, January 25, 2019 10:15 AM
To: seqan-dev@lists.fu-berlin.de
Cc:
Peter Robinson
Subject:
Re: [Seqan-dev] CMake and ZLIB
Hi
Nick,
do
you have a 'target_link_libraries' statement anywhere which adds the
required
libraries to the linker step?
Something
like
target_link_libraries (my_project ${SEQAN_LIBRARIES})
IIRC
this also contains linking zlib.
When
you're debugging this, try using "make VERBOSE=1" to see if the
linker
flag is included or not.
You
seem to be building a cmake file that automatically obtains SeqAn.
I've
done something similar on other projects, maybe check out
https://github.com/lkuchenb/imseq/blob/master/cmake/SeqAn.cmake
it
worked pretty well for me. If the include syntax hasn't changed from
2.3.2
to 2.4.0, it should work for the latest release as well. This
won't
work if you need the current development version from the git repo
though.
Cheers
Leon
---
The
information in this email, including attachments, may be confidential and is intended solely for the addressee(s). If you believe you received this email by mistake, please notify the sender by return email as soon as possible.
_______________________________________________
seqan-dev
mailing list
seqan-dev@lists.fu-berlin.de
https://lists.fu-berlin.de/listinfo/seqan-dev
---
René Rahn
Ph.D. Student (de.NBI - CIBI)
--------------------------------
Tel: (+49) 30 838 72974
--------------------------------
Institute of Computer Science
Algorithmic Bioinformatics (ABI)
--------------------------------
Freie Universität Berlin
Takustraße 9
14195 Berlin
--------------------------------
|