I2PC / xmipp

Xmipp is a suite of image processing programs, primarily aimed at single-particle 3D electron microscopy.
http://biocomputingunit.es/
GNU General Public License v3.0
38 stars 15 forks source link

linking against libtiff for xmipp #653

Closed zyzhang1992 closed 1 year ago

zyzhang1992 commented 1 year ago

I have issues linking against libtiff for xmipp. Here are the ld errors,

libtiff.so: undefined reference to `libdeflate_zlib_compress_bound'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_compress'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_compress_bound'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_encodeForVersion'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_free_decompressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_getBlobInfo'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_free_compressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_alloc_compressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_decompress'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_decode'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_getBlobInfo'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_decompress'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_free_compressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_compress'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_decode'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_alloc_decompressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_encodeForVersion'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_alloc_decompressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_free_decompressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_alloc_compressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_compress_bound'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_getBlobInfo'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_free_compressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_decompress'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_decode'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_zlib_compress'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_alloc_decompressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `lerc_encodeForVersion'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_free_decompressor'
/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so: undefined reference to `libdeflate_alloc_compressor'

The libraries are revolved as follows,

`ldd /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/libtiff.so
        linux-vdso.so.1 =>  (0x00007ffd24915000)
        libwebp.so.7 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./libwebp.so.7 (0x00007ffaf114d000)
        libzstd.so.1 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./libzstd.so.1 (0x00007ffaf107a000)
        liblzma.so.5 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./liblzma.so.5 (0x00007ffaf1019000)
        libLerc.so.4 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./libLerc.so.4 (0x00007ffaf0f56000)
        libjpeg.so.9 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./libjpeg.so.9 (0x00007ffaf0f18000)
        libdeflate.so.0 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./libdeflate.so.0 (0x00007ffaf1065000)
        libz.so.1 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/./libz.so.1 (0x00007ffaf0efe000)
        libm.so.6 => /lib64/libm.so.6 (0x00007ffaf0bf1000)
        libc.so.6 => /lib64/libc.so.6 (0x00007ffaf0823000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ffaf0607000)
        librt.so.1 => /lib64/librt.so.1 (0x00007ffaf03fe000)
        libstdc++.so.6 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/././libstdc++.so.6 (0x00007ffaf024a000)
        libgcc_s.so.1 => /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib/././libgcc_s.so.1 (0x00007ffaf0231000)
        /lib64/ld-linux-x86-64.so.2 (0x00007ffaf1042000)`

Looks like there might be incompatibilities among the versions of the libraries. Which versions of the libraries are compatible with each others?

Thanks for any help with this!

albertmena commented 1 year ago

Hi @zyzhang1992,

Which g++ version you have? We recommend 8 or later. The list of dependencies for Xmipp are this, there you can see libtiff5-dev.

I'd uninstall the libtiff from the scipion3 enviroment and I'd install libtiff in the system: sudo apt install libtiff5-dev

Xmipp can be installed in a standlone way (installing the list of dependencies, cloning the prepository and ./xmipp) or with Scipion (installing Scipion and running scipion3 run ./xmipp). More details in the Readme. We recommend the second for a standard user, that way all the dependencies will be available.

zyzhang1992 commented 1 year ago

Thanks, @alberto !

I have been using,

gcc --version gcc (GCC) 10.1.0

Our OS is CentOS Linux release 7.9.2009 (Core), the one scipion have been tested for.

I've tried both the ./scipion3 installp -p scipion-em-xmipp approah and the standalone version of xmipp.

For the libtiff issue, I have

conda list tiff

packages in environment at /home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3:

#

Name Version Build Channel

libtiff 4.4.0 h55922b4_4 conda-forge

To be able to find the other conda libraries that libtiff depends on, I needed to set export LD_LIBRARY_PATH=/home/groups/ruthm/zyzhang/sw/sherlock2/anaconda-envs/scipion3/lib:$LD_LIBRARY_PATH to include the scipion3 conda env library path. With that it is possible to resolve the libtiff dependencies.

Now there is a further issue with fftw3, with an error message of cannot find -lfftw3collect2: even though I've installed the fftw in the conda env. What I've installed explicitly is the openmpi version conda install fftw=3.3.10=mpi_openmpi_hdeb57f9_5

However, scipion doesn't seem to be able to detect it even if I have set the library path. I also set the $CPATH and the $PK_CONFIG path but it still can't find the fftw installation in conda. Then scipion runs conda to downgrade it to the nompi version of fftw.

Looks like there may be some issues with the test of the fftw libraries?

Is it okay just to use the nompi version of the fftw?

On another note, I was able to install the xmipp standalone version and link it against sciption with ./scipion3 run xmipp/xmipp

I need to add the -std=c++17 option to the xmipp.conf though.

Thank you so much for your help!


From: alberto @.> Sent: Thursday, October 20, 2022 11:12 PM To: I2PC/xmipp @.> Cc: Zhiyong Zhang @.>; Mention @.> Subject: Re: [I2PC/xmipp] linking against libtiff for xmipp (Issue #653)

Hi @zyzhang1992https://github.com/zyzhang1992,

Which g++ version you have? We recommend 8 or later. The list of dependencies for Xmipp are thishttps://github.com/I2PC/xmipp#full-list-of-dependencies, there you can see libtiff5-dev.

I'd uninstall the libtiff from the scipion3 enviroment and I'd install libtiff in the system: sudo apt install libtiff5-dev

Xmipp can be installed in a standlone way (installing the list of dependencies, cloning the prepository and ./xmipp) or with Scipion (installing Scipion and running scipion3 run ./xmipp). More details in the Readmehttps://github.com/I2PC/xmipp#getting-started. We recommend the second for a standard user, that way all the dependencies will be available.

— Reply to this email directly, view it on GitHubhttps://github.com/I2PC/xmipp/issues/653#issuecomment-1286505561, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ADG474CCTZFNVWT4HZLDID3WEIX6BANCNFSM6AAAAAARKLQWJ4. You are receiving this because you were mentioned.Message ID: @.***>

albertmena commented 1 year ago

Hi again @zyzhang1992, please visit this issue for the fftw problem. About libtiff and how to install Xmipp in Centos visit this wiki.