make install issues on OS X 10.9.4

I'm trying to get my laptop OpenKIM setup all configured with the
latest version. Compiling seemed to go fine, and I'm trying to
install to HOME \(not /usr/local\), but "make install" is giving an error \(see below \- I removed all the (QUELL) so I could see where it
was failing). I'm not entirely sure what the problem is, but it's
definitely returning error status 2. Any suggestions?

      Noam

[bernstei@magnesium kim-api-v1.6.2]$ make install

Installing...(/Users/bernstei/lib/kim-api-v1).................................
src.

Installing...(/Users/bernstei/lib/kim-api-v1).................................
bin.

Installing...(/Users/bernstei/lib/kim-api-v1).................................
KIM_Config filesfor fl in Makefile.Generic Makefile.LoadDefaults
Makefile.Model Makefile.ModelDriver Makefile.ParameterizedModel
Makefile.SanityCheck parameterized_model.cpp; do install -m 0644
"build_system/$fl" "/Users/bernstei/lib/kim-api-v1/build_system/$fl";
done

printf ',s|^ *srcdir *=.*|srcdir = $(KIM_DIR)|\nw\nq\n' | ed
"/Users/bernstei/lib/kim-api-v1/build_system/Makefile.Generic" >
/dev/null 2>&1

printf ',s|^ *KIMINCLUDEFLAGS *=.*|KIMINCLUDEFLAGS =
-I$(KIM_DIR)/include|\nw\nq\n' | ed
"/Users/bernstei/lib/kim-api-v1/build_system/Makefile.Generic" >
/dev/null 2>&1

for fl in Makefile.GCC Makefile.INTEL; do install -m 0644
"build_system/compiler_defaults/$fl"
"/Users/bernstei/lib/kim-api-v1/build_system/compiler_defaults/$fl";
done

for fl in Makefile.DARWIN Makefile.FREEBSD Makefile.LINUX; do install
-m 0644 "build_system/linker_defaults/$fl"
"/Users/bernstei/lib/kim-api-v1/build_system/linker_defaults/$fl";
done

install -m 0644 Makefile.KIM_Config
"/Users/bernstei/lib/kim-api-v1/Makefile.KIM_Config"

fl="/Users/bernstei/lib/kim-api-v1/Makefile.KIM_Config" && \

                printf ',s|^ *KIM_DIR *=.*|KIM_DIR =
/Users/bernstei/lib/kim-api-v1|\nw\nq\n' | ed "$fl" > /dev/null 2>&1

make: *** [config-install] Error 2

Correction - I now do understand what the problem is, but not sure what the right fix is. The ed command is trying to modify
fl=/Users/bernstei/lib/kim-api-v1/Makefile.KIM_Config
The command that’s failing is
printf ‘,s|^ *KIM_DIR =.|KIM_DIR = /Users/bernstei/lib/kim-api-v1|\nw\nq\n’ | ed “$fl” > /dev/null 2>&1
and the reason is that the relevant line in $fl is
KIM_DIR := /Users/bernstei/src/work/OpenKIM/kim-api-v1.6.2
which does not match the ed regex because of the ‘:’ in ‘:=’. The reason there’s a := to begin with is because I followed the commands in the INSTALL file, specifically these:

To install the KIM API to the standard location (/usr/local)

% cp Makefile.KIM_Config.example Makefile.KIM_Config

% printf “g/^KIM_DIR/d\ni\nKIM_DIR := pwd\n.\nw\nq\n” | ed Makefile.KIM_Config

% make

% make install

% make install-set-default-to-vX # replace X with the major version of this package

I’m guessing that there’s no specific reason for that :=, but if there is, the Makefile (the install-config target commands, specifically) should probably be fixed to work with it.

Noam

Hi Noam, Thanks for the detective work. Yes, the regular expression should be more general. I'll update things to make it a bit more flexible.

By the way. A couple of debugging hints...

The setting:

   KIM_MAKE_VERBOSITY

controls the value of the QUELL variable. If you set KIM_MAKE_VERBOSITY=full in the Makefile.KIM_Config file, then everything will print out and you don't need to mess with changing the make files.

Or you can set it just once on the command line:

   make KIM_MAKE_VERBOSITY=full all

Alternatively, and maybe more convienent you can use the (undocumented, and therefore subject to change) short cut of setting the variable to an empty string upon invocation of make:

   make QUELL= all

Cheers,

Ryan