Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

source install error: ‘build/php56.unit.so’ and ‘build/php56.unit.so’ are the same file #43

Closed
centminmod opened this issue Sep 23, 2017 · 3 comments

Comments

@centminmod
Copy link

Doing source install and make install command has an error

install: ‘build/php56.unit.so’ and ‘build/php56.unit.so’ are the same file

System:

  • CentOS 7.4 64bit
  • PHP-FPM 5.6.31 source installed
  • Go 1.9 binary
  • Python 2.7 yum installed
./configure
configuring for Linux 3.10.0-693.2.2.el7.x86_64 x86_64
checking for C compiler: gcc
 + using GNU C compiler
 + gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
building an "echo" program
checking for int size ... 4
checking for long size ... 8
checking for long long size ... 8
checking for void * size ... 8
checking for size_t size ... 8
checking for off_t size ... 8
checking for time_t size ... 8
checking for C99 variadic macro ... found
checking for GCC __builtin_expect() ... found
checking for GCC __builtin_unreachable() ... found
checking for GCC __builtin_prefetch() ... not found
checking for GCC __builtin_clz() ... found
checking for GCC __attribute__ visibility ... found
checking for GCC __attribute__ aligned ... found
checking for GCC __attribute__ malloc ... found
checking for GCC __attribute__ packed ... found
checking for GCC builtin atomic operations ... found
checking for posix_memalign() ... found
checking for Linux malloc_usable_size() ... found
checking for alloca() ... found
checking for MAP_ANON ... found
checking for MAP_POPULATE ... found
checking for MAP_PREFAULT_READ ... not found
checking for shm_open() ... found
checking for memfd_create() ... found
checking for Linux clock_gettime(CLOCK_REALTIME_COARSE) ... found
checking for FreeBSD clock_gettime(CLOCK_REALTIME_FAST) ... not found
checking for clock_gettime(CLOCK_REALTIME) ... found
checking for Linux clock_gettime(CLOCK_MONOTONIC_COARSE) ... found
checking for FreeBSD clock_gettime(CLOCK_MONOTONIC_FAST) ... not found
checking for clock_gettime(CLOCK_MONOTONIC) ... found
checking for HP-UX hg_gethrtime() ... not found
checking for struct tm.tm_gmtoff ... found
checking for altzone ... not found
checking for localtime_r() ... found
checking for pthread_yield() ... found
checking for pthread spinlock ... found
checking for pthread spinlock zero initial value ... found but is not working
checking for MacOSX spinlock ... not found
checking for sem_timedwait() ... not found
checking for sem_timedwait() in libpthread ... found
checking for __thread ... found
checking for Linux epoll ... found
checking for Linux signalfd() ... found
checking for Linux eventfd() ... found
checking for kqueue ... not found
checking for Solaris event port ... not found
checking for /dev/poll ... not found
checking for AIX pollset ... not found
checking for AF_INET6 ... found
checking for sockaddr.sa_len ... not found
checking for struct sockaddr size ... 16
checking for struct sockaddr_in size ... 16
checking for struct sockaddr_in6 size ... 28
checking for struct sockaddr_un size ... 110
checking for struct sockaddr_storage size ... 128
checking for socketpair(AF_UNIX, SOCK_SEQPACKET) ... found
checking for struct msghdr.msg_control ... found
checking for sys/filio.h ... not found
checking for ioctl(FIONBIO) ... found
checking for socket(SOCK_NONBLOCK) ... found
checking for accept4() ... found
checking for Linux sendfile() ... found
checking for posix_fadvise() ... found
checking for fcntl(F_READAHEAD) ... not found
checking for fcntl(F_RDAHEAD) ... not found
checking for getrandom() ... not found
checking for ucontext ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for posix_spawn() ... found
checking for setproctitle() ... not found
creating build/Makefile

Configuration summary:

  unit pid file:             "unit.pid"
  unit log file:             "unit.log"
  unit modules path:         "build"
  unit state path:           "build"

  unit control API socket:   "unix:control.unit.sock"

  non-privileged user:          "nobody"
  non-privileged group:         ""

  IPv6 support:                 YES
  Unix domain sockets support:  YES
  debug logging:                NO
./configure go
configuring Go package
checking for Go ... found
 + go version go1.9 linux/amd64
 + Go package path: "/root/golang/packages"
./configure php --module=php56 --config=/usr/local/bin/php-config
configuring PHP module
checking for PHP ... found
 + PHP version: 5.6.31
 + PHP SAPI: [cli embed fpm cgi]
checking for PHP embed SAPI ... found
 + PHP module: php56.unit.so
./configure python
configuring Python module
checking for Python ... found
checking for Python version ... 2.7.5
 + Python module: python.unit.so

after make all ran make install

make install
install -d sbin
install -p build/unitd sbin/
install -d /root/golang/packages/src/unit
install -p -m644 ./src/go/unit/* /root/golang/packages/src/unit/
CGO_CFLAGS="-I/svr-setup/unit/build -I/svr-setup/unit/src" \
        CGO_LDFLAGS="-L/svr-setup/unit/build -lrt" \
        GOPATH=/root/golang/packages \
        go install -v unit
unit
install -d build
install -p build/php56.unit.so \
        build/
install: ‘build/php56.unit.so’ and ‘build/php56.unit.so’ are the same file
make: *** [php56-install] Error 1

build directory

ls -lah build/  
total 7.1M
drwxr-xr-x 4 root root 4.0K Sep 23 05:14 .
drwxr-xr-x 8 root root 4.0K Sep 23 05:13 ..
-rw-r--r-- 1 root root  350 Sep 23 05:13 autoconf.data
-rw-r--r-- 1 root root  20K Sep 23 05:14 autoconf.err
-rwxr-xr-x 1 root root 8.4K Sep 23 05:13 echo
-rw-r--r-- 1 root root 4.8M Sep 23 05:14 libnxt.a
-rw-r--r-- 1 root root  28K Sep 23 05:14 Makefile
-rw-r--r-- 1 root root 4.7K Sep 23 05:14 nxt_auto_config.h
-rw-r--r-- 1 root root 206K Sep 23 05:14 nxt_go_gen.a
-rw-r--r-- 1 root root 2.6K Sep 23 05:14 nxt_go_gen.h
-rwxr-xr-x 1 root root  76K Sep 23 05:14 php56.unit.so
-rwxr-xr-x 1 root root  91K Sep 23 05:14 python.unit.so
drwxr-xr-x 2 root root 4.0K Sep 23 05:14 src
drwxr-xr-x 2 root root    6 Sep 23 05:13 test
-rwxr-xr-x 1 root root 1.9M Sep 23 05:14 unitd

PHP 5.6.31 configuration

php-config 
Usage: /usr/local/bin/php-config [OPTION]
Options:
  --prefix            [/usr/local]
  --includes          [-I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib]
  --ldflags           []
  --libs              [-lcrypt  -lc-client  -lz -lexslt -ltidy -lresolv -lcrypt -ledit -lncurses -laspell -lpspell -lrt -lmcrypt -lltdl -lldap -llber -lstdc++ -lcrypt -lpam -lgmp -lt1 -lX11 -lXpm -lpng -lz -ljpeg -lvpx -lenchant -lcurl -lbz2 -lz -lrt -lm -ldl -lnsl  -lxml2 -lz -lm -ldl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -lcurl -lxml2 -lz -lm -ldl -lssl -lcrypto -lfreetype -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lssl -lcrypto -ldl -lm -licui18n -licuuc -licudata -ldl -lm -licuio -lxml2 -lz -lm -ldl -lnetsnmp -lssl -lssl -lcrypto -lm -lxml2 -lz -lm -ldl -lcrypt -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxml2 -lz -lm -ldl -lxslt -lxml2 -lz -ldl -lm -lssl -lcrypto -lcrypt ]
  --extension-dir     [/usr/local/lib/php/extensions/no-debug-non-zts-20131226]
  --include-dir       [/usr/local/include/php]
  --man-dir           [/usr/local/php/man]
  --php-binary        [/usr/local/bin/php]
  --php-sapis         [ cli embed fpm cgi]
  --configure-options [--enable-fpm --enable-opcache --enable-intl --enable-pcntl --with-mcrypt --with-snmp --enable-embed=shared --with-mhash --with-zlib --with-gettext --enable-exif --enable-zip --with-bz2 --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-shmop --with-pear --enable-mbstring --with-openssl --with-mysql=mysqlnd --with-libdir=lib64 --with-mysqli=mysqlnd --with-mysql-sock=/var/lib/mysql/mysql.sock --with-curl --with-gd --with-xmlrpc --enable-bcmath --enable-calendar --enable-ftp --enable-gd-native-ttf --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-vpx-dir=/usr --with-t1lib=/usr --enable-pdo --with-pdo-sqlite --with-pdo-mysql=mysqlnd --enable-inline-optimization --with-imap --with-imap-ssl --with-kerberos --with-readline --with-libedit --with-gmp --with-pspell --with-tidy --with-enchant --with-fpm-user=nginx --with-fpm-group=nginx --disable-fileinfo --with-ldap --with-ldap-sasl --with-config-file-scan-dir=/etc/centminmod/php.d --with-xsl CC=ccache CFLAGS=-O3 -m64 -march=core-avx-i -pipe -gsplit-dwarf CXX=ccache CXXFLAGS=-O3 -m64 -march=core-avx-i -pipe -gsplit-dwarf]
  --version           [5.6.31]
  --vernum            [50631]
@centminmod
Copy link
Author

so from #36 correct way would be to set DESTDIR for make install i.e.

make install DESTDIR=/opt/unit
install -d /opt/unitsbin
install -p build/unitd /opt/unitsbin/
install -d /opt/unit/root/golang/packages/src/unit
install -p -m644 ./src/go/unit/* /opt/unit/root/golang/packages/src/unit/
CGO_CFLAGS="-I/svr-setup/unit/build -I/svr-setup/unit/src" \
        CGO_LDFLAGS="-L/svr-setup/unit/build -lrt" \
        GOPATH=/opt/unit/root/golang/packages \
        go install -v unit
unit
install -d /opt/unitbuild
install -p build/python.unit.so \
        /opt/unitbuild/
install -d /opt/unitbuild
install -p build/php5631.unit.so \
        /opt/unitbuild/

@igorsysoev
Copy link
Contributor

Instead of DESTDIR it is better to specify prefix or full names at configure stage:
./configure --prefix=/opt/unit --pid=/var/unit.pid --log=/var/log/unit.log --modules=modules --state=state

DESTDIR is intended to be used by package builders.

@centminmod
Copy link
Author

centminmod commented Sep 23, 2017

thanks @igorsysoev changed Unit configure to

./configure --prefix=/opt/unit --pid=/run/unitd.pid --log=/var/log/unitd.log --modules=modules --user=nginx --group=nginx --state=state
./configure --prefix=/opt/unit --pid=/run/unitd.pid --log=/var/log/unitd.log --modules=modules --user=nginx --group=nginx --state=state
configuring for Linux 3.10.0-693.2.2.el7.x86_64 x86_64
checking for C compiler: ccache gcc
auto/cc/test: line 16: [: /usr/local/bin/ccache: binary operator expected
 + using GNU C compiler
 + gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 
building an "echo" program
checking for int size ... 4
checking for long size ... 8
checking for long long size ... 8
checking for void * size ... 8
checking for size_t size ... 8
checking for off_t size ... 8
checking for time_t size ... 8
checking for C99 variadic macro ... found
checking for GCC __builtin_expect() ... found
checking for GCC __builtin_unreachable() ... found
checking for GCC __builtin_prefetch() ... not found
checking for GCC __builtin_clz() ... found
checking for GCC __attribute__ visibility ... found
checking for GCC __attribute__ aligned ... found
checking for GCC __attribute__ malloc ... found
checking for GCC __attribute__ packed ... found
checking for GCC builtin atomic operations ... found
checking for posix_memalign() ... found
checking for Linux malloc_usable_size() ... found
checking for alloca() ... found
checking for MAP_ANON ... found
checking for MAP_POPULATE ... found
checking for MAP_PREFAULT_READ ... not found
checking for shm_open() ... found
checking for memfd_create() ... found
checking for Linux clock_gettime(CLOCK_REALTIME_COARSE) ... found
checking for FreeBSD clock_gettime(CLOCK_REALTIME_FAST) ... not found
checking for clock_gettime(CLOCK_REALTIME) ... found
checking for Linux clock_gettime(CLOCK_MONOTONIC_COARSE) ... found
checking for FreeBSD clock_gettime(CLOCK_MONOTONIC_FAST) ... not found
checking for clock_gettime(CLOCK_MONOTONIC) ... found
checking for HP-UX hg_gethrtime() ... not found
checking for struct tm.tm_gmtoff ... found
checking for altzone ... not found
checking for localtime_r() ... found
checking for pthread_yield() ... found
checking for pthread spinlock ... found
checking for pthread spinlock zero initial value ... found but is not working
checking for MacOSX spinlock ... not found
checking for sem_timedwait() ... not found
checking for sem_timedwait() in libpthread ... found
checking for __thread ... found
checking for Linux epoll ... found
checking for Linux signalfd() ... found
checking for Linux eventfd() ... found
checking for kqueue ... not found
checking for Solaris event port ... not found
checking for /dev/poll ... not found
checking for AIX pollset ... not found
checking for AF_INET6 ... found
checking for sockaddr.sa_len ... not found
checking for struct sockaddr size ... 16
checking for struct sockaddr_in size ... 16
checking for struct sockaddr_in6 size ... 28
checking for struct sockaddr_un size ... 110
checking for struct sockaddr_storage size ... 128
checking for socketpair(AF_UNIX, SOCK_SEQPACKET) ... found
checking for struct msghdr.msg_control ... found
checking for sys/filio.h ... not found
checking for ioctl(FIONBIO) ... found
checking for socket(SOCK_NONBLOCK) ... found
checking for accept4() ... found
checking for Linux sendfile() ... found
checking for posix_fadvise() ... found
checking for fcntl(F_READAHEAD) ... not found
checking for fcntl(F_RDAHEAD) ... not found
checking for getrandom() ... not found
checking for ucontext ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for posix_spawn() ... found
checking for setproctitle() ... not found
creating build/Makefile

Configuration summary:

  unit pid file:             "/run/unitd.pid"
  unit log file:             "/var/log/unitd.log"
  unit modules path:         "/opt/unit/modules"
  unit state path:           "/opt/unit/state"

  unit control API socket:   "unix:/opt/unit/control.unit.sock"

  non-privileged user:          "nginx"
  non-privileged group:         "nginx"

  IPv6 support:                 YES
  Unix domain sockets support:  YES
  debug logging:                NO

resulted in make install

make install
install -d /opt/unit/sbin
install -p build/unitd /opt/unit/sbin/
install -d /opt/unit/modules
install -p build/php5631.unit.so \
        /opt/unit/modules/
install -d /root/golang/packages/src/unit
install -p -m644 ./src/go/unit/* /root/golang/packages/src/unit/
CGO_CFLAGS="-I/svr-setup/unit/build -I/svr-setup/unit/src" \
        CGO_LDFLAGS="-L/svr-setup/unit/build -lrt" \
        GOPATH=/root/golang/packages \
        go install -v unit
install -d /opt/unit/modules
install -p build/python.unit.so \
        /opt/unit/modules/

and

ls -lah /opt/unit/
total 0
drwxr-xr-x  5 root root 66 Sep 23 10:03 .
drwxr-xr-x. 4 root root 32 Sep 23 10:02 ..
srw-------  1 root root  0 Sep 23 10:03 control.unit.sock
drwxr-xr-x  2 root root 49 Sep 23 10:01 modules
drwxr-xr-x  3 root root 19 Sep 23 05:33 root
drwxr-xr-x  2 root root 18 Sep 23 10:01 sbin
/opt/unit/sbin/unitd --version
unit version: 0.1
configured as ./configure --prefix=/opt/unit --pid=/run/unitd.pid --log=/var/log/unitd.log --modules=modules --user=nginx --group=nginx --state=state

Cheers !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants