Jump to page: 1 2
Thread overview
Can't manage to build ldc, problem seems to be compiling ldc/runtime/profile-rt/profile-rt-38/GCDAProfiling.c
Jul 23, 2016
Andrew
Jul 23, 2016
Johan Engelen
Jul 23, 2016
Andrew
Jul 23, 2016
Johan Engelen
Jul 23, 2016
Johan Engelen
Jul 23, 2016
Andrew
Jul 23, 2016
Andrew
Jul 23, 2016
Johan Engelen
Jul 23, 2016
Andrew
Jul 23, 2016
Andrew
Jul 23, 2016
Johan Engelen
Jul 23, 2016
Andrew
Jul 24, 2016
Johan Engelen
Jul 24, 2016
Andrew
Jul 24, 2016
Andrew
Jul 24, 2016
Johan Engelen
Jul 26, 2016
Johan Engelen
Jul 23, 2016
Andrew
July 23, 2016
Hi

While I have no problems on my laptop, running make fails to build ldc on my university's cluster. I'm trying with the latest master and llvm 3.8.0. The cmake command I'm using is:

cmake -L -DLLVM_CONFIG="/home/abrown/software/llvm/bin/llvm-config" -DLIBCONFIG_LIBRARY="/home/abrown/software/libs/lib/libconfig.a" -DLIBCONFIG_INCLUDE_DIR="/home/abrown/software/libs/include" -DCMAKE_INSTALL_PREFIX="/home/abrown/software/bin_files" ..

The lines with errors are copied below:

/home/abrown/software/ldc/runtime/profile-rt/profile-rt-38/GCDAProfiling.c:221:23: error: ‘MAP_FILE’ undeclared (first use in this function)
make[2]: *** [runtime/CMakeFiles/ldc-profile-rt.dir/profile-rt/profile-rt-38/GCDAProfiling.c.o] Error 1
make[1]: *** [runtime/CMakeFiles/ldc-profile-rt.dir/all] Error 2
make: *** [all] Error 2

Any help would be greatly appreciated, is there any other information I should share when asking these questions?

Thanks very much

Andrew


July 23, 2016
On Saturday, 23 July 2016 at 12:19:34 UTC, Andrew wrote:
>
> While I have no problems on my laptop, running make fails to build ldc on my university's cluster.

What OS is used on the cluster?


July 23, 2016
On Saturday, 23 July 2016 at 12:59:47 UTC, Johan Engelen wrote:
> On Saturday, 23 July 2016 at 12:19:34 UTC, Andrew wrote:
>>
>> While I have no problems on my laptop, running make fails to build ldc on my university's cluster.
>
> What OS is used on the cluster?

cat /etc/centos-release

gives

Red Hat Enterprise Linux Server release 6.5 (Santiago)
July 23, 2016
On Saturday, 23 July 2016 at 13:02:34 UTC, Andrew wrote:
> On Saturday, 23 July 2016 at 12:59:47 UTC, Johan Engelen wrote:
>> On Saturday, 23 July 2016 at 12:19:34 UTC, Andrew wrote:
>>>
>>> While I have no problems on my laptop, running make fails to build ldc on my university's cluster.
>>
>> What OS is used on the cluster?
>
> cat /etc/centos-release
>
> gives
>
> Red Hat Enterprise Linux Server release 6.5 (Santiago)

MAP_FILE is a system #define. Perhaps an extra file must be #included.
Does it work if you change `MAP_FILE | MAP_SHARED` to just `MAP_SHARED`?
(i.e. can it find `MAP_SHARED`?)
July 23, 2016
Can you check whether the file "sys/mman.h" contains MAP_FILE or not?
July 23, 2016
On Saturday, 23 July 2016 at 13:11:22 UTC, Johan Engelen wrote:
> On Saturday, 23 July 2016 at 13:02:34 UTC, Andrew wrote:
>> On Saturday, 23 July 2016 at 12:59:47 UTC, Johan Engelen wrote:
>>> On Saturday, 23 July 2016 at 12:19:34 UTC, Andrew wrote:
>>>>
>>>> While I have no problems on my laptop, running make fails to build ldc on my university's cluster.
>>>
>>> What OS is used on the cluster?
>>
>> cat /etc/centos-release
>>
>> gives
>>
>> Red Hat Enterprise Linux Server release 6.5 (Santiago)
>
> MAP_FILE is a system #define. Perhaps an extra file must be #included.
> Does it work if you change `MAP_FILE | MAP_SHARED` to just `MAP_SHARED`?
> (i.e. can it find `MAP_SHARED`?)

That's lovely, thanks very much. With that change it just built. I only changed it in ldc/runtime/profile-rt/profile-rt-38/GCDAProfiling.c. Grep found a couple of other examples in other folders, but I just left those.

I ran ctest and got the following results (core.time has always failed on this cluster):

99% tests passed, 3 tests failed out of 751

Total Test time (real) = 1325.92 sec

The following tests FAILED:
         21 - core.time (OTHER_FAULT)
        390 - core.time-debug (OTHER_FAULT)
        751 - lit-tests (Failed)

So should I keep patching it in this way? Is there any better solution I could help with?

Thanks again for your help

Andrew
July 23, 2016
On Saturday, 23 July 2016 at 13:34:14 UTC, Johan Engelen wrote:
> Can you check whether the file "sys/mman.h" contains MAP_FILE or not?

Sorry, replied without seeing this message. In /usr/include/sys/mman.h there's no mention of MAP_FILE or MAP_SHARED
July 23, 2016
On Saturday, 23 July 2016 at 14:04:22 UTC, Andrew wrote:
> On Saturday, 23 July 2016 at 13:34:14 UTC, Johan Engelen wrote:
>> Can you check whether the file "sys/mman.h" contains MAP_FILE or not?
>
> Sorry, replied without seeing this message. In /usr/include/sys/mman.h there's no mention of MAP_FILE or MAP_SHARED

/usr/include/bits/mman.h has:

# define MAP_FILE	0
July 23, 2016
On Saturday, 23 July 2016 at 14:07:20 UTC, Andrew wrote:
> On Saturday, 23 July 2016 at 14:04:22 UTC, Andrew wrote:
>> On Saturday, 23 July 2016 at 13:34:14 UTC, Johan Engelen wrote:
>>> Can you check whether the file "sys/mman.h" contains MAP_FILE or not?
>>
>> Sorry, replied without seeing this message. In /usr/include/sys/mman.h there's no mention of MAP_FILE or MAP_SHARED
>
> /usr/include/bits/mman.h has:
>
> # define MAP_FILE	0

Where is MAP_SHARED defined?

This is a bug in LLVM's compile-rt project, and it'd be good to find a proper fix for it.
Perhaps it is adding the correct header file, or adding
#ifndef MAP_FILE
# define MAP_FILE 0
#endif

July 23, 2016
On Saturday, 23 July 2016 at 15:06:12 UTC, Johan Engelen wrote:
>
> Where is MAP_SHARED defined?
>
> This is a bug in LLVM's compile-rt project, and it'd be good to find a proper fix for it.
> Perhaps it is adding the correct header file, or adding
> #ifndef MAP_FILE
> # define MAP_FILE 0
> #endif

MAP_SHARED is defined in /usr/include/bits/mman.h as well:

#define MAP_SHARED	0x01		/* Share changes.  */

and /usr/include/sys/mman.h has the line:

#include <bits/mman.h>

I tried the following code, cut and pasting the header lines from GCDAProfiling.c:

#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#if defined(_WIN32)
#include "WindowsMMap.h"
#else
#include <sys/mman.h>
#include <sys/file.h>
#endif

int main()
{
  printf("%d,%d\n", MAP_FILE, MAP_SHARED);
  return 0;
}

and it outputted 0,1

I've also tried adding the lines

#ifndef MAP_FILE
# define MAP_FILE 0
#endif

straight after the #include <sys/mman.h> line (reverting the previous change) and that compiles fine too.

This isn't the first time this cluster has left me confused. Could it be that the problem is on this end, and the cluster has been set up in a funny way?

Andrew
« First   ‹ Prev
1 2