Fortran Coder

查看: 6613|回复: 2
打印 上一主题 下一主题

[编译器] CMAKE安装Plplot

[复制链接]

13

帖子

5

主题

0

精华

入门

F 币
75 元
贡献
39 点
跳转到指定楼层
楼主
发表于 2018-4-17 09:57:43 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
大家有用fortran画图吗?
下面是一种解决方案,用到的软件是Plplot,但是需要先安装Cmake,安装过程中出错。


将ENABLE_fortran之前的勾去掉,就可以成功generate

然而我要用的就是fortran啊~

按照搜索到的一些解决办法,觉得是编译器的选择问题,具体如下



用的是intel visual fortran 2013,win10系统,
在Compilers->Fortran下寻找编译器,在ivf的安装目录下没找到编译器,该如何解决呢?

Cmake04.jpg (21.21 KB, 下载次数: 205)

Cmake04.jpg
分享到:  微信微信
收藏收藏 点赞点赞 点踩点踩

13

帖子

5

主题

0

精华

入门

F 币
75 元
贡献
39 点
沙发
 楼主| 发表于 2018-4-18 11:03:09 | 只看该作者
本帖最后由 wdy 于 2018-4-18 11:05 编辑

下面这段是从Plplot源目录bindings\fortran\Cmakelists.txt文件中摘录的:

if(ENABLE_fortran)

if(CMAKE_Fortran_COMPILER MATCHES "gfortran")
    message (STATUS
      "WARNING concerning spurious warning messages generated by the gfortran compiler.
   The new Fortran binding is known to generate some ~50 \"marked
   PRIVATE\" warning messages when building the plplotfortran target with the
   gfortran Fortran compiler.  A typical example of such a warning
   message is

   Warning: Symbol 'interface_plcont' at (1) is marked PRIVATE but has been given the binding label 'c_plcont'

   It appears these warnings (which do not occur if using the ifort or
   nagfor Fortran compilers) are due to a gfortran bug (see
   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49111> and
   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64861>), i.e., they
   are spurious warnings concerning completely valid use of the
   private attribute for interface blocks describing C routines.
   There appear to be no known negative consequences of this gfortran
   bug other than the spurious warnings themselves.  Until this gfortran
   bug is fixed, these ~50 \"marked PRIVATE\" warnings should just be
   ignored for those using gfortran."
     )
  endif(CMAKE_Fortran_COMPILER MATCHES "gfortran")
  
# Set the include path
  include_directories(
    ${CMAKE_SOURCE_DIR}/include
    ${CMAKE_SOURCE_DIR}/lib/qsastime
    ${CMAKE_BINARY_DIR}
    ${CMAKE_BINARY_DIR}/include
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${CMAKE_CURRENT_BINARY_DIR}
    )

  ## Build C part of Fortran bindings
  if(WIN32_OR_CYGWIN)
    # Set the flags for the C compiler. The C stubs need to have the
    # correct case and calling convention for the Fortran compiler
    IF(TARGET_FORTRAN MATCHES "IVF")
      SET(DEFFILE "_ifort")
      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF")
    ELSEIF(TARGET_FORTRAN MATCHES "CVF")
      SET(DEFFILE "")
      SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF")
    ENDIF(TARGET_FORTRAN MATCHES "IVF")
  endif(WIN32_OR_CYGWIN)

这段代码似乎是针对gfortran编译器的,接下来提到的ivf也是包含在if(win32)条件语句中,是不是只能用32位的编译器?下载的Plplot版本是最新的5.13.0,不应该是这样的啊~~!

13

帖子

5

主题

0

精华

入门

F 币
75 元
贡献
39 点
板凳
 楼主| 发表于 2018-4-18 11:24:35 | 只看该作者
wdy 发表于 2018-4-18 11:03
下面这段是从Plplot源目录bindings\fortran\Cmakelists.txt文件中摘录的:

if(ENABLE_fortran)

将Plplot版本换成5.10.0就可以顺利generate了,看来是版本的问题
您需要登录后才可以回帖 登录 | 极速注册

本版积分规则

捐赠本站|Archiver|关于我们 About Us|小黑屋|Fcode ( 京ICP备18005632-2号 )

GMT+8, 2024-4-27 12:38

Powered by Tencent X3.4

© 2013-2024 Tencent

快速回复 返回顶部 返回列表