ilib_compile error during execution on MacOS X 10.9
Reported by Jaime Urzua
Originally assigned to Sylvestre LEDRU
BUG DESCRIPTION:
----------------
Cannot compile any code due ilib_compile problem at line 123 (grep problem)
ERROR LOG:
----------
>>//To quit this demo, enter CTRL+C, then type "abort"
>>
>>
>>if haveacompiler() then
>> // CALLING EXTERNAL ROUTINE
>> foo=["void foo(double *a,double *b,double *c)";
>> "{ *c = *a + *b; }" ];
>> // we use TMPDIR for compilation
>> if ~c_link("foo") then
>> path = pwd();
>> chdir(TMPDIR);
>> mputl(foo,"foo.c");
>> ilib_for_link(["foo"],"foo.c",[],"c");
Generate a loader file
Generate a Makefile
ilib_gen_Make: Copy compilation files (Makefile*, libtool...) to TMPDIR
ilib_gen_Make: Copy foo.c to TMPDIR
ilib_gen_Make: Modification of the Makefile in TMPDIR.
Running the Makefile
!--error 246
Function not defined for given argument type(s),
check arguments or define function %s_grep for overloading.
at line 104 of function ilib_compile called by :
at line 94 of function ilib_for_link called by :
ilib_for_link(["foo"],"foo.c",[],"c");
at line 22 of exec file called by :
update();exec(script_path,-1);clear script_path;;if exists("%ol
while executing a callback
HOW TO REPRODUCE THE BUG:
-------------------------
Execute
Demos -> Introduction -> Call external routine
Demos -> Xcos -> Electrical System -> RLC bridge
Any other than call ilib_compile
OTHER INFORMATION:
------------------
Tested with
OSX 10.9 (Maveriks)
Xcode 5.0.1
command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg
Scilab 5.4.1 and scilab-master-1382462742-x86_64
I saw the code for ilib_compile and at line 123 appear
if (GCClibpath <> "" & ierr == 0 & grep(getenv("LD_LIBRARY_PATH"),GCClibpath) == []) then
possible patch
if (GCClibpath <> "" & GCClibpath <> [] & ierr == 0 & grep(getenv("LD_LIBRARY_PATH"),GCClibpath) == []) then
the problem come from previous execution that assign to GCClibpath the value [] and grep cannot handle this situation
With previous version of OSX no problem