snavely / bundler_sfm

Bundler Structure from Motion Toolkit
1.55k stars 482 forks source link

How to install build in Mac #32

Open fahadgudu opened 8 years ago

fahadgudu commented 8 years ago

I have tried to install bundler_sfm on my Mac but failed to insatll the build. i am getting this error :( how to get rid of this error?

/Applications/Xcode.app/Contents/Developer/usr/bin/make uname: illegal option -- o usage: uname [-amnprsv] cd lib/5point; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for all'. cd lib/ann_1.1_char; /Applications/Xcode.app/Contents/Developer/usr/bin/make linux-g++-shared cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make linux-g++-shared /Applications/Xcode.app/Contents/Developer/usr/bin/make targets \ "ANNLIB = libANN_char.so" \ "C++ = g++" \ "CFLAGS = -g2 -fPIC" \ "MAKELIB = g++ -shared -o " \ "RANLIB = true" g++ -shared -o libANN_char.so ANN.o brute.o kd_tree.o kd_util.o kd_split.o kd_dump.o kd_search.o kd_pr_search.o kd_fix_rad_search.o bd_tree.o bd_search.o bd_pr_search.o bd_fix_rad_search.o perf.o true libANN_char.so cp libANN_char.so ../.. cp libANN_char.so ../../../bin mv libANN_char.so ../lib cd lib/imagelib; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done forall'. cd lib/matrix; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for all'. cd lib/sba-1.5; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done forall'. cd lib/sfm-driver; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for `all'. cd lib/minpack; /Applications/Xcode.app/Contents/Developer/usr/bin/make gcc -O2 -ffast-math -c -o dpmpar.o dpmpar.f error: invalid value 'f95' in '-x f95' make[1]: * [dpmpar.o] Error 1 make: * [default] Error 2

l3robot commented 8 years ago

Hi faha,

Try to change the command "uname -o" in the main makefile. uname returns information concerning your os. Option "-o" works on linux, but it doesn't seem to work on OS X. Check "man uname" in OS X to select the OS X right option.

snavely commented 8 years ago

Hey Fahad,

Looks like you are missing a Fortran compiler on your machine:

gcc -O2 -ffast-math -c -o dpmparo dpmparf error: invalid value 'f95' in '-x f95'

Not sure what the fortran package is called on Mac, but maybe try installing the gfortran package?

Noah

On Mon, Jan 25, 2016 at 11:39 AM, Émile Robitaille <notifications@github.com

wrote:

Hi faha,

Try to change the command "uname -o" in the main makefile. uname returns information concerning your os. Option "-o" works on linux, but it doesn't seem to work on OS X. Check "man uname" in OS X to select the OS X right option.

— Reply to this email directly or view it on GitHub https://github.com/snavely/bundler_sfm/issues/32#issuecomment-174633771.

gunshi commented 8 years ago

Hi, i installed the gfortran compiler through a binary, for OSX, and install gives that error,

uname: illegal option -- o usage: uname [-amnprsv] cd lib/5point; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for all'. cd lib/ann_1.1_char; /Applications/Xcode.app/Contents/Developer/usr/bin/make linux-g++-shared cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make linux-g++-shared /Applications/Xcode.app/Contents/Developer/usr/bin/make targets \ "ANNLIB = libANN_char.so" \ "C++ = g++" \ "CFLAGS = -g2 -fPIC" \ "MAKELIB = g++ -shared -o " \ "RANLIB = true" g++ -shared -o libANN_char.so ANN.o brute.o kd_tree.o kd_util.o kd_split.o kd_dump.o kd_search.o kd_pr_search.o kd_fix_rad_search.o bd_tree.o bd_search.o bd_pr_search.o bd_fix_rad_search.o perf.o true libANN_char.so cp libANN_char.so ../.. cp libANN_char.so ../../../bin mv libANN_char.so ../lib cd lib/imagelib; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done forall'. cd lib/matrix; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for all'. cd lib/sba-1.5; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done forall'. cd lib/sfm-driver; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for `all'. cd lib/minpack; /Applications/Xcode.app/Contents/Developer/usr/bin/make gcc -O2 -ffast-math -c -o dpmpar.o dpmpar.f error: invalid value 'f95' in '-x f95' make[1]: * [dpmpar.o] Error 1 make: * [default] Error 2

Are you sure it is related to a missing fortran compiler? Thanks!

snavely commented 8 years ago

What happens if you edit bundler_sfm/lib/minpack/Makefile, and replace

FC=gcc

with

FC=gfortran

?

Noah

On Tue, Apr 12, 2016 at 1:53 PM, Gunshi Gupta notifications@github.com wrote:

Hi, i installed the gfortran compiler through a binary, for OSX, and install gives that error,

uname: illegal option -- o usage: uname [-amnprsv] cd lib/5point; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for all'. cd lib/ann_1.1_char; /Applications/Xcode.app/Contents/Developer/usr/bin/make linux-g++-shared cd src ; /Applications/Xcode.app/Contents/Developer/usr/bin/make linux-g++-shared /Applications/Xcode.app/Contents/Developer/usr/bin/make targets \ "ANNLIB = libANN_char.so" \ "C++ = g++" \ "CFLAGS = -g2 -fPIC" \ "MAKELIB = g++ -shared -o " \ "RANLIB = true" g++ -shared -o libANN_char.so ANN.o brute.o kd_tree.o kd_util.o kd_split.o kd_dump.o kd_search.o kd_pr_search.o kd_fix_rad_search.o bd_tree.o bd_search.o bd_pr_search.o bd_fix_rad_search.o perf.o true libANN_char.so cp libANN_char.so ../.. cp libANN_char.so ../../../bin mv libANN_char.so ../lib cd lib/imagelib; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done forall'. cd lib/matrix; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for all'. cd lib/sba-1.5; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done forall'. cd lib/sfm-driver; /Applications/Xcode.app/Contents/Developer/usr/bin/make make[1]: Nothing to be done for `all'. cd lib/minpack; /Applications/Xcode.app/Contents/Developer/usr/bin/make gcc -O2 -ffast-math -c -o dpmpar.o dpmpar.f error: invalid value 'f95' in '-x f95' make[1]: * [dpmpar.o] Error 1 make: * [default] Error 2

Are you sure it is related to a missing fortran compiler? Thanks!

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/snavely/bundler_sfm/issues/32#issuecomment-209097767

gunshi commented 8 years ago

it continues to build for longer, then ends with the error:

g++ -c -o Decompose.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES Decompose.cpp g++ -c -o RelativePose.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES RelativePose.cpp g++ -c -o Distortion.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES Distortion.cpp g++ -c -o TwoFrameModel.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES TwoFrameModel.cpp TwoFrameModel.cpp:210:12: warning: unused variable 'viewdir' [-Wunused-variable] double viewdir[3] = { -R1[2], -R1[5], -R1[8] }; ^ TwoFrameModel.cpp:211:12: warning: unused variable 'twist_angle' [-Wunused-variable] double twist_angle = GetTwist(R1); ^ TwoFrameModel.cpp:61:13: warning: unused function 'WriteCameraPose' [-Wunused-function] static void WriteCameraPose(FILE _f, const camera_params_t &camera) ^ 3 warnings generated. g++ -c -o LoadJPEG.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -D__USE_CERES__ LoadJPEG.cpp LoadJPEG.cpp:23:10: fatal error: 'jpeglib.h' file not found

include

     ^

1 error generated. make[1]: _\ [LoadJPEG.o] Error 1 make: *\ [default] Error 2

snavely commented 8 years ago

Looks like you need to install the libjpeg development library (or equivalent for Mac).

Noah

On Thu, Apr 14, 2016 at 4:02 AM, Gunshi Gupta notifications@github.com wrote:

it continues ti build for longer, then ends with the error:

g++ -c -o Decompose.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES Decompose.cpp g++ -c -o RelativePose.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES RelativePose.cpp g++ -c -o Distortion.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES Distortion.cpp g++ -c -o TwoFrameModel.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -DUSE_CERES TwoFrameModel.cpp TwoFrameModel.cpp:210:12: warning: unused variable 'viewdir' [-Wunused-variable] double viewdir[3] = { -R1[2], -R1[5], -R1[8] }; ^ TwoFrameModel.cpp:211:12: warning: unused variable 'twist_angle' [-Wunused-variable] double twist_angle = GetTwist(R1); ^ TwoFrameModel.cpp:61:13: warning: unused function 'WriteCameraPose' [-Wunused-function] static void WriteCameraPose(FILE

_f, const camera_params_t &camera) ^ 3 warnings generated. g++ -c -o LoadJPEG.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -D__USE_CERES_ LoadJPEG.cpp LoadJPEG.cpp:23:10: fatal error: 'jpeglib.h' file not found #include ^ 1 error generated. make[1]: ** [LoadJPEG.o] Error 1 make: *\ [default] Error 2

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/snavely/bundler_sfm/issues/32#issuecomment-209880162

gunshi commented 8 years ago

I already have it, i get 'warning:jpeg-8d already installed' when i do 'brew install libjpeg'. Or can i force it to build and link to the jpeg library included in 'lib' folder of bundler_sfm?

gunshi commented 8 years ago

I copied the libjpeg.dylib to the bin folder and that error is gone, however I get:

g++ -c -o BundleCeres.o -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/local/include/eigen3 -DNO_UI -DBUNDLER -DBUNDLER_DISTR -D__USE_CERES__ BundleCeres.cpp BundleCeres.cpp:23:10: fatal error: 'omp.h' file not found

include

1 error generated.

I have gcc 5 as part of a brew install, which has tmp.h file. It is linked under usr/local/lib, (instead of /usr/lib which i'm assuming is being searched). How can i give this information (to use this gcc) to the makefile?

gunshi commented 8 years ago

EDIT: When I use CC=gcc-5 CXX=g++-5 in the makefile in the src folder I get the following error:

g++-5 -o bundler -O3 -Wall -Wno-unused-result -std=gnu++0x -I../lib/imagelib -I../lib/sfm-driver -I../lib/matrix -I../lib/5point -I../lib/sba-1.5 -I../lib/ann_1.1_char/include -I../include -I/usr/local/include/eigen3 -L../lib -L../lib/ann_1.1_char/lib \ -DNO_UI -DBUNDLER -DBUNDLER_DISTR -D__USE_CERES__ BaseApp.o BundlerApp.o keys.o Register.o Epipolar.o Bundle.o BundleFast.o MatchTracks.o Camera.o Geometry.o ImageData.o BundleUtil.o BaseGeometry.o BundlerGeometry.o BoundingBox.o BundleAdd.o ComputeTracks.o BruteForceSearch.o BundleIO.o ProcessBundle.o BundleTwo.o Decompose.o RelativePose.o Distortion.o TwoFrameModel.o LoadJPEG.o BundleCeres.o -lceres -lcholmod -lccolamd -lcolamd -lamd -lcamd -lcxsparse -lsuitesparseconfig -lgomp -lglog -lpthread -limage -lsfmdrv -lsba.v1.5 -lmatrix -lz -llapack -lblas -lcblas -lminpack -lm -l5point -ljpeg -lANN_char -lgfortran ld: warning: path '../lib/ann_1.1_char/lib' following -L not a directory ld: library not found for -ljpeg collect2: error: ld returned 1 exit status make[1]: * [bundler] Error 1 make: * [default] Error 2

owang commented 8 years ago

Built okay for me with Noah's comment:

make FC=gfortran CC=gcc-6 CXX=g++-6