Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake portable definitions: #36

Merged
merged 2 commits into from
Sep 7, 2015

Conversation

victorsndvg
Copy link

fixed some forced definition flags problems while compiling with
XLF (v14.1):

- Changed some :
              SET(FPPFLAGS -D...  
  for:
              ADD_DEFINITION(-D...

It compiles now with XLF.

fixed some forced definition flags problems while compiling with
XLF (v14.1):

    - Changed some *SET(FPPFLAGS -D...* for
                   *ADD_DEFINITION(-D...*

It compiles now with XLF.
@victorsndvg
Copy link
Author

Hi @andreww ,

I'm not sure if I'm doing "clean" things in the last commit:
-> ADD_DEFINITION(-DxlC)

Is xlC flag intended for this use?

@andreww
Copy link
Owner

andreww commented Sep 6, 2015

I'm unsure about ADD_DEFINITION(-DxlC). Clearly this needs to be set
for the pxfflush subroutine in fox_m_fsys_abort_flush.F90 where you
need to call it flush_, but the autoconfig stuff (e.g. line 1053 in aclocal.m
and line 103 in TW_FC_CHECK_FLUSH.m4) does not appear to set this.
However, almost all the autoconfig stuff dates back to before my involvement
with FoX and I think it mostly dates back before FoX itself. One possibility is
that older versions of the IBM compiler used to set -DxlC automatically, but
(and, for whatever reason, it no longer does this). Another is that FoX has never
compiled properly with XLF.

A complication with this is that I don't have access to a machine with an XLF
compiler. @victorsndvg - could you see if FoX compiles with:

./configure ; make 

under XLF and try to see if -DxlC is set during the compilation?

I'm tempted to apply this patch anyway once I'm back in the office
tomorrow. It would be nice if we could use CTest to run the test
suite - it would then be possible to automate the testing on remote
machines.

@victorsndvg
Copy link
Author

Hi @andreww ,

I don't know how autotools works. I can't help you at this point.

I tried to do ./configure; make and it don't crash, it seems that all are compiled properly.

At the configure step, it properly detects the flush_ method:

checking how to compile a call to FLUSH... with underscore

It also happend with CMake, but in this case we get a compile time crash,

I've added a small check inside xml_openfile subroutine:

#ifdef xlC print*, 'xlC flag enabled' #else print*, 'xlC flag disabled' #endif

And it seems that xlC is not set, it returns:

xlC flag disabled

I don't know how we can fix this in CMake as clean as possible, if you have any suggestion I will be glad to help.

I think that is a good idea to integrate CTest. I will send you a merge request with this feature as soon as possible. Note that I'm not an expert using CMake tools, but I will try to give the better :)

@andreww andreww merged commit fa0099d into andreww:master Sep 7, 2015
@andreww
Copy link
Owner

andreww commented Sep 7, 2015

Ok - I guess that I've not fully traced what the configure script is doing. Anyway, merged. I've added another issue to remind me that it is a good idea to check to see that ./configure and CMake are doing the same thing in this case (i.e. setting -DxlC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants