emcrisostomo / fswatch

A cross-platform file change monitor with multiple backends: Apple OS X File System Events, *BSD kqueue, Solaris/Illumos File Events Notification, Linux inotify, Microsoft Windows and a stat()-based backend.
https://emcrisostomo.github.io/fswatch/
GNU General Public License v3.0
5.02k stars 327 forks source link

problems building on ubuntu #48

Closed notslang closed 10 years ago

notslang commented 10 years ago

It seems to build without any errors, but when running it, it fails to find libfswatch.so.0:

$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
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 ar... ar
checking the archiver (ar) interface... ar
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 grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
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 /usr/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 archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt 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... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/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 for clang++... no
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 how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/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... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/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 whether ln -s works... yes
checking for zsh... no
checking for bash... /bin/bash
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking CXXFLAGS for maximum warnings... -Wall
checking for stdlib.h... (cached) yes
checking getopt.h usability... yes
checking getopt.h presence... yes
checking for getopt.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for working strtod... yes
checking for getopt_long... yes
checking for realpath... yes
checking for regcomp... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating scripts/fswatch-run-bash
config.status: creating scripts/fswatch-run-zsh
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in libfswatch (/home/slang/pkgs/fswatch-1.4.2/libfswatch)
configure: running /bin/bash ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
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 ar... ar
checking the archiver (ar) interface... ar
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 grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
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 /usr/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 archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt 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... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/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 for clang++... no
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 how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/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... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/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 whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... yes
checking CXXFLAGS for maximum warnings... -Wall
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/event.h usability... no
checking sys/event.h presence... no
checking for sys/event.h... no
checking sys/inotify.h usability... yes
checking sys/inotify.h presence... yes
checking for sys/inotify.h... yes
checking CoreServices/CoreServices.h usability... no
checking CoreServices/CoreServices.h presence... no
checking for CoreServices/CoreServices.h... no
checking unordered_map usability... yes
checking unordered_map presence... no
configure: WARNING: unordered_map: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: unordered_map: proceeding with the compiler's result
checking for unordered_map... yes
checking unordered_set usability... yes
checking unordered_set presence... no
configure: WARNING: unordered_set: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: unordered_set: proceeding with the compiler's result
checking for unordered_set... yes
checking mutex usability... yes
checking mutex presence... no
configure: WARNING: mutex: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: mutex: proceeding with the compiler's result
checking for mutex... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking for size_t... yes
checking for uint32_t... yes
checking for mode_t... yes
checking for struct stat.st_mtime... yes
checking for struct stat.st_mtimespec... no
checking for std::unique_ptr<std::string>... yes
checking for realpath... yes
checking for modf... yes
checking for regcomp... yes
checking whether kqueue is declared... no
checking whether kevent is declared... no
checking for thread_local storage specifier... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating libfswatch_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

$ make
make  all-recursive
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
Making all in libfswatch
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make  all-am
make[3]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
  CXX      c/libfswatch.lo
  CXX      c/libfswatch_log.lo
  CXX      c++/libfswatch_exception.lo
  CXX      c++/event.lo
  CXX      c++/monitor.lo
  CXX      c++/poll_monitor.lo
  CXX      c++/inotify_monitor.lo
  CXX      c++/path_utils.lo
  CXXLD    libfswatch.la
make[3]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
  CXX      fswatch.o
  CXX      fswatch_log.o
  CXXLD    fswatch
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'

$ make check
Making check in libfswatch
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'

$ sudo make install
Making install in libfswatch
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
 /bin/mkdir -p '/usr/local/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libfswatch.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libfswatch.so.0.0.0 /usr/local/lib/libfswatch.so.0.0.0
libtool: install: (cd /usr/local/lib && { ln -s -f libfswatch.so.0.0.0 libfswatch.so.0 || { rm -f libfswatch.so.0 && ln -s libfswatch.so.0.0.0 libfswatch.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libfswatch.so.0.0.0 libfswatch.so || { rm -f libfswatch.so && ln -s libfswatch.so.0.0.0 libfswatch.so; }; })
libtool: install: /usr/bin/install -c .libs/libfswatch.lai /usr/local/lib/libfswatch.la
libtool: install: /usr/bin/install -c .libs/libfswatch.a /usr/local/lib/libfswatch.a
libtool: install: chmod 644 /usr/local/lib/libfswatch.a
libtool: install: ranlib /usr/local/lib/libfswatch.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
 /bin/mkdir -p '/usr/local/share/doc/libfswatch'
 /usr/bin/install -c -m 644 README.md AUTHORS COPYING LICENSE NEWS '/usr/local/share/doc/libfswatch'
 /bin/mkdir -p '/usr/local/include/libfswatch/c'
 /usr/bin/install -c -m 644 c/libfswatch.h c/cevent.h c/cfilter.h c/cmonitor.h c/error.h '/usr/local/include/libfswatch/c'
 /bin/mkdir -p '/usr/local/include/libfswatch/c++'
 /usr/bin/install -c -m 644 c++/monitor.h c++/inotify_monitor.h c++/poll_monitor.h c++/filter.h c++/event.h c++/libfswatch_exception.h '/usr/local/include/libfswatch/c++'
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2/libfswatch'
make[1]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
make[2]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
 /bin/mkdir -p '/usr/local/bin'
  /bin/bash ./libtool   --mode=install /usr/bin/install -c fswatch '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/fswatch /usr/local/bin/fswatch
 /bin/mkdir -p '/usr/local/bin'
 /usr/bin/install -c scripts/fswatch-run-bash scripts/fswatch-run-zsh '/usr/local/bin'
make  install-exec-hook
make[3]: Entering directory `/home/slang/pkgs/fswatch-1.4.2'
rm /usr/local/bin/fswatch-run
ln -s /usr/local/bin/fswatch-run-bash /usr/local/bin/fswatch-run
make[3]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'
 /bin/mkdir -p '/usr/local/share/doc/fswatch'
 /usr/bin/install -c -m 644 README.bsd README.freebsd README.gnu-build-system README.md README.osx AUTHORS COPYING LICENSE NEWS '/usr/local/share/doc/fswatch'
 /bin/mkdir -p '/usr/local/share/man/man7'
 /usr/bin/install -c -m 644 fswatch.7 '/usr/local/share/man/man7'
make[2]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'
make[1]: Leaving directory `/home/slang/pkgs/fswatch-1.4.2'

$ fswatch
fswatch: error while loading shared libraries: libfswatch.so.0: cannot open shared object file: No such file or directory
emcrisostomo commented 10 years ago

Hi @slang800,

The shared library got installed in the right place (/usr/local/lib) but neither libtool nor make install execute ldconfig. Try executing it (with root privileges):

# ldconfig

so that links and cache to the shared libraries are refreshed. Now, fswatch should work. I know users may argue the installation procedure should do it for you but the GNU Build System does not, and it has its reasons.

Let me know if it works for you.

Cheers, -- Enrico

notslang commented 10 years ago

yep, that fixed it. thanks!