Quantcast
Viewing all articles
Browse latest Browse all 77

Compiling the runtime on Cygwin

Hi,

I tried compiling the runtime on latest Cygwin w/ GCC 5.3, but ran into some errors which are solved with the patch below.

A few of the code samples do work well under Cygwin (e.g. Fibonacci), but some don't (cilk-reducers-demo never finishes). Unfortunately I'm at the limit of my debugging skills and time to figure out why.
 

diff -Naur cilkplus-rtl-src-004420/runtime/os-unix.c
cilkplus-rtl-src-004420_cygwin/runtime/os-unix.c
--- cilkplus-rtl-src-004420/runtime/os-unix.c      2015-11-09
22:27:52.000000000 +0100
+++ cilkplus-rtl-src-004420_cygwin/runtime/os-unix.c  2016-02-11
11:54:05.473915000 +0100
@@ -432,7 +432,8 @@
 #elif defined(__MIC__)
     _mm_delay_32(1024);
 #elif defined(__linux__) || \
-      defined(__APPLE__)
+      defined(__APPLE__) || \
+      defined(__CYGWIN__)
     usleep(10000);
 #else
 # error "Unsupported architecture"
@@ -452,6 +453,7 @@
 {
 #if defined(__ANDROID__)  || \
     defined(__APPLE__)    || \
+    defined(__CYGWIN__)   || \
     defined(__FreeBSD__)  || \
     defined(__VXWORKS__)  || \
     (defined(__sun__) && defined(__svr4__))
diff -Naur /cygdrive/d/Downloads/cilk/cilkplus-rtl-src-004420/runtime/sysdep-unix.c
cilkplus-rtl-src-004420/runtime/sysdep-unix.c
--- cilkplus-rtl-src-004420/runtime/sysdep-unix.c
2015-11-09 22:27:54.000000000 +0100
+++ cilkplus-rtl-src-004420_cygwin/runtime/sysdep-unix.c
2016-02-10 18:08:51.610235700 +0100
@@ -568,7 +568,7 @@
 {
     // dladdr is a glibc extension. If it's available, use it to find the path
     // for libcilkrts.so
-#ifdef _GNU_SOURCE
+#if defined(_GNU_SOURCE) && !defined(__CYGWIN__)
     Dl_info info;
     if (0 != dladdr(dummy_function, &info))
         return info.dli_fname;

 


Viewing all articles
Browse latest Browse all 77

Trending Articles