- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我相信我的 Makefile(编译 Fortran 代码)使用的 cpp 预处理器有问题。我最近更换了操作系统,现在编译不起作用,我对 Makefile 或预处理器的了解不够,无法修复它(Makefile 是多年前给我的)。
我最近从 Fedora 10 更新到 Fedora 19(是的,应该更早更新)。将我的代码复制到新系统并运行 gmake 后,我发现我在编译时遇到了问题。据我所知,应该发生的是我的 .F 文件被预处理并写入 .f 文件。显然,cpp 预处理器现在正在添加某种 GNU 免责声明(“/* Copyright (C) 1991-2012 Free Software Foundation, Inc. 该文件是 GNU C 库的一部分......”),编译器 ( f77) 不喜欢。原则上,我可以从每个生成的 .f 文件中删除此文本,但严重的是,这需要太多时间。
我真的不知道问题的原因是什么。我想告诉 cpp 不要输出这个文本,或者 f77 忽略它,但没有找到任何管理这个的标志。考虑过重新编写 Makefile(例如,使用更现代的编译器),但目前我对此感到有点绝望。希望有人能帮我解决这个问题。我正在复制下面的 Makefile 以及输出。
提前致谢。
生成文件
# Make sure the SHELL is right
SHELL = /bin/sh
MAKE = gmake
# Define several root directories
LEP_ROOT := /home/stilgar/SUSY/NeutrinoModel2
CERN_ROOT := /usr/lib64/cernlib/2006
INCLUDES := $(LEP_ROOT)/include
INCLUDES := $(strip $(INCLUDES))
incpath := $(subst $(space),:,$(INCLUDES))
vpath %.inc $(incpath)
# Define tree
BIN_DIR := $(LEP_ROOT)/bin
# Define source directory
SRCDIR := $(LEP_ROOT)/src
# Libraries
libs := $(CERN_ROOT)/lib
libs := $(addprefix -L, $(libs))
libs += `cernlib packlib,mathlib,packlib,kernlib`
#Source files
#Main Program
src_files += $(wildcard $(SRCDIR)/main_lfv.F)
#SM Parameters
src_files += $(wildcard $(SRCDIR)/param_basic.F)
src_files += $(wildcard $(SRCDIR)/numajmass.F)
#SUSY Spectrum
src_files += $(wildcard $(SRCDIR)/texture2.F)
src_files += $(wildcard $(SRCDIR)/minserts.F)
#SUSY Flavour
src_files += $(wildcard $(SRCDIR)/gmin2.F)
src_files += $(wildcard $(SRCDIR)/lfv.F)
#Bounds
src_files += $(wildcard $(SRCDIR)/experiment.F)
src_files += $(wildcard $(SRCDIR)/directsearch.F)
#Loop Functions
src_files += $(wildcard $(SRCDIR)/fedm.F)
src_files += $(wildcard $(SRCDIR)/gedm.F)
#Mathematical Tools
src_files += $(wildcard $(SRCDIR)/biunitary3.F)
main_obj_files += $(src_files:%.F=%.o)
main_ofiles += $(notdir $(main_obj_files))
main_files += $(src_files:%.F=%.f)
depend += $(main_obj_files:.o=.d)
# Name of the executable to be created
exectry := $(BIN_DIR)/RunStuff
# Define flags
FC = f77
#FC = gfortran
#FC = g95
FFLAGS += -c
FFLAGS += $(addprefix -I, $(INCLUDES))
# Define cpp options
CPP = cpp
CPPFLAGS += -C -P -E
CPPFLAGS += $(addprefix -I, $(INCLUDES))
.PHONY : all clean cleanall help
.PHONY : sclean
all: $(exectry)
$(exectry): $(main_obj_files) $(main_files)
@echo '==================================================='
@echo ' Building executable ' $(exectry)
@echo ' '
@-rm -f $@
$(FC) -o $@ $(main_obj_files) $(LFLAGS) $(libs)
@echo ' Done '
@echo '==================================================='
clean : sclean
@echo
@echo Cleaning up *.o *~ core
@echo
@-rm -f *.o core
@echo done.
sclean :
@find . -name "*.bak" -exec rm -f '{}' ';'
@find . -name "*~" -exec rm -f '{}' ';'
@find . -name "#*#" -exec rm -f '{}' ';'
cleanall :
@echo '**********************************************************'
@echo ' Clean all : '
@find . -name "*.bak" -exec rm -f '{}' ';'
@find . -name "*~" -exec rm -f '{}' ';'
@find . -name "*.log" -exec rm -f '{}' ';'
@find . -name "*.out" -exec rm -f '{}' ';'
@find . -name "core" -exec rm -f '{}' ';'
@find . -name "#*#" -exec rm -f '{}' ';'
@-rm -f *.o *.d
@echo done.
@echo '**********************************************************'
help:
@echo
@echo ' The possible options are :'
@echo ' ======================== '
@echo
@echo ' gmake -- build batch executable'
@echo ' gmake sclean -- simple clean up '
@echo ' gmake clean -- clean up a bit more '
@echo ' gmake cleanall -- clean everything'
@echo
%.f:%.F
@echo Preprocessing ... $<
@$(CPP) $(CPPFLAGS) $< > $@
%.o:%.f
@echo Compiling ... $<
@$(FC) $(FFLAGS) -o $@ $<
%.d:%.F
@touch $@
@echo Updating ... $@
@makedepend -- $(CPPFLAGS) -- $< -f $@
@-rm $@.bak
Preprocessing ... /home/stilgar/SUSY/NeutrinoModel2/src/main_lfv.F
Compiling ... /home/stilgar/SUSY/NeutrinoModel2/src/main_lfv.f
/home/stilgar/SUSY/NeutrinoModel2/src/main_lfv.f:2:
This file is part of the GNU C Library.
^
Non-numeric character at (^) in label field [info -f g77 M LEX]
/home/stilgar/SUSY/NeutrinoModel2/src/main_lfv.f:4:
The GNU C Library is free software; you can redistribute it and/or
^
Non-numeric character at (^) in label field [info -f g77 M LEX]
/home/stilgar/SUSY/NeutrinoModel2/src/main_lfv.f:5:
modify it under the terms of the GNU Lesser General Public
^
Non-numeric character at (^) in label field [info -f g77 M LEX]
(...)
gmake: *** [/home/stilgar/SUSY/NeutrinoModel2/src/main_lfv.o] Error 1
最佳答案
我认为问题是-C
CPPFLAGS
中的选项多变的。 cpp
的手册页说这会导致预处理器不丢弃注释。我不认为你想要那个。去掉那个标志。
另一个 nit:你永远不想设置 MAKE
生成文件中的变量。
关于makefile - cpp 预处理器为 Fortran 编译器添加不需要的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19571881/
我为 4 套接字服务器的大对象( double 矩阵)编写 NUMA-aaware 缓存。我观察到套接字间通信是我的应用程序的瓶颈。因此,我希望不同套接字上的线程具有单独的矩阵缓存。我已将线程限制到特
这个问题在这里已经有了答案: 关闭 12 年前。 Possible Duplicate: Parsing JSON using C? 处理 JSON 的最佳 C 库是什么? http://www.j
我一直在使用递归 SpinTax 处理器,如 here 所示, 它适用于较小的字符串。然而,当字符串超过 20KB 时,它开始耗尽内存,这就成了一个问题。 如果我有这样的字符串: {Hello|How
C# 中是否有一个#define 允许我在编译时知道我是针对 x86 (Win32) 还是针对 x64 (Win64) 进行编译? 最佳答案 默认情况下没有办法做到这一点。原因是 C# 代码不是针对特
我不确定 SO 是否是提出这个问题的最佳场所。如果没有,请告诉我应该去哪个姊妹网站。 我一直在阅读一篇关于英特尔的可信执行技术 (TXT) 的论文,其中包含以下我似乎无法理解的文字: “英特尔创建了一
我需要一个工具来针对 执行 XSLT非常大 XML 文件。需要明确的是,我不需要任何东西来设计、编辑或调试 XSLT,只需执行它们即可。我正在使用的转换已经很好地优化了,但是大文件导致我尝试过的工具(
我正在学习Apache Camel。 能否请您解释一下关于Apache Camel的处理器,组件和端点之间的区别。 最佳答案 我建议所有刚接触Apache Camel的人阅读这篇文章,它很好地解释了C
我想知道在 Camel 处理器上获得同步的方法。 我在 docs 找到的唯一相关内容: Note that there is no concurrency or locking issue when
我看到这个 https://issues.apache.org/jira/browse/NIFI-78在 jira 上,但它引用了 java。有没有办法将 nifi 进程映射到服务器上的线程,以便我可
我有以下用例: 在一个应用程序中,我使用 X 线程消费一些消息,其中我有一个这样定义的 Consumer 实现: public interface Consumer { onMessage(
CPU12 处理器中是否有提供简单 NOT 功能的代码? 最佳答案 这应该是 the datasheet您正在寻找。没有可用的logical NOT,您必须自己编写代码。 关于assembly - 不
我对 Oracle XDK 中包含的 Java XSLT 处理器与 Oracle DB 中嵌入并由 SQL XMLtransform 函数使用的 XSLT 处理器之间的关系感到困惑。 这些是相同的野兽
我正在试用 Camel,发现它是一个方便的端点集成工具。我已经设置了以下实验性应用程序: 第一个端点是一个简单的 http-get 请求(在命令行上使用 curl)。这与使用 Jetty 的中央交换机
我正在为一个应用程序使用 Apache Camel 和 Spring Boot。我需要从目录中读取数据,然后解码读取的 xml,然后处理解码的对象以在其中设置更多数据,然后再次对其进行编码并将其发送到
我已经知道如何编写自定义处理器(扩展org.apache.nifi.processor.AbstractProcessor)。我已经使用了这种技术,并且也可以轻松创建自定义 org.apache.ni
是否有任何用 python 编写的 EasyList 处理器/解析器? http://easylist.adblockplus.org/en/ 最佳答案 找到了!就像一个月后:( http://adb
我有一个无法安装任何东西的开发(说来话长)。我只需要使用纯 HTML/浏览器 JS 进行开发,并且我想使用 CSS 预处理器。我喜欢 SCSS (SASS),但为了使用它,我必须在我的机器上安装 ru
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
对于新手来说,是直接从 ARM 处理器的数据表和用户手册开始,还是先了解一下 ARM 世界然后再继续? 最佳答案 当我开始使用一项(对我而言)新技术时,我首先会找到尽可能多的数据表和应用说明,然后直接
我使用 AMD FX X6 6300 型处理器。 (它支持虚拟化,我的 BIOS 设置为 ON) 我安装了“英特尔 x86 仿真器加速器”。当我尝试运行 Intel 加速器设置时,我得到该设置无法安装
我是一名优秀的程序员,十分优秀!