Skip to content

libpba.so failed to build - macOS Catalina 10.15.1 - fatal error: stdlib.h: No such file or directory #58

Description

@mikeroberts3000

Hello there,

Thank you for your great work in creating this installer. I have used this installer successfully in the past. Now I am trying to use it again on a new workstation running macOS Catalina 10.15.1. I am encountering a build error that I don't know how to fix.

Note that I needed to apply the workaround described here so the installer could build SiftGPU. Now I am getting into trouble when the installer attempts to build PBA.

...
LIB_PBA is present, skipping download and unzip, removing old dir to install so we don't have any conflicts
Archive:  pba_v1.0.5.zip
   creating: pba/
   creating: pba/bin/
  inflating: pba/bin/driver_x64.exe  
  inflating: pba/bin/pba.dll         
  inflating: pba/bin/pba_x64.dll     
  inflating: pba/COPYING             
   creating: pba/data/
   creating: pba/doc/
  inflating: pba/doc/manual.pdf      
  inflating: pba/doc/readme.txt      
  inflating: pba/History.txt         
  inflating: pba/makefile            
  inflating: pba/makefile_no_gpu     
   creating: pba/msvc/
   creating: pba/msvc/driver/
  inflating: pba/msvc/driver/driver.vcxproj  
   creating: pba/msvc/pba/
  inflating: pba/msvc/pba.sln        
  inflating: pba/msvc/pba.suo        
 extracting: pba/msvc/pba/pba.def    
  inflating: pba/msvc/pba/pba.vcxproj  
   creating: pba/src/
   creating: pba/src/driver/
  inflating: pba/src/driver/driver.cpp  
   creating: pba/src/pba/
  inflating: pba/src/pba/ConfigBA.cpp  
  inflating: pba/src/pba/ConfigBA.h  
  inflating: pba/src/pba/CuTexImage.cpp  
  inflating: pba/src/pba/CuTexImage.h  
  inflating: pba/src/pba/DataInterface.h  
  inflating: pba/src/pba/interface.h  
  inflating: pba/src/pba/pba.cpp     
  inflating: pba/src/pba/pba.h       
  inflating: pba/src/pba/ProgramCU.cu  
  inflating: pba/src/pba/ProgramCU.h  
  inflating: pba/src/pba/SparseBundleCPU.cpp  
  inflating: pba/src/pba/SparseBundleCPU.h  
  inflating: pba/src/pba/SparseBundleCU.cpp  
  inflating: pba/src/pba/SparseBundleCU.h  
  inflating: pba/src/pba/util.h      
Changing SiftGPU GCC to Brews gcc-4.9
Removing /usr/lib64 from makefile
Changing march from native core2 in makefile
Adding -L/usr/include/sys/ to compile Flags
patching file SparseBundleCPU.h
/Users/mike/code/github/VisualSFM_OS_X_Installer/pba
mkdir -p ./bin/out_no_gpu
mkdir -p ./bin 
g++-4.9 -w -o bin/out_no_gpu/pba.o src/pba/pba.cpp -DPBA_NO_GPU -fPIC -L -L/usr/lib -L/usr/include/sys/ -L./bin -O2 -Wall -Wno-deprecated -pthread -march=core2 -mfpmath=sse -fpermissive -c 
src/pba/pba.cpp:21:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.
make: *** [bin/out_no_gpu/pba.o] Error 1
libpba.so failed to build, halting.

This error is strange because usually g++ knows where to find system headers without needing an explicitly specified include path. If I manually change the compiler from g++-4.9 to g++ (by commenting out lines 334-337 inclusive in vsfm_os_x_installer.sh), I resolve these errors and get others.

...
g++ -o bin/out_no_gpu/pba.o src/pba/pba.cpp -DPBA_NO_GPU -fPIC -L -L/usr/lib -L/usr/include/sys/ -L./bin -O2 -Wall -Wno-deprecated -pthread -march=core2 -mfpmath=sse -fpermissive -c 
clang: warning: argument unused during compilation: '-L-L/usr/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/include/sys/' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L./bin' [-Wunused-command-line-argument]
g++ -o bin/out_no_gpu/ConfigBA.o src/pba/ConfigBA.cpp -DPBA_NO_GPU -fPIC -L -L/usr/lib -L/usr/include/sys/ -L./bin -O2 -Wall -Wno-deprecated -pthread -march=core2 -mfpmath=sse -fpermissive -c 
clang: warning: argument unused during compilation: '-L-L/usr/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/include/sys/' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L./bin' [-Wunused-command-line-argument]
g++ -o bin/out_no_gpu/SparseBundleCPU.o src/pba/SparseBundleCPU.cpp -DPBA_NO_GPU -fPIC -L -L/usr/lib -L/usr/include/sys/ -L./bin -O2 -Wall -Wno-deprecated -pthread -march=core2 -mfpmath=sse -fpermissive -c 
clang: warning: argument unused during compilation: '-L-L/usr/lib' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L/usr/include/sys/' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-L./bin' [-Wunused-command-line-argument]
src/pba/SparseBundleCPU.cpp:2469:32: warning: field '_num_imgpt_q' will be initialized after field '_camera_data'
      [-Wreorder]
                _num_imgpt(0), _num_imgpt_q(0), _camera_data(NULL), _point_data(NULL), _imgpt_data(NULL),
                               ^
src/pba/SparseBundleCPU.cpp:4168:14: note: in instantiation of member function
      'SparseBundleCPU<double>::SparseBundleCPU' requested here
                return new SparseBundleCPU<double>;
                           ^
src/pba/SparseBundleCPU.cpp:1129:9: error: call to function 'ComputeProjection' that is neither visible in the
      template definition nor found by argument-dependent lookup
        ComputeProjection( q->nproj, q->camera, q->point, q->ms, q->jmap, q->pj, q->radial_distortion, 0);
        ^
...

I'm not sure how to proceed from here. Has anyone successfully built VisualSFM on macOS Catalina?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions