[Flang-dev] Flang honoring-DCMAKE_Fortran_COMPILER=${PATH}

Stephen Scalpone sscalpone at nvidia.com
Thu Jul 12 19:26:42 EDT 2018


Thanks for digging in!

We are using Apache 2 license.  However, we require a signed contributor license agreement.

See https://github.com/flang-compiler/flang/wiki/Community#contributing-code

- Steve

From: flang-dev <flang-dev-bounces at lists.flang-compiler.org> on behalf of blubee blubeeme <gurenchan at gmail.com>
Date: Thursday, July 12, 2018 at 4:16 PM
To: "Morin, Monique Marlene" <morin at lanl.gov>
Cc: "flang-dev at lists.flang-compiler.org" <flang-dev at lists.flang-compiler.org>
Subject: Re: [Flang-dev] Flang honoring-DCMAKE_Fortran_COMPILER=${PATH}

I have some patches that fixes all these issues, how can I submit patches?

As far as license concerned I provide them whatever license the flang team needs.

Best,
Owen
On Thu, Jul 12, 2018, 21:32 Morin, Monique Marlene <morin at lanl.gov<mailto:morin at lanl.gov>> wrote:

We have had similar trouble with cmake flags not being honored at certain points in the build from source process for Flang -- this was not always the case a couple of months ago.



Our solution/work-around has been to manually set/change environment variables throughout install steps.



It would be great if this could be fixed and we could provide feedback about install as well.

Thanks!

________________________________
From: flang-dev <flang-dev-bounces at lists.flang-compiler.org<mailto:flang-dev-bounces at lists.flang-compiler.org>> on behalf of blubee blubeeme <gurenchan at gmail.com<mailto:gurenchan at gmail.com>>
Sent: Wednesday, July 11, 2018 11:24 PM
To: flang-dev at lists.flang-compiler.org<mailto:flang-dev at lists.flang-compiler.org>
Subject: [Flang-dev] Flang honoring-DCMAKE_Fortran_COMPILER=${PATH}

Hi

I am trying to build flang the build fails with this error:
[ 25%] Preprocessing ieee_arithmetic.F95
cd /wrkdirs/usr/ports/devel/flang-flang/work/.build/runtime/flang && /usr/bin/cc -E /wrkdirs/usr/ports/devel/flang-flang/work/flang-45d7aeb/runtime/flang/ieee_arithmetic.F95 -DDESC_I8 > I8_sources/ieee_arithmetic.F95
cc: error: unable to execute command: Executable "gcc" doesn't exist!
*** Error code 1

slack user: https://flang-compiler.slack.com/team/U5CNV08UB suggested that I replace cc with flang -E

After making those changes to the generated cmake files located:
.build/runtime/flang/CMakeFiles/flang_shared.dir/build.make

and replacing all calls to cc with flang -E as below
--------------------------------------------------------------------------------------
runtime/flang/I8_sources/ieee_arithmetic.F95:
        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/wrkdirs/usr/ports/devel/flang-flang/work/.build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Preprocessing ieee_arithmetic.F95"
        cd /wrkdirs/usr/ports/devel/flang-flang/work/.build/runtime/flang && /usr/local/flang/bin/flang -E /wrkdirs/usr/ports/devel/flang-flang/work/flang-45d7aeb/runtime/flang/ieee_arithmetic.F95 -DDESC_I8 > I8_sources/ieee_arithmetic.F95

runtime/flang/I8_sources/ieee_exceptions.F95:
        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/wrkdirs/usr/ports/devel/flang-flang/work/.build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Preprocessing ieee_exceptions.F95"
        cd /wrkdirs/usr/ports/devel/flang-flang/work/.build/runtime/flang && /usr/local/flang/bin/flang -E /wrkdirs/usr/ports/devel/flang-flang/work/flang-45d7aeb/runtime/flang/ieee_exceptions.F95 -DDESC_I8 > I8_sources/ieee_exceptions.F95

runtime/flang/CMakeFiles/flang_shared.dir/abort3f.c.o: runtime/flang/CMakeFiles/flang_shared.dir/flags.make
runtime/flang/CMakeFiles/flang_shared.dir/abort3f.c.o: /wrkdirs/usr/ports/devel/flang-flang/work/flang-45d7aeb/runtime/flang/abort3f.c
        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/wrkdirs/usr/ports/devel/flang-flang/work/.build/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building C object runtime/flang/CMakeFiles/flang_shared.dir/abort3f.c.o"
        cd /wrkdirs/usr/ports/devel/flang-flang/work/.build/runtime/flang && /usr/local/flang/bin/flang $(C_DEFINES) -DHAVE_LONG_LONG_INT -DINT32PTR64 -DKANJI -DPGF90 -DTM_I8 $(C_INCLUDES) $(C_FLAGS) -o CMakeFiles/flang_shared.dir/abort3f.c.o   -c /wrkdirs/usr/ports/devel/flang-flang/work/flan
g-45d7aeb/runtime/flang/abort3f.c

runtime/flang/CMakeFiles/flang_shared.dir/abort3f.c.i: cmake_force
        @echo "Preprocessing C source to CMakeFiles/flang_shared.dir/abort3f.c.i"
        cd /wrkdirs/usr/ports/devel/flang-flang/work/.build/runtime/flang && /usr/local/flang/bin/flang $(C_DEFINES) -DHAVE_LONG_LONG_INT -DINT32PTR64 -DKANJI -DPGF90 -DTM_I8 $(C_INCLUDES) $(C_FLAGS) -E /wrkdirs/usr/ports/devel/flang-flang/work/flang-45d7aeb/runtime/flang/abort3f.c > CMakeFile
s/flang_shared.dir/abort3f.c.i

runtime/flang/CMakeFiles/flang_shared.dir/abort3f.c.s: cmake_force
        @echo "Compiling C source to assembly CMakeFiles/flang_shared.dir/abort3f.c.s"
        cd /wrkdirs/usr/ports/devel/flang-flang/work/.build/runtime/flang && /usr/local/flang/bin/flang $(C_DEFINES) -DHAVE_LONG_LONG_INT -DINT32PTR64 -DKANJI -DPGF90 -DTM_I8 $(C_INCLUDES) $(C_FLAGS) -S /wrkdirs/usr/ports/devel/flang-flang/work/flang-45d7aeb/runtime/flang/abort3f.c -o CMakeFil
es/flang_shared.dir/abort3f.c.s
--------------------------------------------------------------------------------------

The project compiles.

My questions is it possible to have the CMake properly generate the files so that I do not have to manually edit them during the middle of a build?

Are there any patches that I could apply to get this to build properly, I don't mind testing it before it's upstreamed.

Best,
Owen

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.flang-compiler.org/pipermail/flang-dev_lists.flang-compiler.org/attachments/20180712/39d6e789/attachment-0001.html>


More information about the flang-dev mailing list