windows-subsystem-for-linux

Segmentation fault when passing internal function as argument

假装没事ソ 提交于 2019-11-28 06:32:22
问题 I have some code that passes an internal function of the main program as an argument to a function: when the function that been passed is eventually called it causes a segmentation fault. This only occurs when I use Windows Subsystem for Linux (I'm using Ubuntu 16 on WSL); running on native Linux or Mac machines this does not occur. A minimal example that crashes: module test1 implicit none contains subroutine x(ff,y) interface real function ff(y) real, intent(in) :: y end function ff end

Valgrind does not work with WSL?

拈花ヽ惹草 提交于 2019-11-28 06:24:33
问题 When I installed WSL for my computer I was very excited to have a more natively supported Linux system rather than using VirtualBox . However I get this error when I try to run it. Is there a reason why? I am happy to give more information as required. --4364:0:aspacem -1: ANON 0038000000-00383d5fff 4022272 r-x-- SmFixed d=0x000 i=25365 o=0 (0) m=0 /usr/lib/valgrind/memcheck-amd64-linux --4364:0:aspacem Valgrind: FATAL: aspacem assertion failed: --4364:0:aspacem segment_is_sane --4364:0

How to enable Bash in Windows 10 developer preview?

与世无争的帅哥 提交于 2019-11-28 04:27:54
I am using windows 10 developer preview Build 14295. From the Build conference I understood that we can enable bash in windows 10. But its not clear how to enable bash in windows 10. Please find below the blog post for running bash in windows 10. Link : http://www.hanselman.com/blog/DevelopersCanRunBashShellAndUsermodeUbuntuLinuxBinariesOnWindows10.aspx After turning on Developer Mode in Windows Settings and adding the Feature, run you bash and are prompted to get Ubuntu on Windows from Canonical via the Windows Store I enabled the developer mode. But I am not sure how to add a feature and run

How to Add Linux Compilation to Cmake Project in Visual Studio

半腔热情 提交于 2019-11-27 22:24:55
问题 Visual Studio has added lots of new features for C++ in the past year. CMake With the CMake support, I can do "Open Folder" and select a folder with a CMakeLists.txt file in it. Visual Studio does a lot of nice work in discovering and building it automatically. Linux Compilation Visual studio now supports remote compilation on Linux over SSH. Several tutorials show how users can create a new "Linux Console Application" in Visual Studio, and it will automatically ask to setup an SSH connection

Copy Paste in Bash on Ubuntu on Windows

为君一笑 提交于 2019-11-27 19:47:06
问题 How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment? I tried the following: ctrl + shift + v right click to paste Any suggestions? 回答1: Update 2019/04/16: It seems copy/paste is now officially supported in Windows build >= 17643. Take a look at Rich Turner's answer. This can be enabled through the same settings menu described below by clicking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste". Another solution would be to enable "QuickEdit

How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu?

有些话、适合烂在心里 提交于 2019-11-27 19:09:35
问题 Pretty straightforward, the usual places to figure out the OS you're on seem to be identical to plain Ubuntu on Ubuntu for Windows. For example uname -a is identical to a native GNU/Linux install and /etc/os-version is identical to a Ubuntu Trusty Tahr install. The only thing I can think of is to check if /mnt/c/Windows exists, but I'm not sure if that's a foolproof idea. 回答1: The following works in bash on Windows 10, macOS, and Linux: #!/bin/bash set -e if grep -qE "(Microsoft|WSL)" /proc

Windows Bash and Visual Studio Code: How can I launch bash as a run task?

大城市里の小女人 提交于 2019-11-27 16:31:54
问题 how can I run the Windows Bash from Visual Studio code as a run task? Here are some of my many attempts at tasks.json to do this. { "version": "0.1.0", "command": "cmd", "isShellCommand": true, "args": [ "RunShellScript.bat" ], "showOutput": "always" } RunShellScript.bat has only this line: bash myShellScript.sh . Which if you just open cmd from start, and type that line, it will execute. It also runs perfectly if you just double click the file as well. However, when launched from VSCode,

How can a run Windows executable from WSL (Ubuntu) Bash

余生长醉 提交于 2019-11-27 11:44:47
问题 Along with Windows 10 Anniversary update for summer 2016, came the possibility to run ubuntu binaries inside the new Windows Subsystem for Linux (WSL), a "lightweight" virtualized subsystem. Unfortunately, launching C:\Windows\System32\bash.exe , another bash ELF binary starts a process inside the WSL, from where you cannot escape! You may launch only other ELF binaries. So how can I execute *.exe files from Windows Bash?[1] [1] Question asked also in Microsoft's "official" GH support repo.

How to use X Windows with Emacs on Windows 10 Bash?

99封情书 提交于 2019-11-27 10:10:11
问题 I am using the Bash on Ubuntu on Windows program to use Emacs for C++. Right now, I can code everything using the keyboard shortcuts, however, I want to select text with my mouse or set the mark with my mouse instead of always having to use my keyboard. To get the X Windows System, I already did sudo apt-get install xserver -xorg but emacs still runs in a terminal editor. I don't know what other commands to use or how to get X Windows to start running. 回答1: Windows bash does not support X

subprocess.Popen taking too long on WSL Linux

一世执手 提交于 2019-11-27 07:37:44
问题 I have this subprocess.Popen() context manager: with Popen( args=command, shell=False, stdout=PIPE, bufsize=1, universal_newlines=True ) as process: # TIMING start = timer() lines = list(process.stdout) end = timer() print('Time taken:', end - start) # 53.662078000000065 seconds -> Linux for _ in tqdm(iterable=lines, total=len(lines)): sleep(0.1) if process.returncode != 0: raise CalledProcessError(returncode=process.returncode, cmd=process.args) And it seems to take 53 seconds to process