I am testing stereo algorithm in MiddleBury Stereo Evaluation
One of step was to compile the tools in code/as follows.
cd code/imageLib
make
cd ..
make
cd ..
In this case, there is error in first make as follows,
$ make
g++ -O3 -W -Wall -g -c -o ImageIOpng.o ImageIOpng.cpp
ImageIOpng.cpp:19:17: fatal error: png.h: No such file or directory
compilation terminated.
make: *** [<builtin>: ImageIOpng.o] Error 1
and, regarding second make,
$ make
g++ -g -O3 -W -Wall -IimageLib ii.cpp -LimageLib -lImg.i686-g -lpng -lz -o ii
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lImg.i686-g
/usr/lib/gcc/i686-pc-cygwin/5.4.0/../../../../i686-pc-cygwin/bin/ld: cannot find -lpng
collect2: error: ld returned 1 exit status
make: *** [<builtin>: ii] Error 1
In previous step, make worked fine.
So, what was the problem? I downloaded sample algorithm and did not edit/change contents in any file.
png.h is part of libpng16-devel and the specific include
directory must be added to the include path of your project.
$ cygcheck -l libpng16-devel |grep png.h
/usr/include/libpng16/png.h
Related
I've install raylib according to this wiki page.
My Project Folder is look like this:
[this][1]
> ..\build>mingw32-make
g++ ../main.cpp -o test.exe -O2 -Wall -Wno-missing-braces -I ../include/ -L ../lib/ -lraylib -lopeng132 -lgdi32 -lwinmm
D:/Software/raylib/mingw/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopeng132
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:2: default] Error 1```
[1]: https://i.stack.imgur.com/QK2X3.png
It seems you have typed openg132 instead of opengl132. You have mistaken the letter l for the number 1
I am trying to compile some source code but I presented with the following error output after entering "make":
mpicc -c -O3 -I func_pointer.c
gcc: fatal error: no input files
compilation terminated.
make: *** [func_pointer.o] Error 4
I have seen other threads on this website relating to this error output (1, 2, 3). I was in fact experiencing a similar problem previously, which I think I may have solved, where the "make" command was producing:
make: Circular mod_prec.o <- mod_prec.o dependency dropped.
make: Circular mod_prec.o <- mod_prec.o dependency dropped.
make: Circular mod_prec.o <- mod_prec.o dependency dropped.
/usr/bin/cpp -P -C -traditional -DIFORT -P -C -traditional -DWET_DRY -DMULTIPROCESSOR -DLIMITED_NO -DGCN mod_prec.F > mod_prec.f90
mpif90 -c -O3 -I mod_prec.f90
gfortran: fatal error: no input files
compilation terminated.
make: *** [mod_prec.o] Error 4
I followed the steps suggested on this website, which I think may have addressed that issue (I believe I am progressing further through the makefile). Those steps are as follows:
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ which mpif90
/usr/local/bin/mpif90
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpif90 -show
gfortran -I/usr/local/include -pthread -I/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -L/usr/local/lib -lmpi_usempi -lmpi_mpifh -lmpi
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpif90 -V
gfortran: error: unrecognized command line option ‘-V’
gfortran: fatal error: no input files
compilation terminated.
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ export MPI_LOC=/usr/local
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ export MPI_INCLUDE="$MPI_LOC"/includedan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ export MPI_LIB="$MPI_LOC"/lib
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ export LD_LIBRARY_PATH=$MPI_LIB:$LD_LIBRARY_PATH
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ export LIBMPI="-pthread -Wl -rpath -Wl -Wl,--enable-new-dtags -lmpi -lmpi_usempi -lmpi_mpifh -lmpi"
With an additional step of:
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ make clean
/bin/rm -f *.o *.mod *.f90
Which brought me to where I am currently. My instinct is that the solution to my current problem will be similar to that of my previous problem. However, I am new to linux/c/fortran so I am not sure I fully follow the previous solution. As such the following commands produce the following output:
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ which mpicc
/usr/local/bin/mpicc
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpicc -show
gcc -I/usr/local/include -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,--enable-new-dtags -L/usr/local/lib -lmpi
dan#Dan-office ~/FVCOM3.2.2/FVCOM_source $ mpicc -V
gcc: error: unrecognized command line option ‘-V’
gcc: fatal error: no input files
compilation terminated.
Have I failed to correctly define some variables which is leading to this problem? I am conscious that this question is becoming rather long but I can add additional information if it is required such as the makefile (this is long though).
Answering my own question after encountering it again whilst compiling FVCOM on a new hard drive. The issue is, as raised by Etan, the -I flag. In the make.inc file uncomment the LIBDIR and INCDIR variables under local install and comment out the same variables directly above.
I'm trying to compile glui sources in cygwin. When I'm running make I get the following output
g++ -I./ -I./include -I/usr/X11R6/include -c glui_add_controls.cpp
make: execvp: g++: Bad file number
make: *** [glui_add_controls.o] Error 127
But it works perfectly if I just compile this file with
g++ -I./ -I./include -I/usr/X11R6/include -c glui_add_controls.cpp
What can be the problem here?
I had the exact same problem.
Run Cygwin's setup.exe and search for "make". Install.
I am now installing a code on my mac.
The code is from here. Look for "Benchmark and Boundary Detection Code" in this page.
In the readme file, it says:
(1) For the image and segmentation reading routines in the Dataset
directory to work, make sure you edit Dataset/bsdsRoot.m to point to
your local copy of the BSDS dataset.
(2) Run 'gmake install' from this directory to build everything. You
should then probably put the lib/matlab directory in your MATLAB path.
(3) Read the Benchmark/README file.
For the 1st step, I did as suggested.
For the 2nd step, I am pretty confused. I ran command gmake install in MATLAB, however, I got:
gmake
Undefined function or variable 'gmake'.
Actually, before running MATLAB, I installed gmake port through macports.
I just did it in terminal, however, this is what I got...
hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
GNUmakefile-library:26: *** mexSuffix not defined. Stop.
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
hou229:segbench yaozhongsong$
In MATLAB, I also did like this:
!gmake install
/bin/bash: gmake: command not found
How to do the 2nd step in readme file?
Thanks in advance!
#Amro
hou229:segbench yaozhongsong$ cd /Users/yaozhongsong/Documents/MATLAB/segbench
hou229:segbench yaozhongsong$ sudo gmake install
Password:
gmake[1]: execvp: ../Util/gethosttype: Permission denied
gmake[1]: Entering directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
mkdir -p ../lib/matlab
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Exception.cc -o build//Exception.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c String.cc -o build//String.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Random.cc -o build//Random.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Timer.cc -o build//Timer.o
g++ -g -Wall -fPIC -I../include -O3 -DNOBLAS -c Matrix.cc -o build//Matrix.o
Matrix.cc:13:21: error: ieee754.h: No such file or directory
Matrix.cc: In function ‘double nextpow2(double)’:
Matrix.cc:86: error: ‘ieee754_double’ was not declared in this scope
Matrix.cc:86: error: expected `;' before ‘val’
Matrix.cc:87: error: ‘val’ was not declared in this scope
Matrix.cc:88: error: ‘IEEE754_DOUBLE_BIAS’ was not declared in this scope
Matrix.cc: At global scope:
Matrix.cc:48: warning: ‘snan’ defined but not used
Matrix.cc:49: warning: ‘inf’ defined but not used
gmake[1]: *** [build//Matrix.o] Error 1
gmake[1]: Leaving directory `/Users/yaozhongsong/Documents/MATLAB/segbench/Util'
For the "mexSuffix not defined" error, first run mexext inside MATLAB, take that output (I suspect it is mexmaci64), edit the file Util/GNUmakefile-library and add the following at line 24:
mexSuffix := mexmaci64
replace the value with the one you get from mexext
Note: I haven't tested any of this, I am on a Windows machine..
You need to run gmake from the Terminal (command line), not in MATLAB.
I'm trying to compile a program using a third party library, Omnet++ in my case. Apparently "make" does not find a library, but the path it uses is correct as you can see (in the sense that I can see the library under omnet++ source tree)
pv135168:basic Bob$ opp_makemake
Creating Makefile in /Users/Bob/Code/network_sim/basic... Makefile created, running "make depend" to add dependencies... opp_makedep -Y --objdirtree -I. -f Makefile -P\$O/ -- ./*.cc
pv135168:basic Bob$ make
g++ -c -g -Wall
-fno-stack-protector -m32 -DHAVE_PCAP -DXMLPARSER=libxml
-DWITH_PARSIM -DWITH_NETBUILDER -I.
-I/Users/Bob/Code/omnetpp-4.1/include -o out/gcc-debug//txc1.o txc1.cc g++ -m32 -Wl,-rpath,/Users/Bob/Code/omnetpp-4.1/lib -Wl,-rpath,. -o out/gcc-debug//basic out/gcc-debug//txc1.o -Wl,-all_load
-L"/Users/Bob/Code/omnetpp-4.1/lib/gcc"
-L"/Users/Bob/Code/omnetpp-4.1/lib" -u _tkenv_lib -lopptkenvd
-loppenvird -lopplayoutd -u _cmdenv_lib -loppcmdenvd -loppenvird
-loppsimd -lstdc++
ld: library not found for -lopptkenvd
collect2: ld returned 1 exit status make: *** [out/gcc-debug//basic]
Error 1 pv135168:basic Bob$
It's looking in the following directories for a file called libopptkenvd.dylib or libopptkenvd.a:
/Users/Bob/Code/omnetpp-4.1/lib/gcc
/Users/Bob/Code/omnetpp-4.1/lib
Is that file in one of those directories (or in the standard directories like /usr/lib)? I don't see an indication of that in your output.