I've downloaded the latest LZMA SDK and I'm trying to compile it on Mac OSX, although get an error with any of the makefiles included in the tar ball. Here's the error with any makefile I try and run:
/lzma922/C/Util/Lzma/
# make
makefile:<#>: *** missing separator. Stop.
Any help would be appreciated — thanks!
Related
I'm trying to build ORB_SLAM2 on macOS 11.4 with clang 12 and OpenCV4 and have run into this error:
make[2]: *** No rule to make target `/usr/lib/libz.dylib', needed by `../lib/libORB_SLAM2.dylib'. Stop.
This file does not exist on my Mac and I cannot add this symlink due to macOS's SIP. The correct path should be /usr/local/opt/zlib/lib/libz.dylib
How can I fix this /usr/lib/libz.dylib reference?
Here is my branch with my macOS build changes.
I've tried to fix the problem by:
Inspecting each of the project's direct dependencies with otool -L and rebuilt from source where necessary (such as OpenCV) to make sure /usr/lib/libz.dylib is not referenced (fix suggested here)
Using CMake's FindZLIB.cmake module in the ORB_SLAM2 CMakeLists.txt to ensure the correct ZLIB is found
Below is the output showing ZLIB is found but still no luck:
-- Found ZLIB: /usr/local/opt/zlib/lib/libz.dylib (found version "1.2.11")
Solved: I checked the CMakeFiles/Makefile.cmake and it showed me that the Pangolin library I was using was actually one from another project of mine. Building Pangolin in this project solved the issue.
I am trying to install a program and when I run make or make -f Makefile (following the installation instructions) I get the following output:
g77 -O5 -Wall -c prep_output.f -o prep_output.o
dyld: Symbol not found: ___keymgr_global
Referenced from: /usr/local/bin/g77
Expected in: /usr/lib/libSystem.B.dylib
make: *** [prep_output.o] Abort trap: 6
I am working on a macOS Mojave 10.14.6. Following some other proposed solutions in similar problems, I've already installed Command line tools in my Xcode but that didn't do the trick. Any suggestions please??
Thanks in advance
EDIT:
I got rid of g77 and installed a compatible version of gcc (gcc8) through MacPorts. After running the make command I get the following:
g77 -O5 -Wall -c prep_output.f -o prep_output.o
make: g77: No such file or directory
make: *** [prep_output.o] Error 1
So I guess the program still needs the g77 setup? This is the program btw ([http://www.cfht.hawaii.edu/~arnouts/LEPHARE/install.html]). Is there a way to rely to the gfortran compiler for building the program?
Thanks in advance
P.S. I noticed that when I install g77 I get the following error:
x usr/local/: Can't set user=0/group=0 for usr/local`
`tar: Error exit delayed from previous errors.
However it still installs g77..
The error message indicates that your installation of g77 is broken. This has nothing to do with make or the particular project you're trying to build, except inasmuch as the project is trying to use g77 in the first place. That is a bit surprising, actually, since g77 has been obsolete for years (gfortran is the current GNU Fortran compiler), but I'm uncertain what exactly to expect from XCode in this area.
On the other hand, since the full path to the binary is /usr/local/bin/g77, I'm further inclined to think that you're not using XCode for this at all. Possibly you've dumped a g77 built on some other system into your /usr/local/bin, and it's not compatible with your Mojave system.
Your best bet is probably to
Get rid of your broken g77 installation.
Install Fink or MacPorts, or a similar project.
Install the Fink / MacPorts / whatever package for gfortran (maybe gcc-gfortran or similar in some of those) to get a working Fortran compiler.
Rely on that compiler to build your project.
On a Leopard Mac mini (PowerPC) I'm trying to compile Apple-GCC-3.3 which I got from https://opensource.apple.com/tarballs/gcc_os/gcc_os-1819.tar.gz
./configure gets completed w.o. any error but make gives the following errors:
When input only "make" it says
make: *** No rule to make target `all', needed by `default'. Stop.
When input make -f Makefile, the make starts fine but somewhere halfway down the process it stops with:
gcc tclAppInit.o -L/Users/macmini/Downloads/gcc_os-1819/tcl/unix -ltcl8.0 -lc \-o tclsh
make[1]: *** No rule to make target `all'. Stop.
make: *** [all-expect] Error 2
For this type of error, it's said that the tar might be dropping long filenames during the untar operation but I tried with different versions of tar such as 1.14, 1.27 and the error is the same.
What should I do? Thanks.
!(http://i.hizliresim.com/Kl9rRJ.png)
(Just in case you may wonder why I want to compile GCC-3.3, it's because it's needed to compile GIMP on PowerPC Macs)
Problem solved. It turned really hard to compile GCC-3.3 from source, so I made it easy and installed it from XCode 3.1 DVD, under the Packages directory where GCC-3.3.pkg was present.
Now the GIMP can be compiled.
Summary: It's a good idea to install the Apple's compiler group of programs from the XCode DVD.
Thanks.
I am getting started with using MEX files for MATLAB (R2012a) compiled from C code (using XCode 4.3) on my Mac (running OSX 10.7.3, Lion). I have already installed the MATLAB provided XCode patch which configures MATLAB to use the new llvm-gcc compiler under XCode 4.2+, but I am still getting the following error attempting to compile the example file using mex timestwo.c:
/Applications/MATLAB_R2012a.app/extern/include/matrix.h:852:20: error: stdlib.h: No such file or directory
In file included from timestwo.c:1:
/Applications/MATLAB_R2012a.app/extern/include/mex.h:161:19: error: stdio.h: No such file or directory
The compilation then breaks
mex: compile of ' "timestwo.c"' failed.
Error using mex (line 206)
Unable to complete successfully.
Clearly, the compiler can't find the standard library header directory, but what do I need to change to successfully compile?
Ah, found it!
The MATLAB provided template uses /Developer/... for the SDK location, but this changed under XCode4.3 to live under the XCode.app. To fix things, I had to edit my ~/.matlab/R2012a/mexopts.sh file to set the SDKROOT directory to the new location.
To do this, search for SDKROOT in the mexopts.sh file and change it to read:
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/'
Note, I chose the 10.7 sdk b/c I am on Lion. Use 10.6 if you are on Snow Leopard
I am running Mac Mountain Lion and Matlab R2012b, and the following solution worked for me: Matlab 2012a Mex to work with Xcode 4.5 on Mountain Lion
To be precise,
I was getting the following errors:
error: stdio.h: No such file or directory
error: stdlib.h: No such file or directory
error: math.h: No such file or directory
So what I did to solve this issue:
I installed Xcode with Command Line Tools, and then edited the file "/Applications/MATLAB_R2012b.app/bin/mexopts.sh" by:
changing CC from gcc-4.2 to llvm-gcc-4.2
changing CXX from gcc-4.2 to llvm-g++-4.2
setting SDKROOT to '/'
Then I ran "mex -setup" in MATLAB, chose number 1, and chose y to overwrite the old /Users/insertyournamehere/.matlab/R2012b/mexopts.sh
That solved it :)
You will find valuable information here: http://www.mathworks.fr/support/solutions/en/data/1-FR6LXJ/
I notice that yesterdaya new version of OpenCV was released, v2.3.
I can't install this version in my Mac using cmake and the basic instructions to compilate the sourcecode for Linux & Unix.
I obtained this error message when I execute the make instruction:
/Users/jorgevegasanchez/Downloads/OpenCV-2.3.0/modules/highgui/src/cap.cpp: In function ‘CvCapture* cvCreateCameraCapture(int)’:
/Users/jorgevegasanchez/Downloads/OpenCV-2.3.0/modules/highgui/src/cap.cpp:130: error: ‘CV_CAP_OPENNI’ was not declared in this scope
/Users/jorgevegasanchez/Downloads/OpenCV-2.3.0/modules/highgui/src/cap.cpp:131: error: ‘CV_CAP_ANDROID’ was not declared in this scope
make[2]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap.o] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
There is no problem when installing OpenCV 2.2 using cmake. I think there is an error or a mistake with OSX version of OpenCV 2.3 version.Or I made something wrong ???
Thanks in advance.
You likely have a previous version of opencv2 installed already. Check /opt/local/include and /opt/local/lib. If this is the case, these locations likely take precedence on you system PATH when you try to compile opencv2.3 resulting in the above errors. Either remove the old opencv version or temporarily move that relate to opencv2 from the above mentioned folders while you compile the new version.
I'm not sure your build won't have any more errors, but a quick hack is to protect those constants on a #ifdef block.
Go to those lines where the error occurs and notice that those 2 constants are used to initialize an int array named domains. You can change it's definition to:
int domains[] =
{
#ifdef HAVE_VIDEOINPUT
CV_CAP_DSHOW,
#endif
CV_CAP_IEEE1394, // identical to CV_CAP_DC1394
CV_CAP_STEREO,
CV_CAP_PVAPI,
CV_CAP_VFW, // identical to CV_CAP_V4L
CV_CAP_MIL,
CV_CAP_QT,
CV_CAP_UNICAP,
#ifdef HAVE_OPENNI
CV_CAP_OPENNI,
#endif
#ifdef HAVE_ANDROID_NATIVE_CAMERA
CV_CAP_ANDROID,
#endif
-1
};
This will fix those specific errors, and hopefully you won't have others.
EDIT:
I just downloaded OpenCV 2.3 and compiled it using the standard procedure and everything went fine. No errors!
tar -xjvf OpenCV-2.3.0.tar.bz2
cd OpenCV-2.3.0
mkdir build
cd build/
cmake ../
make
sudo make install
You likely have a previous version of opencv2 installed already. Check
/opt/local/include and /opt/local/lib. If this is the case, these
locations likely take precedence on you system PATH when you try to
compile opencv2.3 resulting in the above errors. Either remove the old
opencv version or temporarily move that relate to opencv2 from the
above mentioned folders while you compile the new version.
Thanks. It works fine now with mine with OpenCV 2.3.1 under Mac 10.6.8
Update cmake:
sudo port install cmake