FortranCInterface not working with 3.9.0 with Intel 2015

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

FortranCInterface not working with 3.9.0 with Intel 2015

John Cary
Works with 3.8.2.

Compilers specified by

-DCMAKE_C_COMPILER:FILEPATH='C:/Program Files (x86)/Intel/Composer XE
2015/bin/intel64/icl.exe' -DCMAKE_CXX_COMPILER:FILEPATH='C:/Program
Files (x86)/Intel/Composer XE 2015/bin/intel64/icl.exe'
-DCMAKE_Fortran_COMPILER:FILEPATH='C:/Program Files (x86)/Intel/Composer
XE 2015/bin/intel64/ifort.exe'

The cmake code is

include(FortranCInterface)
FortranCInterface_HEADER(
  ${CMAKE_BINARY_DIR}/FCMangle.h
  MACRO_NAMESPACE "FC_"
  SYMBOL_NAMESPACE "FC_"
  SYMBOLS mysub mymod:my_sub
)

The relevant output is

-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Failed to compile
CMake Warning (dev) at
C:/winsame/cary/usim/contrib-icl15/cmake-3.9.0-ser/share/
cmake-3.9/Modules/FortranCInterface.cmake:309 (message):
  No FortranCInterface mangling known for mysub
Call Stack (most recent call first):
  scimake/SciFortranChecks.cmake:269 (FortranCInterface_HEADER)
  scimake/SciInit.cmake:232 (include)
  CMakeLists.txt:28 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at
C:/winsame/cary/usim/contrib-icl15/cmake-3.9.0-ser/share/
cmake-3.9/Modules/FortranCInterface.cmake:295 (message):
  No FortranCInterface mangling known for mymod:my_sub
Call Stack (most recent call first):
  scimake/SciFortranChecks.cmake:269 (FortranCInterface_HEADER)
  scimake/SciInit.cmake:232 (include)
  CMakeLists.txt:28 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

The resulting file is

$ cat FCMangle.h
#ifndef FC_HEADER_INCLUDED
#define FC_HEADER_INCLUDED

/*--------------------------------------------------------------------------*/
/* Mangle some symbols
automatically.                                       */

#endif

Any help appreciated..........John Cary




--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: FortranCInterface not working with 3.9.0 with Intel 2015

Bill Hoffman
On 11/26/2017 6:29 PM, JR Cary wrote:
> Works with 3.8.2.
>
Does it work with 3.10?

Also, look in the CMakeFiles/CMakeError.log file to find out why this
happened: - Detecting Fortran/C Interface - Failed to compile.

-Bill
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: FortranCInterface not working with 3.9.0 with Intel 2015

John Cary
In reply to this post by John Cary

> Does it work with 3.10?
 
It works with no version from  3.9.0 - 3.10.0.

> Also, look in the CMakeFiles/CMakeError.log file to find out why this
> happened: - Detecting Fortran/C Interface - Failed to compile.

Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed.
Compiler: C:/Program Files (x86)/Intel/Composer XE 2015/bin/intel64/ifort.exe
Build flags:
Id flags: -v

The output was:
0
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.6.285 Build 20151119
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.
ifort: command line warning #10006: ignoring unknown option '/v'

CMakeFortranCompilerId.F(2): warning #5117: Bad # preprocessor line
#if 0
...

Looks from https://stackoverflow.com/questions/36557120/usual-causes-for-bad-preprocessor-warning
that the preprocessor is not being run.  It requires -fpp to be added to the Fortran compiler
flags.  I do not see how to do that for CMakeFortranCompilerId.F.  Tried

  set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp")

but that did not help.



On 11/26/17 4:29 PM, JR Cary wrote:

> Works with 3.8.2.
>
> Compilers specified by
>
> -DCMAKE_C_COMPILER:FILEPATH='C:/Program Files (x86)/Intel/Composer XE
> 2015/bin/intel64/icl.exe' -DCMAKE_CXX_COMPILER:FILEPATH='C:/Program
> Files (x86)/Intel/Composer XE 2015/bin/intel64/icl.exe'
> -DCMAKE_Fortran_COMPILER:FILEPATH='C:/Program Files (x86)/Intel/Composer
> XE 2015/bin/intel64/ifort.exe'
>
> The cmake code is
>
> include(FortranCInterface)
> FortranCInterface_HEADER(
>   ${CMAKE_BINARY_DIR}/FCMangle.h
>   MACRO_NAMESPACE "FC_"
>   SYMBOL_NAMESPACE "FC_"
>   SYMBOLS mysub mymod:my_sub
> )
>
> The relevant output is
>
> -- Detecting Fortran/C Interface
> -- Detecting Fortran/C Interface - Failed to compile
> CMake Warning (dev) at
> C:/winsame/cary/usim/contrib-icl15/cmake-3.9.0-ser/share/
> cmake-3.9/Modules/FortranCInterface.cmake:309 (message):
>   No FortranCInterface mangling known for mysub
> Call Stack (most recent call first):
>   scimake/SciFortranChecks.cmake:269 (FortranCInterface_HEADER)
>   scimake/SciInit.cmake:232 (include)
>   CMakeLists.txt:28 (include)
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> CMake Warning (dev) at
> C:/winsame/cary/usim/contrib-icl15/cmake-3.9.0-ser/share/
> cmake-3.9/Modules/FortranCInterface.cmake:295 (message):
>   No FortranCInterface mangling known for mymod:my_sub
> Call Stack (most recent call first):
>   scimake/SciFortranChecks.cmake:269 (FortranCInterface_HEADER)
>   scimake/SciInit.cmake:232 (include)
>   CMakeLists.txt:28 (include)
> This warning is for project developers.  Use -Wno-dev to suppress it.
>
> The resulting file is
>
> $ cat FCMangle.h
> #ifndef FC_HEADER_INCLUDED
> #define FC_HEADER_INCLUDED
>
> /*--------------------------------------------------------------------------*/
> /* Mangle some symbols
> automatically.                                       */
>
> #endif
>
> Any help appreciated..........John Cary
>
>
>
>

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: FortranCInterface not working with 3.9.0 with Intel 2015

Bill Hoffman
Can you just send me a zip or tar file of the build tree from your project?

Thanks.

On 12/2/2017 4:17 AM, JR Cary wrote:

>
>> Does it work with 3.10?
>  
> It works with no version from  3.9.0 - 3.10.0.
>
>> Also, look in the CMakeFiles/CMakeError.log file to find out why this
>> happened: - Detecting Fortran/C Interface - Failed to compile.
>
> Compiling the Fortran compiler identification source file "CMakeFortranCompilerId.F" failed.
> Compiler: C:/Program Files (x86)/Intel/Composer XE 2015/bin/intel64/ifort.exe
> Build flags:
> Id flags: -v
>
> The output was:
> 0
> Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.6.285 Build 20151119
> Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.
> ifort: command line warning #10006: ignoring unknown option '/v'
>
> CMakeFortranCompilerId.F(2): warning #5117: Bad # preprocessor line
> #if 0
> ...
>
> Looks from https://stackoverflow.com/questions/36557120/usual-causes-for-bad-preprocessor-warning
> that the preprocessor is not being run.  It requires -fpp to be added to the Fortran compiler
> flags.  I do not see how to do that for CMakeFortranCompilerId.F.  Tried
>
>    set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpp")
>
> but that did not help.
>
>
>
> On 11/26/17 4:29 PM, JR Cary wrote:
>> Works with 3.8.2.
>>
>> Compilers specified by
>>
>> -DCMAKE_C_COMPILER:FILEPATH='C:/Program Files (x86)/Intel/Composer XE
>> 2015/bin/intel64/icl.exe' -DCMAKE_CXX_COMPILER:FILEPATH='C:/Program
>> Files (x86)/Intel/Composer XE 2015/bin/intel64/icl.exe'
>> -DCMAKE_Fortran_COMPILER:FILEPATH='C:/Program Files (x86)/Intel/Composer
>> XE 2015/bin/intel64/ifort.exe'
>>
>> The cmake code is
>>
>> include(FortranCInterface)
>> FortranCInterface_HEADER(
>>    ${CMAKE_BINARY_DIR}/FCMangle.h
>>    MACRO_NAMESPACE "FC_"
>>    SYMBOL_NAMESPACE "FC_"
>>    SYMBOLS mysub mymod:my_sub
>> )
>>
>> The relevant output is
>>
>> -- Detecting Fortran/C Interface
>> -- Detecting Fortran/C Interface - Failed to compile
>> CMake Warning (dev) at
>> C:/winsame/cary/usim/contrib-icl15/cmake-3.9.0-ser/share/
>> cmake-3.9/Modules/FortranCInterface.cmake:309 (message):
>>    No FortranCInterface mangling known for mysub
>> Call Stack (most recent call first):
>>    scimake/SciFortranChecks.cmake:269 (FortranCInterface_HEADER)
>>    scimake/SciInit.cmake:232 (include)
>>    CMakeLists.txt:28 (include)
>> This warning is for project developers.  Use -Wno-dev to suppress it.
>>
>> CMake Warning (dev) at
>> C:/winsame/cary/usim/contrib-icl15/cmake-3.9.0-ser/share/
>> cmake-3.9/Modules/FortranCInterface.cmake:295 (message):
>>    No FortranCInterface mangling known for mymod:my_sub
>> Call Stack (most recent call first):
>>    scimake/SciFortranChecks.cmake:269 (FortranCInterface_HEADER)
>>    scimake/SciInit.cmake:232 (include)
>>    CMakeLists.txt:28 (include)
>> This warning is for project developers.  Use -Wno-dev to suppress it.
>>
>> The resulting file is
>>
>> $ cat FCMangle.h
>> #ifndef FC_HEADER_INCLUDED
>> #define FC_HEADER_INCLUDED
>>
>> /*--------------------------------------------------------------------------*/
>> /* Mangle some symbols
>> automatically.                                       */
>>
>> #endif
>>
>> Any help appreciated..........John Cary
>>
>>
>>
>>
>


--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
[hidden email]
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: FortranCInterface not working with 3.9.0 with Intel 2015

Bill Hoffman
In reply to this post by John Cary
Thanks for sending the files.  I think I might have found something.
The FortranCInterface.exe is not linking because of mismatched linker
commands.  Here are the errors:

Did you change any of the default compiler/linker flags?  It looks like
it is mixing run time libraries somehow.


[100%] Linking Fortran executable FortranCInterface.exe

LINK: command "xilink /nologo
@CMakeFiles\FortranCInterface.dir\objects1.rsp
/out:FortranCInterface.exe /implib:FortranCInterface.lib
/pdb:C:\winsame\cary\usimall\builds\ulixes\ser\CMakeFiles\FortranCInterface\FortranCInterface.pdb
/version:0.0 /machine:x64 /INCREMENTAL:NO /subsystem:console symbols.lib
myfort.lib user32.lib /MANIFEST
/MANIFESTFILE:FortranCInterface.exe.manifest" failed (exit code 1169)
with the following output:
xilink: executing 'link'

LIBCMT.lib(winapisupp.obj) : error LNK2005:
__crtSetUnhandledExceptionFilter already defined in MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(crtheap.obj) : error LNK2005: _calloc_crt already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(crt0dat.obj) : error LNK2005: _amsg_exit already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(crt0dat.obj) : error LNK2005: _cexit already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(crt0dat.obj) : error LNK2005: _initterm_e already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(crt0dat.obj) : error LNK2005: exit already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(mlock.obj) : error LNK2005: _lock already defined in
MSVCRT.lib(MSVCR120.dll)

LIBCMT.lib(mlock.obj) : error LNK2005: _unlock already defined in
MSVCRT.lib(MSVCR120.dll)




--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
[hidden email]
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake