How to run OpenMP in WSL? - openmp

I have some binaries from c++ codes supporting Openmp under linux system. I want to run them in the WSL(Windows Subsystem for Linux) on my windows 10. I think I should install some packages to support Openmp. What do I need to install? Follow the windows openmp installation routine to install intel c++ complier? Or ubuntu routine to install a high version gcc? Maybe both? (Then my system disk may not have enough space.)
In case my above question is ill-conditioned, I illustrate my question more detailed as below. I would like to know if I have a binary supporting Openmp. Is it necessary for me to install any package to use it? Could I only set the env "OMP_NUM_THREADS" and use it directly? If I have c++ codes to compile a binary supporting Openmp. What do I need to install under WSL?
I couldn't find an easy tutorial about the openmp under WSL. Forgive my ignorance. Could you give me suggestion? Thank you.

Related

Installing MIT Scheme on Windows 10 -- 'Requested Allocation is too large'

I'm trying to get Scheme going so I can work through "Structure and Interpretation of Computer Programs" but I keep running into the above-mentioned issue. I know sort of how to solve the problem but I don't know how to go about setting the file in the bin directory to --library and --edit for the other directory. Can someone give me an idea if I'm supposed to use git bash, cmd, File directories(properties option)? I looked at properties and I did not find how to edit the file in such a manner.
The version of Scheme I'm using is MIT-GNU Scheme.
You can use the SICP package in Racket.
Download Racket for your OS - https://download.racket-lang.org/
Follow instructions here to install the sicp package : https://docs.racket-lang.org/sicp-manual/index.html
I just did it and got it running in minutes.
The releases provide binaries that run on i386 and x86-64 machines under the following operating systems: GNU/Linux and OS X. We additionally provide binaries for selected other architectures and systems, depending on the hardware and software that is available to us. We no longer support OS/2, DOS, or Windows.
from MIT/GNU Scheme

Cross Compilation of OpenSSL [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to build OpenSSL with MinGW in WIndows?
I have downloaded the OpenSSL source (openssl-1.0.1c) from their website. I need to build/compile this source, so that I can use the same on Windows, MAC and Linux environments. I google'd and read some blogs, but nothing sounds useful for me. If anybody has worked or anybody has relevant knowledge please help me!
Compile once, use the same on all three different environments.
That's not possible, and it's not what cross compilation means. Cross-compiling means (for example), compiling for Windows while running in a Linux environment. It doesn't mean compiling something that will run under both Linux and Windows.
There is no way to build a single executable, which can be used on all three operating systems.
You have to compile the library once for Windows, once for Linux and once for Mac.

Development environment for erlang on Windows

I have an erlang project that includes NIFs with OS specific functions that work with raw sockets. I want to port this project on Windows which means changing the functions in NIFs to work on Windows.
What is the preferred IDE for erlang programming on Windows?
What do I have to set up in order to be able to compile this project?
I'd advice to just down load cygwin with its gcc and try to compile your nif as you would on linux. There are some instructions on github on how to setup an Windows environment to compile Erlang/OTP, but this is probably overkill for your NIF.
As an IDE I would use whatever you are using on Linux, i.e. hopefully Emacs :)
Erlang can be set up as an external tool in msvc.

Compile Ada program for Linux using Windows

If I want to compile a program that is written in Ada, I have to use GNAT, of course.
As my Computer has Windows as its sole operating system, I cannot use GNAT, normally. Right? Thus I got Cygwin which enables me to use GNAT on Windows.
But the result is an executable that runs under Windows - not Linux. So how can I compile the Ada code for Linux although I only have Windows? (Please don't think about the reasons ...)
Is this possible with Cygwin? Do I have to install a virtual machine with Linux? Or is there another (easier) solution to this issue?
I have to use GNAT, of course.
Not true; there are other Ada compilers. (GNAT is the only one I know of that's free.)
Running GNAT under Cygwin gives you Cygwin executables, which are Windows executables that depend on cygwin1.dll. They will not work on Linux. See the "What ... isn't it?" section on the Cygwin home page.
There is a GNAT for Windows. The GNAT Pro version has a list of supported platforms here; it includes Linux and Windows, but it doesn't show a Windows-to-Linux cross compiler.
Since GNAT is free software (GNAT Pro isn't is a little more complicated; I won't get into that) there could well be a Windows-to-Linux GNAT cross-compiler -- or, if you're really ambitious, you could build one yourself (or hire someone to do it for you).
But installing GNAT on a Linux system is the easiest approach. It doesn't have to be a virtual machine. If you have the hardware, you can install some Linux system by itself, or you can set up a dual-boot system on your Windows box. Ubuntu has a Windows installer, Wubi, that installs an Ubuntu image as a Windows file; it doesn't let you run Windows and Ubuntu concurrently, but it lets you dual-boot without having to repartition.
There are other options; these are just the ones I'm familiar with.
Is this possible with Cygwin?
It's probably possible.
Do I have to install a virtual machine with Linux? Or is there another (easier) solution to this issue?
Installing a Linux on a virtual machine is likely to be the simplest solution to your problem.
Since GNAT is free software (GNAT Pro isn't; I won't get into that) there could well be a Windows-to-Linux GNAT cross-compiler -- or, if you're really ambitious, you could build one yourself (or hire someone to do it for you).
Actually GNAT Pro is Free Software, free as in freedom, not as in beer.
And I think that it would be simplest to install Linux in virtual machine and compile with it.
AdaCore has a gnat compiler for the Windows operating system freely available at: http://libre.adacore.com/libre/download/ and choose "Free Software..." and click "Build Your Download Package" and go from there. As Keith Thompson suggests, you can setup a dual-boot solution if you actually need a Linux compatible executable. Remember any program compiled on Windows results in a Windows-only executable unless you have a compiler that allows for cross-compilation.
It became possible for them who use Windows 10 64 bit with new "Linux Subsystem" feature. You may install gnat on it and use it to compile ELF binaries, as well as windows binaries.

Compile Linux application for Windows (C)

can I compile a linux application, with Linux-only available libraries, for Windows ?
I know the author of nginx web server uses some Wine tools to get his Linux-based project working on win32, natively, but how does he do that ?
Is MinGW support to create Windows binaries linked with Linux-specific libraries/headers ?
PS: I do not want to use cygwin due to big lost about performance...
Using something like mingw32 environment, you would have to find or build yourself all libraries on which the project you want to build depends (and all libraries on which those libraries depend).
You might end up having to implement some functionality which is missing on that platform. One of the reasons cygwin is slow is the hoops it has to jump through to simulate unix-y things that are missing on windows.
As long as the project uses the standard libraries on Linux and do not depend on anything specific to the Linux platform, the Mingw port of GCC can compile it on Windows.
If you are familiar with Linux tools and you don't Cygwin, you might want to take a look at MSYS:
MSYS is a collection of GNU utilities such as bash, make, gawk and grep to allow building of applications and programs which depend on traditionally UNIX tools to be present. It is intended to supplement MinGW and the deficiencies of the cmd shell.

Resources