Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have an R script which was developed in Windows, and which requires a particular DLL to be in the path because it uses some functions contained therein (via the dyn.load function).
Is it possible to make the script work under Linux? Perhaps using wine?
Assuming you have the source code of the non R code, I think your best bet will be to compile the code under Linux, e.g. Using a gcc compiler, create the shared library (.so file) and load it into R. If you put your code (R code and the other source code) in an R package you could integrate the R code and other source code so that they can be installed in one go, where the source is compiled on the fly.
The fact that you don't have the source code makes things quite a bit more complex. This SO post:
Using Windows DLL from Linux
Suggests to me that what you want is not trivial. One option would be to run the dll in a windows virtual machine. You then communicate using e.g. Tcp/ip to the dll running on your machine. So depending on how far you are willing to go, this might be a solution. The answers to the post above also suggest wine will not provide a satisfactory solution, but the post is quite old so wine might be improved in the meantime.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 days ago.
Improve this question
I have an assignment in my OS design course and my instructor has asked us to open and view the source code of any of the functions (like the source code of copy or paste, something like that) of the kernel of our choosen linux distro.
I have searched a lot but I coudent find a way to do that from the terminal. Is there a way to do this via the terminal?
Searching on google keeps leading to websites that have the kernel source code
Here is the source code of GNU's core utilities. The source code won't be available from your own machine, there is no need to have uncompiled code. But you could use a C decompiler to watch it. These programs are usually located under /usr/bin
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I read, some years ago, that you could get linux to invoke the java command to run java programs by adding a bit of linux magic, but I can't remember how to do it or where I read it.
Back then I got it working and, if I recall correctly, it was fairly easy to do; just tell linux to use java to run .jar or similar files. I believe I also got it to run powerpc binaries, through qemu, using the same technique. Naturally, you would still have to mark them as exeutable.
I am not talking running java java_program_to_run or using some shell script that will, essentially, just call the same command. Nor am I asking for a way to convert a java program to an x86 binary for any particular operating system.
It was a technique that would allow Linux to deal with exectuables that wheren't native to the system, almost, as if they where native (some simulation required).
You want to checkout binfmt. More specifically, follow the instructions for java. I realize the usual practice is to copy the details into the answer, but they're quite long and it doesn't feel right to copy-and-paste the whole thing into the answer.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 3 years ago.
Improve this question
I'm writing a GUI application using GNOME technologies, and I need to define UUIDs for resources in RDF files.
I'm writing in C++ but I don't mind using a C library and wrap it in my own C++ wrapper. I also prefer to use existing common libraries than add dependencies on 3rd party libraries.
I found two libraries which seem to be standard, libuuid (which comes with the Linux kernel as part of util-linux) and the OSSP uuid library, which has a C++ binding.
No program on my system uses OSSP uuid library, but my whole desktop depends on the libuuid package, probably because the kernel itself depends on it.
The question is, which one should I use? Is there a difference or I can just choose randomly? I don't know why there are different implementations, but I'd like to choose one and stick with it.
If you are on Linux anyway, probably your best option is using libuuid. I mean, everyone is using it and it's a really nice library.
You'll have to depend on the chosen library and, most likely, libuuid will be already present on your user's system. You noted that no program on your system uses OSSP, the same is true for all my systems. So why bother and use some …let's call it third party library… when you already have a popular library used by everyone else and known to work very well (I don't mean that OSSP works worse, it's also quite good)?
I'm not aware of any reason to prefer OSSP uuid over libuuid.
Well, I should probably note that you can simply read UUIDs from /proc/sys/kernel/random/uuid but that's not as much fun as using a C library, right?.
go for libuuid, it has wider use, and it's easier to have feedback and to find docs in case of problems.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
This is an incredibly dumb question, but I don't know the answer. Apologies in advance.
I want to download a repo of someone else's code from GitHub to work on it. In a Unix-y filesystem, where is the most conventional place to put it?
I've been reading about standard directory structure on Wikipedia and it looks like below opt might be the most appropriate place. Is that correct?
I'm using MacOS, so the alternative would be for me to create a custom folder under /Users/me, but I wondered if there was a conventional place for working on code within the standard Unix directories.
It depends on your usage plans. If this is code you want to hack on, typically your home directory is the right place, since this is private to your unix user. I personally make a 'dev' subdirectory and put code in there (mine or other people's, via github).
If you're looking to install this software system-wide, the answer varies slightly by the system. /opt is a reasonable choice in most cases, as is /usr/local.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I need to find out if a binary is using epoll or select for socket handling on Linux. The binary is not stripped, but I can't run it in my linux box so no strace.
nm <binary> will tell you which symbols are defined and, more importantly here, which symbols are used by the given binary. You can get a conservative guess by checking which of poll or select are listed in the output.
You may find that your application is linked against both. In that case it may be making a run-time decision on which one to call, and you won't be able to easily tell which one it would actually use if you ran it.
Depending on how the binary was built, you may have to run nm with the -D flag; or you may need to ensure you don't specify -D. Try both ways.
If the program uses shared libraries, the actual call to poll or select could be in a library it's using. In that case, you may have to dig through all of its libraries running nm on each of them. You can find out which libraries a program uses with ldd, or if that doesn't work, by looking for the NEEDED entries in the output of readelf --dynamic.
If the binary was built for a different platform than you're currently running on, then ldd won't work, and also you may have to use a cross-compiler build of binutils to get a version of nm that will work for you.