CMAKE安装Plplot
大家有用fortran画图吗?下面是一种解决方案,用到的软件是Plplot,但是需要先安装Cmake,安装过程中出错。
将ENABLE_fortran之前的勾去掉,就可以成功generate
然而我要用的就是fortran啊~
按照搜索到的一些解决办法,觉得是编译器的选择问题,具体如下
用的是intel visual fortran 2013,win10系统,
在Compilers->Fortran下寻找编译器,在ivf的安装目录下没找到编译器,该如何解决呢?
本帖最后由 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,不应该是这样的啊~~!
wdy 发表于 2018-4-18 11:03
下面这段是从Plplot源目录bindings\fortran\Cmakelists.txt文件中摘录的:
if(ENABLE_fortran)
将Plplot版本换成5.10.0就可以顺利generate了,看来是版本的问题:-hug:
页:
[1]