Openalpr: OS X compilation issue

Created on 7 Dec 2015  路  9Comments  路  Source: openalpr/openalpr

Following the OS X compilation instructions on OS X 10.11 El Cap.

Get to the following instruction:

Install the binaries/libraries to your local system (prefix is /usr)

sudo make install

When i run sudo make install

I get the following:
CMake Error at cmake_install.cmake:39 (file):
file INSTALL cannot copy file "/Users/Adrian/openalpr/src/build/alpr" to
"/usr/bin/alpr".

make: *** [install] Error 1

Any ideas what is causing this how I can resolve this?

Most helpful comment

You're running into the System Integrity Protection on El Cap, which won't allow anything not digitally signed by Apple into /usr, among other places. See https://derflounder.wordpress.com/2015/09/14/system-integrity-protection-and-the-end-of-xprotect-management-for-browser-plug-ins/.

The correct solution is to set the install prefix to /usr/local in the cmake step of the build instructions.

All 9 comments

Hey @calicuervo! This may not fix your problem, but what I would do is:

  1. Make sure that the folder /usr/bin/alpr exists. You can simply type /usr/bin/alpr into your terminal. If it does not, run sudo mkdir /usr/bin/alpr.
  2. Add write permissions to your folder: sudo chmod 755 /usr/bin/alpr.
  3. Lastly, I'd check to see whether the directory /Users/Adrian/openalpr/src/build actually contains a file named alpr.

Hope this helps!

You're running into the System Integrity Protection on El Cap, which won't allow anything not digitally signed by Apple into /usr, among other places. See https://derflounder.wordpress.com/2015/09/14/system-integrity-protection-and-the-end-of-xprotect-management-for-browser-plug-ins/.

The correct solution is to set the install prefix to /usr/local in the cmake step of the build instructions.

hey @calicuervo

read wiki reference Compilation-instructions-(OS-X)

# install with homebrew
brew tap homebrew/science
brew install openalpr

@paulsuh Thanks for that; I was able to get it working by modifying the .cmake file to include /usr/local as you suggested and going from there.

@hyuni I like them wiki edits ;-)

Thanks everyone

You're welcome!

Sorry for the inaccurate instructions. Glad you got it resolved :grinning:

Took me a while, so here a little bit clearer:

If you are running macOS 10.10 (I believe) or higher you will not be able to write to /usr and will need to adjust the compilation flag to /usr/local. You should change:
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_MACOSX_RPATH=true

to

cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -DCMAKE_INSTALL_SYSCONFDIR:PATH=/etc -DCMAKE_MACOSX_RPATH=true

@Xaaris You are right about it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lepiloff picture Lepiloff  路  6Comments

kevinjpetersen picture kevinjpetersen  路  6Comments

elementzonline picture elementzonline  路  6Comments

amchoukir picture amchoukir  路  7Comments

simplyeazy picture simplyeazy  路  10Comments