make install generates file exists error - makefile

I am trying to compile and create an executable of this tool, did a ./configure and then make and then make install, however during the process I got this error:
test -z "/usr/local/bin" || ./install-sh -c -d "/usr/local/bin"
mkdir: /usr/local/bin: File exists
make[1]: *** [install-binPROGRAMS] Error 1
make: *** [install-am] Error 2
Any idea on how to get around this?

You appear to have a file named /usr/local/bin. Remove it like so:
rm /usr/local/bin

Related

fatal error: stddef.h: No such file or directory, but the file was in gcc include folder

I'm trying to cross-compile SPL with riscv64 GCC.
but something wrong with it.
how can I solve this?
thanks.
error as follow:
nihao#f857f8f304e4:~/sdk/tina-d1-open_new/sun20i_d1_spl$ make CROSS_COMPILE=riscv64-unknown-linux-gnu- p=sun20iw1p1 mmc
===This not's tina environment, use command make.===
sh /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/tools/generate_hash_header_file.sh > /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h.tmp
fatal: No names found, cannot describe anything.
if [ -r /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h ] && cmp -s /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h.tmp; then rm -f /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h.tmp; else echo ' UPD /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h'; mv /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h.tmp /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/commit_info.h; fi
make -C /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/nboot mmc
CHK /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/config.h
CHK /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/autoconf.mk
make -C /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/arch/riscv/cpu/riscv64/
In file included from /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/linux/types.h:6,
from /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/common.h:11,
from arch_timer.c:9:
/home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/include/arch/riscv/asm/types.h:31:10: fatal error: stddef.h: No such file or directory
#include <stddef.h>
^~~~~~~~~~
compilation terminated.
make[2]: *** [/home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/mk/config.mk:110: arch_timer.o] Error 1
make[1]: *** [Makefile:108: /home/nihao/sdk/tina-d1-open_new/sun20i_d1_spl/arch/riscv/cpu/riscv64/libarch.o] Error 2
make: *** [Makefile:83: mmc] Error 2
#### make failed to build some targets ####
the gcc include folder:
nihao#f857f8f304e4:~/sdk/tina-d1-open_new/sun20i_d1_spl$ riscv64-unknown-linux-gnu-gcc --print-file-name=include
/home/nihao/sdk/tina-d1-open_new/lichee/brandy-2.0/tools/toolchain/riscv64-linux-x86_64-20200528/bin/../lib/gcc/riscv64-unknown-linux-gnu/8.1.0/include
the stddef.h was in the folder:
nihao#f857f8f304e4:~/sdk/tina-d1-open_new/sun20i_d1_spl$ ls /home/nihao/sdk/tina-d1-open_new/lichee/brandy-2.0/tools/toolchain/riscv64-linux-x86_64-20200528/bin/../lib/gcc/riscv64-unknown-linux-gnu/8.1.0/include
float.h gcov.h iso646.h omp.h openacc.h riscv-vector.h stdalign.h stdarg.h stdatomic.h stdbool.h stddef.h stdfix.h stdint-gcc.h stdint.h stdnoreturn.h unwind.h varargs.h

Problems with compilation ICU with MinGW-w64 on Windows

I tried to compile ICU 59.1 with MinGW-w64 according to Qt manual (MinGW-64-bit). Unfortunately, I got the following error:
$ make && make install
rebuilding config/icucross.mk
rebuilding config/icucross.inc
cd ./config; \
make -f pkgdataMakefile
make[1]: вход в каталог «/c/Qt-deps/icu-59_1/source/config»
*** ERROR - configure could not detect your platform
*** see the readme.html
*** or, try copying icu/source/config/mh-linux to mh-unknown
*** and editing it.
exit 1
rm -rf pkgdata.inc
make[1]: выход из каталога «/c/Qt-deps/icu-59_1/source/config»
rm -rf config/icu-config
/usr/bin/install -c ./config/icu-config-top config/icu-config
chmod u+w config/icu-config
LC_ALL=C /usr/bin/sed -f ./config/make2sh.sed < ./config/Makefile.inc | grep -v '#M#' | uniq >> config/icu-config
LC_ALL=C /usr/bin/sed -f ./config/make2sh.sed < ./config/mh-unknown | grep -v '#M#' | uniq >> config/icu-config
cat ./config/icu-config-bottom >> config/icu-config
chmod u-w config/icu-config
config/icu-uc.pc updated.
config/icu-i18n.pc updated.
config/icu-io.pc updated.
Note: rebuild with "make VERBOSE=1 " to show all compiler parameters.
/bin/sh ./mkinstalldirs lib
mkdir lib
/bin/sh ./mkinstalldirs bin
mkdir bin
make[0]: Making `all' in `stubdata'
make[1]: вход в каталог «/c/Qt-deps/icu-59_1/source/stubdata»
*** ERROR - configure could not detect your platform
*** see the readme.html
*** or, try copying icu/source/config/mh-linux to mh-unknown
*** and editing it.
exit 1
make[1]: выход из каталога «/c/Qt-deps/icu-59_1/source/stubdata»
make: *** [Makefile:147: all-recursive] Ошибка 2
I have tried to compile it twice on two different computers: the 1st one - Windows 10 Pro, the last one - Windows 7 Ultimate. Results are the same. Used tools: MSYS2 x64 (20161025). So, what am I doing wrong?
The error "configure could not detect your platform" can probably be fixed by passing the arguments --build=$MINGW_CHOST --host=$MINGW_CHOST to the configure script. If you are in the right type of MSYS2 shell, $MINGW_CHOST should be i686-w64-mingw32 or x86_64-w64-mingw32
For more useful tips for building ICU, look at the build script that the MSYS2 developers have crafted:
https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-icu
I have fixed the same issue (except that used ICU 55.1) replacing ../source/config/mh-unknown with the contents of ../source/config/mh-mingw64
I have build icu with same problem.
I have run this script for correct the problem:
del M:\work\code\qt\icu4c-68_2\icu4c\source\config\mh-unknow
copy M:\work\code\qt\icu4c-68_2\icu4c\source\config\mh-msys-msvc M:\work\code\qt\icu4c-68_2\icu4c\source\config\mh-unknow

Can't build latest libcurl on RHEL 7.3

What's the proper way to fix this compilation error so I can install the latest libcurl on RHEL 7.3?
I've been able to get the latest openssl, build, and install it. OpenSSL 1.1.1-dev xx XXX xxxx is reported by openssl version now. Latest curl is cloned/pulled from https://github.com/curl/curl.git. Here's the bash script fragment I'm using:
CD=$(pwd)
CPPFLAGS="-I$CD/zlib -I$CD/openssl -I$CD/openssl/include"
LDFLAGS="-L$CD/zlib -L$CD/openssl"
LIBS="-ldl"
cd curl
./buildconf
./configure --disable-shared --with-zlib --with-ssl
make
make install
Running the batch with sudo, make completes without errors. make install produces this:
CC libcurl_la-openssl.lo
vtls/openssl.c: In function 'Curl_ossl_seed':
vtls/openssl.c:279:5: error: implicit declaration of function 'RAND_egd' [-
Werror=implicit-function-declaration]
int ret = RAND_egd(data->set.str[STRING_SSL_EGDSOCKET]?
^
cc1: some warnings being treated as errors
make[2]: *** [libcurl_la-openssl.lo] Error 1
make[2]: Leaving directory `/home/john/curl/lib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/john/curl/lib'
make: *** [all-recursive] Error 1
RAND_egd() is no longer part of the default OpenSSL install. See this git commit. You can fix the problem by adding enable-egd in the configure command.
Edit: Updated with cleaner version
Here's steps for building curl with the latest openssl
CD=$(pwd)
echo Setting up openssl
if [ ! -d openssl ]; then
git clone https://github.com/openssl/openssl.git
cd openssl
else
cd openssl
git pull
fi
# you may not need -Wl,--enable-new-dtags but it works for me
./config -Wl,--enable-new-dtags --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
make depend
make
sudo make install
cd ..
lib=zlib-1.2.11
echo Setting up zlib
if [ ! -d zlib ]; then
wget http://zlib.net/$lib.tar.gz
tar xzvf $lib.tar.gz
mv $lib zlib
fi
cd zlib
./configure
make
cd ..
echo Setting up curl ...
CD=$(pwd)
if [ ! -d curl ]; then
git clone https://github.com/curl/curl.git
cd curl
else
cd curl
git pull
fi
cd curl
./buildconf
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig LIBS="-ldl" ./configure --with-
zlib=$CD/zlib --disable-shared
make
# I use local curl build without installing it
# make install
cd ..
I sincerely hope this helps someone else.

libtoolize: error: cannot list files

I was installing libtool 2.4.6 and ran into the following problem:
libtool: Version mismatch error. This is libtool 2.4.6, revision 2.4.6,
libtool: but the definition of this LT_INIT comes from revision .
libtool: You should recreate aclocal.m4 with macros from revision 2.4.6
libtool: of libtool 2.4.6 and run autoconf again.
Makefile:1261: recipe for target 'libltdl/loaders/libltdl_libltdl_la-preopen.lo' failed
In an effort to fix this issue and after looking around on google, I executed the following command to recreate aclocal.m4. however, I got "cannot list files" error:
[server]# autoreconf --install
libtoolize: error: cannot list files: '/var/tmp/work/libtool-2.4.6.i386/share/libtool/build-aux'
autoreconf: libtoolize failed with exit status: 1
the directory was there and can be listed with ls command:
[server]# ls -l /var/tmp/work/libtool-2.4.6.i386/share/libtool/build-aux
total 0
Any idea?
this was cause by the line in libtoolize script:
test -n "`{ cd $my_dir && ls; } 2>/dev/null`" \
|| func_fatal_error "cannot list files: '$my_dir'"
I don't know why it interpret a empty directory as "cannot list files"
the issue can be overcome by replacing the above line with:
cd $my_dir && ls || func_fatal_error "cannot list files: '$my_dir'"

Permission denied when trying to install gcc, even if logged as root

I'm trying to install gcc 4.7.0 on ubuntu 10.04 following that tutorial http://www.tellurian.com.au/whitepapers/multiplegcc.php. After some time to install the dependencies, I've been able to run make without errors, but the final step, make install doesn't want to succeed, it end up with permission denied.
Here's what I did :
../gcc-4.7.0/configure --prefix=/usr/local/gcc/4.7.7 --enable-languages=c,c++
make
su -l
cd /groups/gobj
make install
the result for the last command :
make[1]: Entering directory `/groups/gobj'
/bin/bash ../gcc-4.7.0/mkinstalldirs /usr/local/gcc/4.7.7 /usr/local/gcc/4.7.7
make[2]: Entering directory `/groups/gobj/fixincludes'
rm -rf /usr/local/gcc/4.7.7/libexec/gcc/x86_64-unknown-linux-gnu/4.7.0/install-tools
/bin/bash ../../gcc-4.7.0/fixincludes/../mkinstalldirs /usr/local/gcc/4.7.7/libexec
...
rm -f /usr/local/gcc/4.7.7/share/info/gccinstall.info
if [ -f doc/gccinstall.info ]; then \
for f in doc/gccinstall.info*; do \
realfile=`echo $f | sed -e 's|.*/\([^/]*\)$|\1|'`; \
/usr/bin/install -c -m 644 $f /usr/local/gcc/4.7.7/share/info/$realfile; \
chmod a-x /usr/local/gcc/4.7.7/share/info/$realfile; \
done; \
else true; fi
if /bin/bash -c 'install-info --version' >/dev/null 2>&1; then \
if [ -f /usr/local/gcc/4.7.7/share/info/gccinstall.info ]; then \
install-info --dir-file=/usr/local/gcc/4.7.7/share/info/dir /usr/local/gcc/4.7.7/share/info/gccinstall.info; \
else true; fi; \
else true; fi;
build/genhooks -d \
../../gcc-4.7.0/gcc/doc/tm.texi.in > tmp-tm.texi
/bin/bash: tmp-tm.texi: Permission denied
make[2]: *** [s-tm-texi] Error 1
make[2]: Leaving directory `/groups/gobj/gcc'
make[1]: *** [install-gcc] Error 2
make[1]: Leaving directory `/groups/gobj'
make: *** [install] Error 2
I've already tried su root, su -, su without succes. Some files are effectively copied to /usr/local/gcc/4.7.0 but the process stopped and I don't understand why as I'm logged as root. I've checked, the file /groups/gcc-4.7.0/gcc/doc/tm.texi.in exists. Any help ?
As puzzling as it sounds that the superuser "root" cannot create files while a normal user can, a likely scenario is that your build directory (that is, the directory in which you ran "make install") is being served from an NFS server, and it is probably mounted such that the server doesn't trust your build machine's request to write files as root.
As a simple test see if you can write an empty file to the build directory by running touch test as root. If that fails then you've found the source of the problem. Another way to confirm it is to check the output of "mount" at at least confirm that your build directory is being served via NFS.
server:/groups 20G 948M 19G 5% /groups
If you see a line like this in the mount output then you know for certain that your build directory is being NFS mounted. To tell whether or not root is being trusted, however, you'll ultimately have to check the settings on the NFS server.
Fixing the problem
The fastest way to fix this issue is to find a local filesystem on your build machine and move the contents of your build directory there, then re-run "make install".
Did you tried sudo?
sudo make install
Edit:
As root, you can add yourself to sudoers.
If you can't get root via sudo, try either
su - root
or
ssh root#...

Resources