Sunday, December 31, 2017

Re: NEW: lang/flang

On 12/31/17 11:35, Rafael Sadowski wrote:
> On Sun Dec 31, 2017 at 10:10:55AM -0500, Brian Callahan wrote:
>> On 12/31/17 09:43, Rafael Sadowski wrote:
>>> On Sat Dec 30, 2017 at 10:12:23PM -0500, Brian Callahan wrote:
>>>> On 12/23/17 00:00, Brian Callahan wrote:
>>>>> On 12/15/17 23:43, Brian Callahan wrote:
>>>>>> On 12/10/17 12:27, Brian Callahan wrote:
>>>>>>> Hi ports --
>>>>>>>
>>>>>>> Attached is a new port, lang/flang. Flang is a Fortran compiler
>>>>>>> targeting LLVM.
>>>>>>>
>>>>>>> Supposedly Flang is on its way to becoming part of LLVM, though
>>>>>>> there's no timetable for that.
>>>>>>>
>>>>>>> Flang is divided into two ports, the driver and the runtime. The
>>>>>>> driver is a modified version of clang. I chose to only install
>>>>>>> the flang driver binary from the driver port. The CMake build
>>>>>>> system wants to install the entirety of the clang utils and
>>>>>>> libraries and headers, but that means having three copies of
>>>>>>> some things (1 in base, 1 from devel/llvm, 1 from flang), and
>>>>>>> that seemed crazy. We only need the flang driver binary anyway.
>>>>>>>
>>>>>>> In order to link binaries with flang, you must remember to
>>>>>>> include -L${LOCALBASE}/lib -lflang when linking the binary.
>>>>>>>
>>>>>>> I chose to use flang's built-in ompstubs library for OpenMP
>>>>>>> "support." And by "support" I mean that the ompstubs library is
>>>>>>> just stubbed out omp routines that do nothing but allow flang to
>>>>>>> build. According to upstream, !amd64 archs use the ompstubs
>>>>>>> library anyway. It would be nice to eventually move to real
>>>>>>> OpenMP support, but that can be for a later day.
>>>>>>>
>>>>>>> Only tested on amd64 because I do not (yet) have an arm64
>>>>>>> machine. Flang only supports those two platforms. I will add the
>>>>>>> needed arm64 bits once I have my arm64 machine. Flang
>>>>>>> successfully builds a bunch of F90/F95 programs I have and
>>>>>>> passes a significant chunk of the NIST F77 test suite.
>>>>>>>
>>>>>>> OK?
>>>>>>>
>>>>>>> ~Brian
>>>>>>>
>>>>>> Ping. Tarball with latest version attached.
>>>>>>
>>>>>> OK?
>>>>>>
>>>>>> ~Brian
>>>>>>
>>>>> Anyone?
>>>>>
>>>>> Latest tarball attached.
>>>>>
>>>>> ~Brian
>>>>>
>>>> Weekly bump with the latest tarball attached :)
>>>>
>>>> ~Brian
>>>>
>>> Not much to grumble about.
>>>
>>> * Tab(s) after PERMIT_PACKAGE_CDROM
>> Fixed.
>>
>>> * Some comments in the patches would be very helpful.
>> Comments added, but only to the flang/flang part. The patches directory in
>> flang/driver are direct copies of the clang patches from the devel/llvm
>> port. I'll have to keep doing that going forward for ease of maintenance, I
>> think.
> Thanks, could we also add a comment in Makefile? So that no one forgets
> to synchronize the patches with devel/llvm.

Sure.

>>> Only build test on amd64. Is there any run test I could do?
>> flang/flang is a test of itself, which is nice. Otherwise, your favorite F95
>> programs?
> Is there any clue?
>
> $ flang hello.f90
> /usr/bin/ld: cannot find -lflangmain
> flang: error: linker command failed with exit code 1 (use -v to see invocation)
>

flang hello.f90 -L/usr/local/lib -lflang

No comments:

Post a Comment