Skip to content

Instantly share code, notes, and snippets.

@davidmason
Created September 13, 2017 03:45
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save davidmason/5b9c43202ad4c4ff562badbf2a25ae68 to your computer and use it in GitHub Desktop.
Save davidmason/5b9c43202ad4c4ff562badbf2a25ae68 to your computer and use it in GitHub Desktop.
To install watchman on Fedora 26, these are all the hoops I had to jump through.
# The following packages are needed during `make`
# - openssl-devel so you don't get:
# ContentHash.cpp:13:10: fatal error: openssl/sha.h: No such file or directory
# - redhat-rpm-config so you don't get:
# gcc: error: /usr/lib/rpm/redhat/redhat-hardened-cc1: No such file or directory
# - python-devel so you don't get:
# pywatchman/bser.c:31:10: fatal error: Python.h: No such file or directory
sudo dnf install openssl-devel redhat-rpm-config python-devel
# The rest is just instructions from
# https://codeyarns.com/2015/02/10/how-to-install-and-use-watchman/
git clone https://github.com/facebook/watchman.git
cd watchman
./autogen.sh
./configure
make
sudo make install
@Hunter21007
Copy link

Hi, i also had to do

sudo dnf install libtool clang

on default install of fc26

just FYI :)

@Hunter21007
Copy link

and from scst this improvement to make command:

make -j$(ls -1d /sys/devices/system/cpu/cpu[0-9]* | wc -l)

uses all cpus for compiling (if needed)

@TimDorand
Copy link

Install libssl-dev package
Works on Ubuntu

sudo apt-get install libssl-dev

@ngochibamu
Copy link

On ubuntu 17.04, I was missing libssl-dev. TimDorand solution worked perfectly. happy coding.

@iampeterbanjo
Copy link

👍

@vladp
Copy link

vladp commented Apr 3, 2018

FYI, the above steps do not work for Fedora 27
I do not have a solution for this, unfortunately.

./configure
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in /home/v/devel/other/watchman': configure: error: C compiler cannot create executables See config.log' for more details

Problem seems to be in how a compiler is being detected.

gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3616: $? = 0
configure:3605: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,objc,obj-c++,fortran,ada,go,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)
configure:3616: $? = 0
configure:3605: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3616: $? = 1
configure:3605: gcc -qversion >&5
> gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:3616: $? = 1
configure:3636: checking whether the C compiler works
configure:3658: gcc -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE conftest.c >&5
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/7/../../../libc.so when searching for -lc
/usr/bin/ld: skipping incompatible //lib/libc.so when searching for -lc
/usr/bin/ld: skipping incompatible //usr/lib/libc.so when searching for -lc
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
configure:3662: $? = 1
configure:3700: result: no
configure: failed program was:
| /* confdefs.h /
| #define PACKAGE_NAME "watchman"
| #define PACKAGE_TARNAME "watchman"
| #define PACKAGE_VERSION "4.9.1"
| #define PACKAGE_STRING "watchman 4.9.1"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "watchman"
| #define VERSION "4.9.1"
| /
end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:3705: error: in /home/v/devel/other/watchman': configure:3707: error: C compiler cannot create executables See config.log' for more details

@vladp
Copy link

vladp commented Apr 3, 2018

My initial assessment of -qversion GCC version incomatibility was wrong.
It seems like there are bunch of other libraries (especially, see the last 3 entries) that were missing from Fedora 27

dnf groupinstall "Development Tools" "Development Libraries"
dnf install libtool
dnf install openssl-devel redhat-rpm-config python-devel
dnf install glibc-static
dnf install glibc-headers
dnf install glibc-devel.x86_64

and then do

raise inotify limit

echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_watches
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_queued_events
echo 999999 | sudo tee -a /proc/sys/fs/inotify/max_user_instances

watchman shutdown-server

otherwise, if you use say ReactNative,
the npm start
will hang without an explanation

@ballPointPenguin
Copy link

I'm having trouble on Fedora 28

dnf groupinstall "Development Tools" "Development Libraries"

that will install hundreds of packages. Does anyone know more specifically which ones are required? it would be nice to not install everything in those groups.

@ballPointPenguin
Copy link

well I installed those two groups and I'm still getting the same error.

I'm taking my issue here: facebook/watchman#607

@ErimTuzcuoglu
Copy link

libssl-dev solution working and i also installed libcrypto++-dev package.After that, i did ./autogen.sh , ./configure and make again.

@spolat
Copy link

spolat commented Aug 31, 2018

For apt (Ubuntu, Debian…):

sudo apt-get install python-dev   # for python2.x installs
sudo apt-get install python3-dev  # for python3.x installs

For yum (CentOS, RHEL…):

sudo yum install python-devel   # for python2.x installs
sudo yum install python34-devel   # for python3.4 installs

For dnf (Fedora…):

sudo dnf install python2-devel  # for python2.x installs
sudo dnf install python3-devel  # for python3.x installs

For zypper (openSUSE…):

sudo zypper in python-devel   # for python2.x installs
sudo zypper in python3-devel  # for python3.x installs

Repeat this following action
$ ./configure
$ make
$ sudo make install

Source

@MoussaOudihat
Copy link

for centos:
yum groupinstall "Development Tools"
yum install libtool
yum install openssl-devel redhat-rpm-config python-devel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment