Hi Timo,
I have nothing against the proposal so feel free to make a patch that
works on BSD, OSX, Windows and Linux in omc, OMEdit, OMShell, and
OMNotebook. See
http://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
for details in each OS. Note that on OSX, OMEdit is located in
/Applications/MacPorts/OMEdit.app, but omc is located in PREFIX/bin/omc
as usual. So special care needs to be taken here...
The "hard-coded path" is actually not hard-coded though:
It's $OPENMODELICAHOME/bin/omc with a very good fallback: the PREFIX of
the compiled file. Since noone likes to override the env.vars on Linux,
this looks like a hard-coded path though (and it's the way most people
prefer I'd believe since things usually just work).
This should pose no problem for you to create rpm builds at any static
path you prefer. Of course, if you want to move things around (install
in user's home dir?) it is different.
--
Martin Sjölund
On 2011-11-21 19:54 , Timo Penndorf wrote:
Hello,
since a few weeks (somewhen between r9xxx and r10557) the path name of
ModelicaBuiltin.mo seems to be hard coded (or generated as absolute
path hard) into the omc binary.
As result is not possible to create rpm packages as non root user
because the build root directory is different from the final location
of the omc binary (generally /usr/bin/omc where non root is not allowed
to write).
I think it is better to calculate the location of ModelicaBuiltin.mo
relative to the omc binary at runtime. In Linux one can use the
symlink '/proc/self/exe' to determine the path to omc binary, the
powerpoint platform provides GetModuleFileName in the api.
Timo