[Scilab-users] Creation of a library with macros located in various folders

Pierre Vuillemin contact at pierre-vuillemin.fr
Wed Oct 12 22:00:54 CEST 2016


Hi all,

I am trying to make a function similar to genlib but which goes 
recursively through folders to find .sci files, compile them and put 
them in a given target build folder.

The idea is that I would like to be able to organize my 'macros' folder 
while still being able to generate a library. In particular, I would 
like to have that kind of folder organization :

- build

     <binary files should go here>

     <as well as names>

- src

     - sub-folder1

         <.sci files>

     ...

     - sub-folder n
	- sub sub folder 1
	<.sci files>

     < .sci files>


At the moment, the function (build.sce in the attached file) goes 
through the folders contained in the initial 'src' folder, performs an 
'exec' on the .sci files that are found, and save the corresponding 
binary files in the target folder 'build' (at the same level as 'src'). 
It also generates a 'names' file containing the names of the functions 
in the 'build' folder.

Finally, it creates a library with the binary files contained in the 
'build' folder.


Yet, when I try to use my functions, I get the following error:

   !--error 999
Overloaded load cannot occur in this context

So I guess that there is something wrong with the way I generate my library?

My binary files are generated as follows,

          function_name  = strsubst(fi,".sci","") // fi is the full name 
of the file
          names_to_write = [names_to_write;function_name] // used later 
to generate the file containing the names
          exec(file_path, -1)  // file_path is the absolute path to my 
function
          save(target_path + function_name + ".bin", function_name)

and the names file is generated as,

       names_file = target_path  + "names"
        [fd, err] = mopen(names_file,"a")
        mputl(names_to_write, fd)
        mclose(fd)


Best regards,

Pierre Vuillemin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161012/0fd1941b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: recuBuild.zip
Type: application/zip
Size: 1593 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20161012/0fd1941b/attachment.zip>


More information about the users mailing list