pemsley / coot

Software for macromolecular model-building
http://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/
GNU General Public License v3.0
121 stars 45 forks source link

configure: error: mmdb2 not found #78

Open jowodo opened 1 year ago

jowodo commented 1 year ago

How can I tell the configure command where to find mmdb2? About the system:

$ lsb_release -d
Description:    Oracle Linux Server release 8.7
$ uname -r
4.18.0-425.19.2.el8_7.x86_64
$ module --version
Modules Release 5.2.0 (2022-11-08)
$ module
Currently Loaded Modulefiles:
 1) mmdb2/2.0.22   2) ccp4/8.0.010
$ ls /home/apps/mmdb2/2.0.22/lib/
libmmdb2.a  libmmdb2.la  pkgconfig
$ ls /home/apps/mmdb2/2.0.22/include/mmdb2/
hybrid_36.h      mmdb_coormngr.h  mmdb_io_stream.h   mmdb_math_bfgsmin.h  mmdb_math_rand.h  mmdb_rwbrook.h       mmdb_title.h
mmdb_atom.h      mmdb_cryst.h     mmdb_machine_.h    mmdb_math_fft.h      mmdb_mattype.h    mmdb_selmngr.h       mmdb_uddata.h
mmdb_bondmngr.h  mmdb_defs.h      mmdb_manager.h     mmdb_math_graph.h    mmdb_mmcif_.h     mmdb_seqsuperpose.h  mmdb_utils.h
mmdb_chain.h     mmdb_ficif.h     mmdb_mask.h        mmdb_math_.h         mmdb_model.h      mmdb_symop.h         mmdb_xml_.h
mmdb_cifdefs.h   mmdb_io_file.h   mmdb_math_align.h  mmdb_math_linalg.h   mmdb_root.h       mmdb_tables.h
$ ls /home/apps/ccp4/8.0.010/lib/libmmdb2*
/home/apps/ccp4/8.0.010/lib/libmmdb2.so.0  /home/apps/ccp4/8.0.010/lib/libmmdb2.so.0.0.0
]$ ls /home/apps/ccp4/8.0.010/include/mmdb2/
hybrid_36.h      mmdb_coormngr.h  mmdb_io_stream.h   mmdb_math_bfgsmin.h  mmdb_math_rand.h  mmdb_rwbrook.h       mmdb_title.h
mmdb_atom.h      mmdb_cryst.h     mmdb_machine_.h    mmdb_math_fft.h      mmdb_mattype.h    mmdb_selmngr.h       mmdb_uddata.h
mmdb_bondmngr.h  mmdb_defs.h      mmdb_manager.h     mmdb_math_graph.h    mmdb_mmcif_.h     mmdb_seqsuperpose.h  mmdb_utils.h
mmdb_chain.h     mmdb_ficif.h     mmdb_mask.h        mmdb_math_.h         mmdb_model.h      mmdb_symop.h         mmdb_xml_.h
mmdb_cifdefs.h   mmdb_io_file.h   mmdb_math_align.h  mmdb_math_linalg.h   mmdb_root.h       mmdb_tables.h
$ echo $CPATH
/home/apps/ccp4/8.0.010/include:/home/apps/mmdb2/2.0.22/include
$ echo $CPLUS_INCLUDE_PATH
/home/apps/ccp4/8.0.010/include/
$ echo $LD_LIBRARY_PATH
/home/apps/mmdb2/2.0.22/lib:/home/apps/ccp4/8.0.010/lib/
$ gcc -print-search-dirs | sed '/^lib/b 1;d;:1;s,/[^/.][^/]*/\.\./,/,;t 1;s,:[^=]*=,:;,;s,;,;  ,g' | tr \; \\012 | tr : \\012 | grep ccp4
  /home/apps/ccp4/8.0.010/lib/x86_64-redhat-linux/8/
/home/apps/ccp4/8.0.010/lib64/
/home/apps/ccp4/8.0.010/lib/
$ echo | gcc -x c -E -Wp,-v - 2>&1 | grep ccp4
 /home/apps/ccp4/8.0.010/include
$ echo | gcc -x c++ -E -Wp,-v - 2>&1 | grep ccp4
ignoring duplicate directory "/home/apps/ccp4/8.0.010/include"
 /home/apps/ccp4/8.0.010/include/

But still, when I run configure from the coot-1.0.05 directory, I get:

$ ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 3458764513820540925
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /bin/ld -m elf_x86_64
checking if the linker (/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking which libtool initialization strategy to adopt... AC-PROG-LIBTOOL
checking what warning flags to pass to the C compiler... -Wall -Wunused
checking what language compliance flags to pass to the C compiler...
checking what warning flags to pass to the C++ compiler... -Wall -Wno-unused
checking what language compliance flags to pass to the C++ compiler...
checking sys/stdtypes.h usability... no
checking sys/stdtypes.h presence... no
checking for sys/stdtypes.h... no
checking for OpenMP flag of C compiler... -fopenmp
checking whether g++ supports C++11 features by default... yes
checking for std::thread in thread... yes
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking if this is MINGW on Windows... no
checking if this is msys2 windows 64... no
checking for LIBPNG... yes
checking for CAIRO... yes
checking for SQLite3... yes
checking for mmdb2... no
configure: error: in `/scratch/students/apptest/tmp/coot/coot-1.0.05':
configure: error: mmdb2 not found
See `config.log' for more details
jowodo commented 1 year ago

I found the solution to this specific problem after trying this:

$ pkgconf --libs mmdb2
Package mmdb2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `mmdb2.pc'
to the PKG_CONFIG_PATH environment variable
Package 'mmdb2', required by 'virtual:world', not found

This resolved mmdb2 error:

$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/home/apps/mmdb2/2.0.22/lib/pkgconfig
$ ./configure 
jowodo commented 1 year ago

Now I get:

./configure
...
checking for SQLite3... yes
checking for mmdb2... yes
checking for ssm... no
configure: error: in `/tmp/tmp.ydDJN1WHl7/coot-1.0.05':
configure: error: ssm not found
See `config.log' for more details

So I installed ssm from https://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/dependencies/ but when configuring ssm i get:


$ ./configure
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
...
checking for MMDB_CCIF_Init in -lmmdb2... no
configure: error: mmdb2 library not found.
jowodo commented 1 year ago

The solution to configure ssm was:

$ LDFLAGS=-L$PATH_TO_MMDB2_LIBS ./configure

Now I'm stuck at fftw point when configuring coot:


$ ./configure --with-fftw-prefix=/home/app/fftw/2.1.5
... 
checking for mmdb2... yes
checking for ssm... yes
no
checking for non-prefixed single-precision FFTW2 (fftw.h)... no
no
configure: error: single-precision FFTW 2 library not found.
jowodo commented 1 year ago

Even for fftw I found a solution: Just use ./configure --with-fftw-prefix=$(pkgconf --variable=prefix fftw) or probably --with-fftw-prefix=$PATH_TO_FFTW2_INSTALL anyway, the next dependency is clipper and I managed to get past the configuration step of clipper with the following command:

$ wget https://www2.mrc-lmb.cam.ac.uk/personal/pemsley/coot/dependencies/clipper-configure-2.patch
$ sed -i "s/p = a/*p = &a/" configure
$ LDFLAGS=$(pkgconf --cflags fftw) ./configure --prefix=$MODULEBASE/$MODULENAME/$MODULEVERSION --with-fftw2-prefix=$(pkgconf --variable=prefix fftw)

BUT, during the make command I get:

libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -I/home/apps/fftw/2.1.5/include -MT libclipper_core_la-fftmap.lo -MD -MP -MF .deps/libclipper_core_la-fftmap.Tpo -c fftmap.cpp
 -o libclipper_core_la-fftmap.o
In file included from /usr/include/stdio.h:33,
                 from /usr/include/c++/8/cstdio:42,
                 from /usr/include/c++/8/ext/string_conversions.h:43,
                 from /usr/include/c++/8/bits/basic_string.h:6404,
                 from /usr/include/c++/8/string:52,
                 from clipper_message.h:49,
                 from clipper_thread.h:49,
                 from clipper_memory.h:49,
                 from clipper_types.h:50,
                 from cell.h:50,
                 from coords.h:49,
                 from fftmap.h:49,
                 from fftmap.cpp:43:
fftmap.cpp:55:36: error: cannot convert 'fftw_real*' {aka 'double*'} to 'float*' in initialization
 static float* dummy = (fftw_real*) NULL;

Some programmer dude in a comment to this question points out that converting pointer of double to float is problematic since they normally have a different size. I'm not a C++ specialist, so this makes sense. I've seen other people pass the configuration test steps, though. Could it have to do with the gcc version?

pemsley commented 1 year ago

Oh dear. Sorry for missing this issue. One builds coot from the build-it script for the GTK+2-based build. Or the build-it-3-3 script for current build.

jowodo commented 1 year ago

Thanks for your reply. I'll have a look next week.