Cant find project for PackageCompiler - package

I am trying to create an executable using PackageCompiler.jl. However, whenever I run the command
create_app("src/UnsteadyFlowSolvers.jl","UNSflowCompiled")
I keep getting the error
ERROR: could not find project at "C:\\Users\\Matthew\\OneDrive - Mississippi State University\\Research\\UNSflow\\Ramesh Live\\src\\UnsteadyFlowSolvers.jl"
This is the exact location of the file. For instance:
include("src/UnsteadyFlowSolvers.jl") ; UnsteadyFlowSolvers.julia_main()
works perfectly fine and generates the exact result I would like the executable to return. The Project.toml file is in the current directory if that matters. I have tried an alternate version of the package where the module file is not located in another directory to no avail.
Thanks

create_app(package_dir::String, compiled_app::String; kwargs...)
Compile an app with the source in package_dir to the folder compiled_app.
So the first argument to create_app is the package folder, not the .jl file. I'd suggest a ;cd .. to get outside your project folder, then
create_app("Ramesh Live", "UNSflowCompiled")

Related

GCC cannot recognize the directory path inside a file

The problem I encountered in using GCC is that I cannot use the command make to build my program because some files contain the paths of their actual location.
Say I have a file named "machine.h", its content is target-pisa/pisa.h. At the same time, in the same working directory, I have a folder named "target-pisa", in which there is a file named "pisa.h"; the actual code of the header file "machine.h" is actually inside the file "pisa.h", which is inside the folder named "target-pisa" located in the same working directory as "machine.h".
Assume for some reason I cannot simply copy and paste the code from "pisa.h" to "machine.h"; that is, I have to stick with what is provided by the prof. The make command does not work in this case in my laptop because it cannot interpret target-pisa/pisa.h as a directory path and open the actual header file "pisa.h" according to the path target-pisa/pisa.h provided in the file "machine.h". Instead, git bash interprets target-pisa/pisa.h as C code (if I am not mistaken); see the figure below.
Some additional info that may be helpful:
In machine.h, there is only one line of code as shown below:
target-pisa/pisa.h
I have checked that almost all .c files in the working directory have #include "machine.h".
How can I solve this problem? Please help, I have been stuck in this for a long time. By the way, my friend also used git bash to do this lab and this problem doesn't happen to him.
I tried to reinstall git bash in order to see if the problem can be solved, but it didn't.
All in all, I want to build the program successfully by using make command in git bash.
machine.h needs to have an #include directive to tell the compiler to pull in the nested header.
#include "target-pisa/pisa.h"
Just writing target-pisa/pisa.h by itself isn't valid C code.

maxima read_list fails to find builtins-list.txt shared file

I have maxima (5.41.0) with CLISP (2.49 (2010-07-07)) on openSUSE (13.1). When I try to execute the following to read "builtins-list.txt" file (located in share), maxima fails with the following. This worked in maxima(5.38), before I had to reinstall corrupt OS (maxima(5.38) doesn't compile on newly built OS due to some missing packages, so I moved on to maxima(5.41)).
(%i1) **l: read_list("builtins-list.txt")**;
;; Compiling file /usr/local/share/maxima/5.41.0/share/numericalio/encode-decode-float.lisp ...
;; Wrote file /home/user/.maxima/binary/5_41_0/clisp/2_49__2010_07_07___built_3589360391___memory_3740229381_/share/numericalio/encode-decode-float.fas
;; Compiling file /usr/local/share/maxima/5.41.0/share/numericalio/numericalio.lisp ...
;; Wrote file /home/user/.maxima/binary/5_41_0/clisp/2_49__2010_07_07___built_3589360391___memory_3740229381_/share/numericalio/numericalio.fas
0 errors, 0 warnings
read_list: no such file `builtins-list.txt'
-- an error. To debug this try: debugmode(true);
When building, I used ./configure --enable-shared as well, hoping it will fix the issue, but not. I set debugmode(true), but no additional information is provided by maxima.
Any help/suggestion is appreciated.
Thanks,
Reddy
read_list and other read_foo functions don't search for the file, so one has to give a relative or absolute path name which shows where the file is, if it's not in the current working directory.
Try file_search to get the path to the file, and then give that path to read_list. E.g., something like: mypath : file_search("builtins-list.txt"); mylist : read_list(mypath);.
Note that file_search only looks with the Maxima installation folders. If the file is somewhere else, you'll have to figure out the path some other way.

Python script to fetch an executable file from local repository git

I have an access to the local repository (git) of my company with this url -> "gitolite#10.10.10.55:/Intel/BareRepos/lteue.git" and my python script need to execute any file (.c & .h files) of this project and create a binary. After which the script has to run this binary file.
The code which I have wrote is:
import os
os.system("git clone gitolite#10.10.10.55:/Intel/BareRepos/lteue.git")
os.system("cd /home/saicharan/Documents/lteue")
os.system("gcc somefile.c")
os.system("./a.out")
I am getting the error like this
gcc: error: helloworld.c: No such file or directory
gcc: fatal error:no input files compilation terminated.
sh: ./a.out: No such file or directory
Please help me out with this.
Fortunately I got the solution for this:
os.system("git clone gitolite#10.10.10.55:/Intel/BareRepos/lteue.git")
os.chdir("path/to/file")
os.system("gcc path/to/file/somefile.c")
os.chdir("path/to/file")
os.system("./somefile.out")
and its working fine.!
You can make it even more simpler.
import os
os.system("git clone gitolite#10.10.10.55:/Intel/BareRepos/lteue.git")
os.chdir("path/to/file")
os.system("gcc path/to/file/somefile.c && ./somefile.out")
It Works.!

Lua loadfile not finding a file

I had some lua code with the following line:
JSON = loadfile("JSON.lua")()
The file JSON.lua is in the same directory as the lua code that line came from. This code worked for me for a while, and then, without my changing either the lua source, or the JSON.lua, or permission of any of the files, or the directory from where I was running the lua code, I started getting a nil error on that line. (I simply recall NO relevant changes that could have any impact on the lua code.)
Adding an assert revealed that the error was caused by the file not being found. Playing with file permissions, restarting my machine didn't resolve the issue, and pulling back code that I had checked in and was working perfectly did not resolve the error.
I resolved the error by changing the line above to provide the absolute path to that JSON.lua file.
Is there anything explaining why the code without the absolute path could have worked for a while and then stopped working?
Note: This behavior of working and then not working happened to me twice over a week. I am puzzled and though I have now found a fix, I am really curious as to the explanation for that intermittent behavior.
Lua uses package.path, whose default value comes from the environment variable LUA_PATH if it is set, as the list of directories to search. You can put . of the front of this list to load files from the current directory, or you can put your files in a path on the list.
A late answer on this, as I found exactly the same problem.
First, contrary to the previous answer, loadfile doesn't use the package.path search path. It only looks in the specified directory. And if you don't specify a directory, it only look in the 'current directory'. I can't explain exactly why it stopped working for you, but probably your Lua code is somehow being run with a different 'current directory' than previous.
There are two possible fixes: One is to specify an absolute path to loadfile.
JSON = loadfile("c:\\my_folder\\JSON.lua")()
The alternative fix depends on the particular library you're using, which I suspect is Jeffrey Friedl's Lua JSON lilbrary. Because this supports the newer Lua module mechanism, you can just load the module with require, which does support the package.path search path.
JSON = require("JSON")

Netbeans EXE not working when executed from Terminal - CentOs

I made Netbeans work environment with SASL. The sample codes get build and it also run properly from Netbeans. But when I try to run my exe from Terminal it is not working. The error says as below:
./cppapplication_1: error while loading shared libraries:
libanonymous.so.2: cannot open shared object file: No such file or
directory
I tried setting the PATH using the below Command :
export PATH=/usr/lib64/sasl2/:$PATH
Still I am getting the same error. Do I need anything extra to do?
You need to add the path to libanonymous to the enviroment variable LD_LOAD_LIBRARY.
Update:
To do so:
Locate the library, for example doing: find / -name "libanonymous.so.2" or by locate libanonymous.so.2
Add the path found like so: export LD_LOAD_LIBRARY=$LD_LOAD_LIBRARY:<path to lib>
Update 1:
From your comment to Anon's answer I see that the lib in question is located under /usr/lib64/sasl2/.
So you might like to set LD_LOAD_LIBRAY path like so:
export LD_LOAD_LIBRARY=$LD_LOAD_LIBRARY:/usr/lib64/sasl2/
Update 2
This needs to be done in the same shell that later then executes the program needing the libraries (cppapplication_1).
cd <dir for cppapplication_1>; export LD_LOAD_LIBRARY=$LD_LOAD_LIBRARY:/usr/lib64/sasl2/; ./cppapplication_1
You can also try this.
ldd <name of executable>
You will see dependent libs and their expected paths. See if the lib is present at the path executable is expecting.

Resources