Swift Linux. Error: no such module 'Dispatch' - swift

I use Ubuntu 15.10
I compiled swift-corelibs-libdispatch, get file libdispatch.so
But still if I use "import Dispatch" get an error "no such module 'Dispatch'"
How can I add this module to Swift?

One way to accomplish this would be to set up a system module for libdispatch and use swift build. See https://github.com/apple/swift-package-manager/blob/13d682a63ea01246dd119cd4cf5c8d90c030566d/Documentation/SystemModules.md on how to use system modules. This quesion, Importing a Swift module using a C library, may also come in handy.
I'm sure there are other ways, too. You should be able to use swift interpreter or swift compiler (swiftc), but I can't think of a way to do that off the top of my head.

Related

Run simple swift script from terminal with imported library

I would like to migrate some python code to swift which includes numpy and found a library called Matft.
I'm doing this on a VM and Xcode is very slow, so it would be great to avoid that and use the terminal (ideally run the .swift from a shared folder), but than I got the error: "no such module".
I found that I could pass -I flag and specify a path for the lib, but does not working for me.
Can someone give an easy explanation how to import external library in such situation?

How to compile Swift programs for testing on the command line

I am trying to set up a Swift project on the command line, preferably for both OS X and Linux. I managed to compile Swift source to executable binaries, dynamic libraries and Swift modules on OS X. Now I am trying to get testing to work by using the XCTest framework. When I am trying to compile the testing module, the compiler tells me that my module was not "compiled for testing". While there are a lot of hints about "enabling testability" in Xcode, I couldn't find any pointers about doing this with the Swift command line compiler. So, how can do this?

Ocaml. Core module in OcaIDE eclipse

I started programming with Ocaml few days ago.
I use eclipse OcaIDE, ubuntu.
When I try to use the Core module in a code :
open Core.Std
...
I get an error:
Error: Unbound module Unix
I tried to create .ocamlinit file with adds:
#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;
The same error occurs in eclipse.
Сode without the use of the modules run fine.
Please, tell me, what I have to do?
Sorry for bad english.
Thank You for your answers!
OCaIDE is not wide-spread in OCaml community, so it is not well supported. Try to use emacs or vim. If you insist on using OCaIDE, then a good place to start is to view tutorials.
P.S. Even if you manage to configure OCaIDE it will be still much worse than Emacs+Merlin.

Under cygwin64 and gtk2, how to specify includes and libraries?

I am using cygwin64 installed in C:/cygwin64, with eclipse and GTK2.0. Although include <gtk/gtk.h> is in the source, and C:/cygwin64/usr/include/gtk-2.0 is in the include path (I added it), many things in a gtk2 simple example are still not recognized, such as GtkWidget, gpointer, and GTK_WINDOW_TOPLEVEL. I got the whole of GTK2 via cygwin setup. I was and am reluctant to download all of GTK2 separately and install it on top of cygwin, since wouldn't it result in multiple locations for the same thing? How may I resolve it? Would separate download and installation not result in redundancy, and possible alternate or even conflicting aliases?
A secondary question: I am confused about the general library requirements. Cygwin is a package which runs on Windows, but offers a Linux/unix-like interface. This argues that the libraries should be .a and .so. But since it is Windows, I also see a lot of .dll within C:\cygwin64. Normally, I would expect that only cygwin proper would contain .dll files and all other code would be Linux code. Yet that seems not to be the case. Often, I see both .dll and .so libraries with the same base name. Which is it, dll, or .so and .a, etc?
A tertiary question relating to the one above involves the main gtk2 library. The projected usage is not developing these programs, but just using GTK2 in applications. The documentation says to use glib, but there are many. Some are glib2.so, others glib2, or cygglib2.0.0.dll. Which of these is appropriate? or some other library? How do I set the exclipse LIBRARY path? (Since I unexpectedly encountered the problem with gtk.h, I am trying to anticipate and head off the corresponding problem with the library implementing gtk2.)

How can I import a .PYD module in IronPython?

I'm trying to use a python package from IronPython.
Everything works fine if I import regular python modules.
But when I try to do the following:
import win32ui
I get:
No module named win32ui
I've hunted through the code in IronPython.Runtime.Importer and there's no mention of .pyd
Anyone know a way around this?
You can check out IronClad which is working to provide this support. It may or may not work w/ your PYD of choice.
A .pyd file is a DLL. So unless IronPython (which is written in .net) can correctly load C DLLs written for CPython, you might be out of luck.
Update
In fact, according to the IronPython FAQ, you are unfortunately unable to import .pyd files:
Q: How do I build and call into PYD libraries?
A: IronPython does not support using PYDs built for CPython since they
leverage implementation details of CPython. You can get a similar
effect for new "PYD"s you would like to implement by writing them in C#
or VB and building a DLL for .NET.