1

I am trying to build and install libYAML as per instructions on their website > http://pyyaml.org/wiki/LibYAML

  • ./configure > successful
  • make > successful
  • make install > failed

I get the following error "cannot create directory '/usr/local/include': Permission denied." See below:

P.S. I am running as an administrator.

JetBlue@JetBlue-Laptop ~/yaml-0.1.4
$ make install
Making install in include
make[1]: Entering directory `/home/JetBlue/yaml-0.1.4/include'
make[2]: Entering directory `/home/JetBlue/yaml-0.1.4/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/usr/local/include" || /usr/bin/mkdir -p "/usr/local/include"
/usr/bin/mkdir: cannot create directory `/usr/local/include': Permission denied
Makefile:235: recipe for target `install-nobase_includeHEADERS' failed
make[2]: *** [install-nobase_includeHEADERS] Error 1
make[2]: Leaving directory `/home/JetBlue/yaml-0.1.4/include'
Makefile:356: recipe for target `install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/JetBlue/yaml-0.1.4/include'
Makefile:343: recipe for target `install-recursive' failed
make: *** [install-recursive] Error 1

How does one resolve this "permission denied" error?

Thanks for your time.

Update -> Solution

It seems that to bypass this "permission denied" error, you not only need to be an administrator, but also the administrator who originally installed Cygwin. (They are the only ones who can freely edit files in Cygwin's /usr/local/ directory).

Hence my problem. Though I was an administrator I still didn't have edit rights to the directory.

So ... I am now just using that account to develop -_- (too much work at the moment to start playing around with sudos etc.)

P.S. I am not sure if this is what Yaakov was saying...

Jet Blue
  • 5,109
  • 7
  • 36
  • 48

2 Answers2

1

Check your permissions on /usr/local, or recompile with another --prefix which does have write permissions.

But you should be aware that this library is already available in the Cygwin distribution; install libyaml-devel and its dependencies to use it.

Yaakov
  • 1,705
  • 10
  • 10
  • Thanks Yaakov! I am very new to this. How does one go about changing permissions as you suggested? Also, for your second suggestion to use --prefix please elaborate. Thanks again for your time. – Jet Blue May 20 '13 at 02:22
  • (I had installed all the related libYAML files [including source] via Cygwin distribution but still get the following error when attempting to install ruby : [It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.] ) – Jet Blue May 20 '13 at 02:24
  • These are generic *NIX questions which you can and should learn elsewhere. As for your Ruby warning, I have to guess that you're trying to build ruby yourself; why are you not using the ruby package in the Cygwin distribution, which _does_ include `psych`? – Yaakov May 21 '13 at 03:24
1

If you installed CygWin with the option "for all users", then /usr/local will be a system folder. So normal users cannot simply write into it (via make install).

Solution:

have one cycgwin shell as normal user. There you do

./configure

make

pwd

Start another cygwin shell as administrator (rclick on the icon). There you cd into the folder you called make (see output of it's pwd command).

make install

this will have admin rights to write into /usr/local.

Of course you definitely also could redirect your install target to a place of your normal user with

./configure --prefix=users_own_cygwin_installation_destination_folder

(But latter is for cygwin beginners almost always a bad idea - you should only do this if you know what you are doing, esp. adopt your environment / PATH settings)

Community
  • 1
  • 1
tverrbjelke
  • 1,234
  • 10
  • 15