How to compile self-contained cisTEM binaries?

10 posts / 0 new
Last post
dxc2007
How to compile self-contained cisTEM binaries?

Hello, I am trying to create cisTEM binaries such as reconstruct3d and merge3d that I can move around and run from any folder. 

Currently, I'm creating the binaries from cistem-1.0.0-beta using the docker container here https://hub.docker.com/r/arohou/cistem_dev_env on my HPC cluster.

The binaries run fine within the docker container, but they give this error when I run them on the cluster: "./merge3d: error while loading shared libraries: libwx_baseu-3.0.so.0: cannot open shared object file: No such file or directory"

I tried running "./configure" with the "--disable-shared" and "--enable-staticmode" but the error remains.

Would a developer be willing to assist? Thank you.

 

alexis
Hi - this is not somethign I

Hi - this is not somethign I've done recently, and Tim may have better ideas, but as a first attempt, I guess I would check whether static wx libraries are even available for linking in my docker container. Is it possible that it attempts to link against static wx, but that goes wrong, and then it defaults back to linking against dynamic wx? I'm sorry that I don't remember those details from when I put this Docker together - bad memory!

 

Cheers,
Alexis

dxc2007
Hi Alexis, thank you for your

Hi Alexis, thank you for your reply. I believe there are static wx libraries as you can see in the .a files here

Singularity> cd /usr/local/lib/
Singularity> ls

...
libwx_baseu-3.0.a              libwx_gtk2u_ribbon-3.0.so
libwx_baseu-3.0.so             libwx_gtk2u_ribbon-3.0.so.0
libwx_baseu-3.0.so.0           libwx_gtk2u_ribbon-3.0.so.0.4.0
libwx_baseu-3.0.so.0.4.0       libwx_gtk2u_richtext-3.0.a
...

I went over the "make" command log and they look something like this (the -static flag is present, but there's also this "/usr/local/lib/libtiff.so" file in the command, which might messing things up): 

libtool: link: g++ -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o refine2d programs/refine2d/refine2d-refine2d.o -pthread  -L/usr/local/lib libcore.a -lwx_baseu-3.0 -lwx_baseu_net-3.0 /usr/local/lib/libtiff.so -lm -ldl -lfftw3f -pthread

I checked the /usr/local/lib folder and there's also the static libtiff.a file, hence might the linking against "/usr/local/lib/libtiff.so" instead of "/usr/local/lib/libtiff.a" be the problem?

ls libtiff*
libtiff.a   libtiff.so    libtiff.so.5.4.0  libtiffxx.la  libtiffxx.so.5
libtiff.la  libtiff.so.5  libtiffxx.a       libtiffxx.so  libtiffxx.so.5.4.0

Thank you.

dxc2007
Apologies, the full output

Apologies, the full output for one binary should look something like this:

/bin/bash ../libtool  --tag=CXX   --mode=link g++ -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -L/usr/local/lib -static -o refine2d programs/refine2d/refine2d-refine2d.o libcore.a -L/usr/local/lib -pthread   -lwx_baseu-3.0 -lwx_baseu_net-3.0  -ltiff  -ldl -lfftw3f

libtool: link: g++ -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o refine2d programs/refine2d/refine2d-refine2d.o -pthread  -L/usr/local/lib libcore.a -lwx_baseu-3.0 -lwx_baseu_net-3.0 /usr/local/lib/libtiff.so -lm -ldl -lfftw3f -pthread
 

alexis
OK, I also am unable to

OK, I also am unable to produce completely static binaries right now. Obviously it's possible to do so, because Tim makes such binaries for releases etc. But I don't have much time to investigate right now. Tim should be able to comment, though he is not online very frequently at the moment, so it may take him a little while. Thanks for your patience.

dxc2007
Sure Alexis thank you for

Sure Alexis thank you for your help. I'll wait for Tim's reply.

timgrant
Hi,

Hi,

The way that I do this is to also compile wxWidgets myself, and configure it with the --disable-shared option.  If you are using the released cisTEM code then you need to use wxWidgets 3.0.2 (https://sourceforge.net/projects/wxwindows/files/3.0.2/).

To be specific, this is my configure line for wxWidgets :-

CXX=icpc CC=icc ./configure --disable-precomp-headers --prefix=/directory_to_install_to --with-libnotify=no --disable-shared --without-gtkprint --with-libjpeg=builtin --with-libpng=builtin --with-libtiff=builtin --with-zlib=builtin --with-expat=builtin --disable-compat28 --without-liblzma --without-libjbig

Obviously you need to replace "--prefix=/directory_to_install_to" with the actual directory. Then do make, make install

After this, configure cisTEM with "--with-wx-config=path_to_your_wx_config" and the --enable-staticmode.

Thanks,

Tim

 

 

dxc2007
Thanks Tim!

Thanks Tim!

 

As I’m compiling cisTEM on a HPC, there are certain modules that I don’t have access to, such as the icc compiler. Hence, I wasn’t able to follow your compilation method.

 

However, I used another method to compile cisTEM and it seems to be working

  1. Run Alexis’ VM (https://hub.docker.com/r/arohou/cistem_dev_env) on HPC
  2. On the VM, compile cisTEM using
    1. ./configure --prefix=/hpc/home/xd24 --enable-staticmode
    2. make
  3. Manually compile the specific binaries that I need (reconstruct3d and merge3d)
    1. cd into /src folder
    2. g++ -DPACKAGE_NAME=\"cisTEM\" -DPACKAGE_TARNAME=\"cistem\" -DPACKAGE_VERSION=\"1.0.0-beta\" -DPACKAGE_STRING=\"cisTEM1.0.0-beta\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"cistem\" -DVERSION=\"1.0.0-beta\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -Dwx_is_available=1 -I.  -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -MT programs/merge3d/merge3d-merge3d.o -MD -MP -MF programs/merge3d/.deps/merge3d-merge3d.Tpo -c -o programs/merge3d/merge3d-merge3d.o `test -f 'programs/merge3d/merge3d.cpp' || echo './'`programs/merge3d/merge3d.cpp
    3. /bin/bash ../libtool  --tag=CXX   --mode=link g++ -I/usr/local/lib/wx/include/gtk2-unicode-3.0 -I/usr/local/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -DwxUSE_GUI=0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -L/usr/local/lib -all-static -o merge3d programs/merge3d/merge3d-merge3d.o libcore.a -L/usr/local/lib -pthread  -lwx_baseu-3.0 -lwx_baseu_net-3.0 -ltiff  -ldl -lfftw3f
olibclarke
Related to this, are there

Related to this, are there any binaries available for Mac OS X? I have tried compiling with no luck - I can't get the specific version of wxWidgets required to compile. 

I'm not going to run any heavy duty processing on my mac, but I would like to have some of the smaller utilities like `sharpen_map` and `resample_map` available - if wxWidgets is only needed for the GUI is there any way to compile in a headless mode?

Cheers

Oli

timgrant
Hi Oli,

Hi Oli,

You need wxwidgets to compile the text based program also.  I don't currently have a mac, but I have done this before and it should work for the text programs.  The gui can be compiled, but does not run properly.

If you run ./configure - does it give you an error?

Tim

Log in or register to post comments