mittinatten / freesasa

C-library for calculating Solvent Accessible Surface Areas
http://freesasa.github.io/
MIT License
105 stars 37 forks source link

xml.c:4:10: fatal error: 'libxml/tree.h' file not found #46

Closed alabrashJr closed 4 years ago

alabrashJr commented 4 years ago

Hi everyone, I'm struggling to find a solution for the following error, it happens while make it's running. I'm using MACOS Catalina image

I tried the following solutions and did not work, update brew re-install libxml library using brew update xcode

mittinatten commented 4 years ago

What does the configure script say about libxml?

fre 20 dec. 2019 kl. 14:34 skrev Abdurrahman Beyaz <notifications@github.com

:

Hi everyone, I'm struggling to find a solution for the following error, it happens while make it's running. I'm using MACOS Catalina [image: image] https://user-images.githubusercontent.com/9295206/71258096-6b1d8100-2346-11ea-8422-d71f5380d02e.png

I tried the following solutions and did not work, update brew re-install libxml library using brew update xcode

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mittinatten/freesasa/issues/46?email_source=notifications&email_token=AAVV4HGEZ6IVOU6FWBCA423QZTCXRA5CNFSM4J557PHKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IB67B2A, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVV4HCCQMTFJTTA72UIF2LQZTCXRANCNFSM4J557PHA .

alabrashJr commented 4 years ago
./configure 
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
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 for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for ranlib... ranlib
checking for sqrt in -lm... yes
checking for dlsym in -ldl... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -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 size_t... yes
checking for working alloca.h... yes
checking for alloca... yes
checking for inttypes.h... (cached) yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking malloc.h usability... no
checking malloc.h presence... no
checking for malloc.h... no
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for inline... inline
checking for size_t... (cached) yes
checking for C/C++ restrict keyword... __restrict
checking for int16_t... yes
checking for int32_t... yes
checking for int8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for gcc option to accept ISO C99... none needed
checking for inline... (cached) inline
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
checking for mkdir... yes
checking for sqrt... yes
checking for strchr... yes
checking for strdup... yes
checking for strerror... yes
checking for strncasecmp... yes
checking for getopt_long... yes
checking for getline... yes
checking for pthread_create in -lpthread... yes
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking for xmllint... xmllint
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libxml-2.0... yes
checking for json_object_get in -ljson-c... yes
checking json-c/json_object.h usability... yes
checking json-c/json_object.h presence... yes
checking for json-c/json_object.h... yes
checking for jsonlint... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating doc/Makefile
config.status: creating doc/Doxyfile
config.status: creating doc/man/freesasa.1
config.status: creating tests/Makefile
config.status: creating share/Makefile
config.status: creating tests/test-cli
config.status: creating config.h
config.status: executing depfiles commands
mittinatten commented 4 years ago

That looks ok. So there’s probably something with your C include path (I assumed the configure script would take care of that). I am not at a computer, so I can’t check myself, but passing CFLAGS=“-Ipath/to/libxml/headers” -O2 as an argument to the configure script should work. Or change the global environment variable C_INCLUDE_PATH to include the correct path.

Also, if you don’t need xml output, you can simply add the argument --disable-xml to the configure script.

fre 20 dec. 2019 kl. 21:27 skrev Abdurrahman Beyaz <notifications@github.com

:

./configure checking for a BSD-compatible install... /usr/local/bin/ginstall -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes 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 for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for ranlib... ranlib checking for sqrt in -lm... yes checking for dlsym in -ldl... yes checking how to run the C preprocessor... gcc -E checking for grep that handles long lines and -e... /usr/bin/grep checking for egrep... /usr/bin/grep -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 size_t... yes checking for working alloca.h... yes checking for alloca... yes checking for inttypes.h... (cached) yes checking libintl.h usability... no checking libintl.h presence... no checking for libintl.h... no checking malloc.h usability... no checking malloc.h presence... no checking for malloc.h... no checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking dlfcn.h usability... yes checking dlfcn.h presence... yes checking for dlfcn.h... yes checking for inline... inline checking for size_t... (cached) yes checking for C/C++ restrict keyword... __restrict checking for int16_t... yes checking for int32_t... yes checking for int8_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for gcc option to accept ISO C99... none needed checking for inline... (cached) inline checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for stdlib.h... (cached) yes checking for GNU libc compatible realloc... yes checking for memset... yes checking for mkdir... yes checking for sqrt... yes checking for strchr... yes checking for strdup... yes checking for strerror... yes checking for strncasecmp... yes checking for getopt_long... yes checking for getline... yes checking for pthread_create in -lpthread... yes checking pthread.h usability... yes checking pthread.h presence... yes checking for pthread.h... yes checking for xmllint... xmllint checking for pkg-config... /usr/local/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for libxml-2.0... yes checking for json_object_get in -ljson-c... yes checking json-c/json_object.h usability... yes checking json-c/json_object.h presence... yes checking for json-c/json_object.h... yes checking for jsonlint... no checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating src/Makefile config.status: creating doc/Makefile config.status: creating doc/Doxyfile config.status: creating doc/man/freesasa.1 config.status: creating tests/Makefile config.status: creating share/Makefile config.status: creating tests/test-cli config.status: creating config.h config.status: executing depfiles commands

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mittinatten/freesasa/issues/46?email_source=notifications&email_token=AAVV4HGHJJXCHFYHZW55ANTQZUTB3A5CNFSM4J557PHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHOCSGA#issuecomment-568076568, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVV4HDPU46Z2NAUAPOMZQ3QZUTB3ANCNFSM4J557PHA .

alabrashJr commented 4 years ago

@mittinatten thanks for your kindly fast reply. I disabled XML, it's working now

BR

mittinatten commented 4 years ago

Great! I have improved the configure script to give better feedback when there are problems linking with libxml.

For the future I might consider disabling xml support by default, not sure how many people use it.

mittinatten commented 4 years ago

...which turned out to cause problems in Linux.

The problem is that newer versions of Mac OS X have libxml2 in /usr/lib but no headers int /user/include. This confuses pkg-config. But if I solve it for Mac I get problems in Linux. So I'll revert the last commit and see if I can figure out something that works for both platforms.

In the mean time, if someone runs into this problem, running

./configure CFLAGS=-I/usr/local/opt/libxml2/include LDFLAGS=-L/usr/local/opt/libxml2/lib

Works for on my Mac with libxml2 installed by homebrew.