Cygwin 'make' command - unix

I'm trying to compile a library using a Unix shell. I'm running Cygwin on Windows. The install instructions for the library state:
cd' to the directory containing the package's source code and type
./configure' to configure the package for your system. If you're
using csh' on an old version of System V, you might need to type
sh ./configure' instead to prevent csh' from trying to execute
configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
Type `make' to compile the package.
<... MORE INSTRUCTIONS FOLLOW ...>
So, I've placed the folder containing the library source into my Cygwin directory, cd'ed to the folder, and run ./configure. This all appears to work fine, but the 'make' command produces the following output:
$ make
make all-recursive
make[1]: Entering directory `/liblo-0.26'
Making all in src
make[2]: Entering directory `/liblo-0.26/src'
Making all in .
make[3]: Entering directory `/liblo-0.26/src'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -
Wall -I.. -g -O2 -MT liblo_la-address.lo -MD -MP -MF .deps/liblo_la-address.Tpo
-c -o liblo_la-address.lo `test -f 'address.c' || echo './'`address.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -Wall -I.. -g -O2 -MT liblo_la-a
ddress.lo -MD -MP -MF .deps/liblo_la-address.Tpo -c address.c -DDLL_EXPORT -DPI
C -o .libs/liblo_la-address.o
In file included from lo_types_internal.h:33,
from address.c:37:
../lo/lo_osc_types.h:32:20: stdint.h: No such file or directory
In file included from address.c:37:
lo_types_internal.h:89: field `addr' has incomplete type
lo_types_internal.h:98: confused by earlier errors, bailing out
make[3]: *** [liblo_la-address.lo] Error 1
make[3]: Leaving directory `/liblo-0.26/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/liblo-0.26/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/liblo-0.26'
make: *** [all] Error 2
What am I doing wrong? Happy to provide more info - but I'm new to Unix shell (as you can probably tell...)

The error is that the header file stdint.h is not found.
stdint.h is a new header, standardized in C99 (The version published in 1999 of the C standard.) It could be that your UNIX does not have it. But cygwin should be recent and have it.
Does your cygwin installation have the C library header files installed?

Related

No rule to make target all.R, needed by compiler.rdb R 3.4.1 from source, Scientific Linux

I am trying to build R from source on Scientific Linux release 6.9 (Carbon), Linux version 2.6.32-696.3.2.el6.x86_64 (Red Hat 4.4.7-18).
I load the needed modules and run:
./configure --prefix $install_dir --with-blas --with-lapack --enable-R-shlib 2>&1 | tee config-R-$version.log
The "configure" command seems to run ok:
R is now configured for x86_64-pc-linux-gnu
Source directory: .
Installation directory: /fastdata/mbp15ja/R-3.4.1
C compiler: gcc -I/usr/local/packages6/compilers/gcc/5.4.0/include
Fortran 77 compiler: gfortran -g -O2
Default C++ compiler: g++ -g -O2
C++98 compiler: g++ -g -O2
C++11 compiler: g++ -std=gnu++11 -g -O2
C++14 compiler: g++ -std=gnu++14 -g -O2
C++17 compiler:
Fortran 90/95 compiler: gfortran -g -O2
Obj-C compiler:
Interfaces supported: X11, tcltk
External libraries: readline, curl
Additional capabilities: PNG, JPEG, NLS, cairo
Options enabled: shared R library, shared BLAS, R profiling
Capabilities skipped: TIFF, ICU
Options not enabled: memory profiling
Recommended packages: yes
I encountered an error running "make -n" with the libtre library not generating libtre.a:
rm -rf libnmath.a
ar -cr libnmath.a mlutils.o d1mach.o i1mach.o fmax2.o fmin2.o fprec.o fround.o ftrunc.o sign.o fsign.o imax2.o imin2.o chebyshev.o log1p.o expm1.o lgammacor.o gammalims.o stirlerr.o bd0.o gamma.o lgamma.o gamma_cody.o beta.o lbeta.o polygamma.o cospi.o bessel_i.o bessel_j.o bessel_k.o bessel_y.o choose.o snorm.o sexp.o dgamma.o pgamma.o qgamma.o rgamma.o dbeta.o pbeta.o qbeta.o rbeta.o dunif.o punif.o qunif.o runif.o dnorm.o pnorm.o qnorm.o rnorm.o dlnorm.o plnorm.o qlnorm.o rlnorm.o df.o pf.o qf.o rf.o dnf.o dt.o pt.o qt.o rt.o dnt.o dchisq.o pchisq.o qchisq.o rchisq.o rnchisq.o dbinom.o pbinom.o qbinom.o rbinom.o rmultinom.o dcauchy.o pcauchy.o qcauchy.o rcauchy.o dexp.o pexp.o qexp.o rexp.o dgeom.o pgeom.o qgeom.o rgeom.o dhyper.o phyper.o qhyper.o rhyper.o dnbinom.o pnbinom.o qnbinom.o rnbinom.o dpois.o ppois.o qpois.o rpois.o dweibull.o pweibull.o qweibull.o rweibull.o dlogis.o plogis.o qlogis.o rlogis.o dnchisq.o pnchisq.o qnchisq.o dnbeta.o pnbeta.o qnbeta.o pnf.o pnt.o qnf.o qnt.o ptukey.o qtukey.o toms708.o wilcox.o signrank.o
ranlib libnmath.a
make[4]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/nmath'
make[3]: *** No rule to make target `../extra/tre/libtre.a', needed by `libR.so'. Stop.
make[3]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src'
make: *** [R] Error 1
I read in here https://www-01.ibm.com/support/docview.wss?uid=swg1IV36656 that the library isn't supposed to make libtre.a and that they assume the file they are looking for is libtre.so
I therefore built the libtre and linked libtre.so from the library to src/extra/tre/libtre.a and now the make
"make -n" now fails with:
if test -f ./NAMESPACE; then \
/usr/bin/install -c -m 644 ./NAMESPACE ../../../library/compiler; \
fi
rm -f ../../../library/compiler/Meta/nsInfo.rds
if test -f DESCRIPTION; then \
if test "" != ""; then \
echo "tools:::.install_package_description('.', '../../../library/compiler', '')" | \
R_DEFAULT_PACKAGES=NULL R_ENABLE_JIT=0 ../../../bin/R --vanilla --slave > /dev/null ; \
else \
echo "tools:::.install_package_description('.', '../../../library/compiler')" | \
R_DEFAULT_PACKAGES=NULL R_ENABLE_JIT=0 ../../../bin/R --vanilla --slave > /dev/null ; \
fi; \
fi
make[4]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/library/compiler'
make mklazycomp
make[4]: Entering directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/library/compiler'
make[4]: *** No rule to make target `all.R', needed by `../../../library/compiler/R/compiler.rdb'. Stop.
make[4]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/library/compiler'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/library/compiler'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src/library'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/data/mbp15ja/R-3.4.1/R-3.4.1/src'
make: *** [R] Error 1
I haven't seen anything regarding all.R and ../../../library/compiler/R/compiler.rdb
Thanks in advance!

Error while building R from source with gcc OpenMP support

I am trying to compile R in a Redhat linux environment on a HPC cluster. I have used environment modules to install recent versions of a number of tools including GCC 5.2.0. I cannot get R to build from the source. It fails with undefined reference to `GOMP_parallel'. When I compile with the --disable-openmp option it compiles fine.
array.o: In function `do_colsum':
array.c:(.text+0x5829): undefined reference to `GOMP_parallel'
collect2: error: ld returned 1 exit status
make[3]: *** [R.bin] Error 1
make[3]: Leaving directory `/scratch/kokul/240763.hpc5/R- 3.2.3/src/main'
make[2]: *** [R] Error 2
make[2]: Leaving directory `/scratch/kokul/240763.hpc5/R- 3.2.3/src/main'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/scratch/kokul/240763.hpc5/R-3.2.3/src'
make: *** [R] Error 1
A couple of questions
What are the advantages of having openMP enabled, I am assuming this will enhance the performance?
How do I fix the error I encounter while building? Is this related to linking the correct library? -fopenmp is correctly used while building. libgomp.* files are also in the $LIBRARY_PATH and $LD_LIBRARY_PATH.
It might be a simple thing I am missing, but I have tried to search for a proper answer without success.
Advanced thanks for any help.
I am having the same problem:
gcc -Wl,--export-dynamic -fopenmp -L/usr/local/lib -o R.bin Rmain.o CommandLineArgs.o Rdynload.o Renviron.o RNG.o agrep.o apply.o arithmetic.o array.o attrib.o bind.o builtin.o character.o coerce.o colors.o complex.o connections.o context.o cum.o dcf.o datetime.o debug.o deparse.o devices.o dotcode.o dounzip.o dstruct.o duplicate.o edit.o engine.o envir.o errors.o eval.o format.o gevents.o gram.o gram-ex.o graphics.o grep.o identical.o inlined.o inspect.o internet.o iosupport.o lapack.o list.o localecharset.o logic.o main.o mapply.o match.o memory.o names.o objects.o options.o paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o printvector.o printutils.o qsort.o radixsort.o random.o raw.o registration.o relop.o rlocale.o saveload.o scan.o seq.o serialize.o sort.o source.o split.o sprintf.o startup.o subassign.o subscript.o subset.o summary.o sysutils.o times.o unique.o util.o version.o g_alab_her.o g_cntrlify.o g_fontdb.o g_her_glyph.o xxxpr.o ls ../unix/*.o ../appl/*.o ../nmath/*.o ../extra/tre/libtre.a -L../../lib -lRblas -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -lgfortran -lm -lquadmath -lreadline -lpcre -llzma -lbz2 -lz -lrt -ldl -lm
array.o: In function do_colsum':
/home/myaccount/Downloads/R-patched/src/main/array.c:1437: undefined reference toGOMP_parallel'
collect2: error: ld returned 1 exit status
Makefile:144: recipe for target 'R.bin' failed
This is a configuration problem from R (autotools problem). My computer has both gcc 4.8 (came with OS) and the latest version gcc 5.2 (I build from source). The gcc 5.2 is located in /usr/local
I saw that R is mixing these two up, and not picking up the 5.2 library locations.
I changed the Makefile (this is only one time fix since the make file is generated by the autotool).
First go to src/main directory. Then edit the Makefile:
143 $(R_binary): $(R_bin_OBJECTS) $(R_bin_DEPENDENCIES)
144 $(MAIN_LINK) -o $# $(R_bin_OBJECTS) $(R_bin_LDADD)
Edite line 144:
144 $(MAIN_LINK) -o $# $(R_bin_OBJECTS) -L/usr/local/lib64 -lgomp $(R_bin_LDADD)
This fixed my problem. I had a hard time filing a bug with the R project. If the R developers saw this, could they fix this at the auto configure level? The auto probing just have to be a little bit smarter.

/usr/local/lib: file not recognized: Is a directory

When installing justniffer on CentOS 6.5,
./configure
works fine, but make gives the following error:
libtool: link: g++ -g -O2 -o justniffer justniffer-main.o justniffer-formatter.o justniffer-utilities.o justniffer-regex.o justniffer-prog_read_file.o /usr/local/lib -L/root/justniffer/lib/libnids-1.21_patched/src -lnids2 -lpcap -L/usr/local/lib -lboost_regex-mt -lboost_program_options -lpython2.6
/usr/local/lib: file not recognized: Is a directory
collect2: ld returned 1 exit status
make[1]: *** [justniffer] Error 1
make[1]: Leaving directory `/root/justniffer/src'
make: *** [all-recursive] Error 1
What's the solution for this?
use./configure LIBS="-I /usr/local/include -L/usr/local/lib" ,then make,it's work!
Having not compile program for so long time, made the same silly mistake:
Like CFLAGS, LIBS, GTK_LIBS etc should be flags e.g. -Lpath, not bare paths. What I used to do is relocate all DIRs to CFLAGS=/I/L Another way to
Spaces should be quoted or escaped like LIBS="-L'c/program files/gtk+/lib'"
LIBS="-Lc/program\ files/gtk+/lib"
vi Makefile and src/Makefile
LIBS = -pthread -lm -lz -ldl -lutil
make & make install
Success!

Including wrong Qt version headers

I am trying to install QT Creator from source on Centos 6. I have installed (what I think are) the Qt5 libraries onto my system using yum. When I check which rpm's are installed I see
[qt-creator-2.8.1-src]# rpm -qa | grep qt
qt5-qtbase-x11-5.1.1-3.el6.x86_64
qt-4.6.2-26.el6_4.x86_64
qt-sqlite-4.6.2-26.el6_4.x86_64
qt-x11-4.6.2-26.el6_4.x86_64
qt5-qtbase-5.1.1-3.el6.x86_64
ibus-qt-1.3.0-2.el6.x86_64
qt3-3.3.8b-30.el6.x86_64
qt5-qtbase-devel-5.1.1-3.el6.x86_64
qt-devel-4.6.2-26.el6_4.x86_64
qt3-devel-3.3.8b-30.el6.x86_64
So qt5 seems to be installed, but so is qt4 and qt3 (perhaps required by some other apps, but this is a pretty plain system). So now I've downloaded the QT Creator source, and am trying to compile. I gave the full path the qt5 qmake (/usr/lib64/qt5/bin/qmake qtcreator.pro) and that worked. But now when I issue the command make I see:
[qt-creator-2.8.1-src]# make
cd src/ && ( test -e Makefile || /usr/lib64/qt5/bin/qmake /usr/src/qtcreator/qt-creator-2.8.1-src/src/src.pro -o Makefile ) && make -f Makefile
make[1]: Entering directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src'
cd libs && make -f Makefile
make[2]: Entering directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src/libs'
cd aggregation && make -f Makefile
make[3]: Entering directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src/libs/aggregation'
g++ -c -pipe -Wall -W -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -DAGGREGATION_LIBRARY -DQT_NO_DEBUG -DQT_SHARED -DQT_TABLET_SUPPORT -DQT_THREAD_SUPPORT -I/usr/lib64/qt-3.3/mkspecs/default -I. -I/src -I\ -I/usr/lib64/qt-3.3/include -o aggregate.o aggregate.cpp
In file included from aggregate.h:33,
from aggregate.cpp:30:
aggregation_global.h:33:21: error: qglobal.h: No such file or directory
In file included from aggregate.cpp:30:
aggregate.h:35:19: error: QObject: No such file or directory
aggregate.h:36:17: error: QList: No such file or directory
aggregate.h:37:17: error: QHash: No such file or directory
aggregate.h:38:26: error: QReadWriteLock: No such file or directory
aggregate.h:39:23: error: QReadLocker: No such file or directory
aggregate.cpp:32:24: error: QWriteLocker: No such file or directory
aggregate.cpp:33:18: error: QDebug: No such file or directory
In file included from aggregate.cpp:30:
aggregate.h:43: error: expected initializer before ‘:’ token
aggregate.cpp:277: error: expected ‘}’ at end of input
make[3]: *** [aggregate.o] Error 1
make[3]: Leaving directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src/libs/aggregation'
make[2]: *** [sub-aggregation] Error 2
make[2]: Leaving directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src/libs'
make[1]: *** [sub-libs] Error 2
make[1]: Leaving directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src'
make: *** [sub-src-make_first-ordered] Error 2
so it looks like make is including the qt 3.3 headers I/usr/lib64/qt-3.3/mkspecs/default). How do I tell make or qmake to use the Qt5 headers/libraries?
I remove the qt3-devel package as suggested below, and now my error changes to:
cd src/ && ( test -e Makefile || /opt/Qt/5.1.1/gcc_64/bin/qmake /usr/src/qtcreator/qt-creator-2.8.1-src/src/src.pro -o Makefile ) && make -f Makefile
make[1]: Entering directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src'
make[1]: *** No rule to make target `/usr/lib64/qt-3.3/mkspecs/default/qmake.conf', needed by `Makefile'. Stop.
make[1]: Leaving directory `/usr/src/qtcreator/qt-creator-2.8.1-src/src'
make: *** [sub-src-make_first-ordered] Error 2
as you can see make is still referencing the qt3 stuff.
The solution for those encountering the same:
Remove qt3-devel
Install qt5-* (otherwise the make process will complain about missing items). You can probably be more selective but after 10 time install individual packages based on make complains, I just put them all in.
run qmake giving the full path to the qt5 version of qmake
run 'qmake -r' not 'qmake qtcreator.pro'

XCode 4 Unimotion

I use Xcode 4, and I currently dont have any iDevice right now to be able to test accelerometer in my application, so I googled for a while and find util named "unimotion". read me file for Unimotion says: "A Makefile is included so all you have to do is cd to the 'unimotion' directory and type 'make'." So I tried, but terminal give me a message
ls: /Developer/SDKs: No such file or directory cc -Wall -Os -g
-isysroot /Developer/SDKs/ -arch i386 -arch ppc -fconstant-cfstrings -c -o unimotion.o unimotion.c clang: warning: not using the clang compiler for the 'powerpc' architecture unimotion.c:72:10: fatal
error: 'IOKit/IOKitLib.h' file not found
include IOKit/IOKitLib.h>
1 error generated. make[1]: * [unimotion.o] Error 1 make: * [sub-unimotion] Error 2
again and again.
So, what am I doing wrong?
Thanks.
Rewrite all occurrences of /Developer/SDKs/ in the 3 Makefiles (calibrate/Makefile, motion/Makefile and unimotion/Makefile) with
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
that should help you. If you're using Xcode 4, you'll probably get further error also
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
as the -arch ppc is not supported there anymore. Just delete every single occurrence of -arch ppc in Makefiles, and it will work.

Resources