source: ThirdParty/mpqc_open/src/bin/mpqc/Makefile@ 860145

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 860145 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 7.0 KB
Line 
1TOPDIR=../../..
2ifndef SRCDIR
3 BUILDING_IN_SRCDIR=yes
4 SRCDIR=$(shell pwd)
5endif
6
7LOCALMAKEFILE_OPTIONAL = yes
8include $(SRCDIR)/$(TOPDIR)/lib/GlobalMakefile
9
10ifeq ($(LOCALMAKEFILE_FOUND),yes)
11
12include $(TOPDIR)/lib/Makedirlist
13INCLUDE += -I. -I$(SRCDIR)
14CXXINCLUDE += -I. -I$(SRCDIR)
15
16TARGET_TO_MAKE = mpqc
17
18CXXSRC = mpqc.cc mpqcin.cc
19GENCXXSRC = parse.cc scan.cc
20CSRC =
21INC =
22GENINC = parse.h
23
24DEPENDINCLUDE = $(INC)
25
26BINOBJ = $(CXXSRC:%.cc=%.$(OBJSUF)) $(GENCXXSRC:%.cc=%.$(OBJSUF)) $(CSRC:%.c=%.$(OBJSUF))
27
28DISTFILES = $(CXXSRC) $(CSRC) $(INC) Makefile LIBS.h
29
30default:: mpqc
31
32DEFINES += \
33 -DHAVE_JOBMARKET -I/home/heber/packages/JobMarket-1.0.0/include -I/home/heber/workspace_C/JobMarket/build64 -I/home/heber/packages/boost-1.47/include/boost-1_47\
34 -DHAVE_MPQCDATA -I/home/heber/workspace_C/molecuilder/build64/include/MoleCuilder
35
36XDEF =
37XLIBS = -L/home/heber/packages/JobMarket-1.0.0/lib -lJobMarketPoolWorker -Wl,-rpath,/home/heber/packages/JobMarket-1.0.0/lib -Wl,-rpath,/home/heber/packages/boost-1.47/lib -L/home/heber/workspace_C/molecuilder/build64/lib/ -lMolecuilderJobs -Wl,-rpath,/home/heber/workspace_C/molecuilder/build64/lib
38ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_QC_PSI),yes)
39XDEF += -DHAVE_CHEMISTRY_QC_PSI
40endif
41ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_QC_CC),yes)
42XDEF += -DHAVE_CHEMISTRY_QC_CC
43endif
44ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_QC_CINTS),yes)
45 ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_QC_MBPTR12),yes)
46 XDEF += -DHAVE_CHEMISTRY_QC_MBPTR12
47 endif
48XDEF += -DHAVE_CHEMISTRY_QC_CINTS
49endif
50
51ifeq ($(HAVE_LIBINT),yes)
52 XLIBS += -lint
53endif
54ifeq ($(HAVE_LIBR12),yes)
55 XLIBS += -lr12
56endif
57ifeq ($(HAVE_LIBDERIV),yes)
58 XLIBS += -lderiv
59endif
60ifeq ($(HAVE_SC_SRC_LIB_CHEMISTRY_CCA),yes)
61 ifeq ($(ENABLESHARED),yes)
62 LTLINKBINOPTS += -R$(CCAFE_LIB) -R$(CCA_CHEM_LIB)
63 else
64 XLIBS += -L$(CCA_CHEM_LIB) -L$(CCAFE_LIB) -L$(CCA_SPEC_BABEL_LIB) -L$(BABEL_LIB) \
65 -lccachem_cxx_server -lccachem_cxx_client -lccafeCore -lcca -lsidl -lxml2 -lz
66 endif
67 DEFINES += -DHAVE_CHEMISTRY_CCA -DCCA_PATH=\"$(libdir)/cca\"
68 CPPFLAGS += -I../../lib/chemistry/cca
69endif
70
71LIBS := $(shell $(LISTLIBS) $(INCLUDE) $(DEFINES) $(XDEF) $(SRCDIR)/LIBS.h)
72
73#################################################################
74
75default:: $(DEPENDINCLUDE)
76
77include $(SRCDIR)/$(TOPDIR)/lib/GlobalRules
78
79mpqc: $(BINOBJ) $(LIBS)
80 echo "$(LISTLIBS) $(INCLUDE) $(DEFINES) $(XDEF) $(SRCDIR)/LIBS.h"
81 $(LTLINK) $(LD) $(LDFLAGS) -o $@ $^ $(XLIBS) $(SYSLIBS) $(LTLINKBINOPTS)
82
83$(TOPDIR)/lib/libmpqc.a: $(BINOBJ)
84 /bin/rm -f $@
85 $(AR) $(ARFLAGS) $@ $^
86 $(RANLIB) $@
87
88$(TOPDIR)/lib/libmpqc.la: $(BINOBJ)
89 $(LTLINK) $(CXX) -o $@ $^ $(LTLINKLIBOPTS)
90
91install_devel:: $(TOPDIR)/lib/libmpqc.$(LIBSUF)
92 $(INSTALL) $(INSTALLDIROPT) $(installroot)$(libdir)
93 $(LTINST) $(INSTALL) $(INSTALLLIBOPT) $< $(installroot)$(libdir)
94
95install:: mpqc
96 $(INSTALL) $(INSTALLDIROPT) $(installroot)$(bindir)
97 $(LTINST) $(INSTALL) $(INSTALLBINOPT) $< $(installroot)$(bindir)
98 $(INSTALL) $(INSTALLSCRIPTOPT) mpqcrun $(installroot)$(bindir)/mpqcrun
99 $(INSTALL) $(INSTALLSCRIPTOPT) ccarun $(installroot)$(bindir)/ccarun
100 $(INSTALL) $(INSTALLDIROPT) $(installroot)$(scdatadir)
101 $(INSTALL) $(INSTALLSCRIPTOPT) $(SRCDIR)/mpqcrunproc $(installroot)$(scdatadir)/mpqcrunproc
102 $(INSTALL) $(INSTALLSCRIPTOPT) $(SRCDIR)/ccarunproc $(installroot)$(scdatadir)/ccarunproc
103
104install::
105 /bin/rm -f $(installroot)$(bindir)/chkmpqcout
106 sed "s+exec perl+exec perl -I$(scdatadir)/perl+" \
107 < $(SRCDIR)/validate/checkout.pl \
108 > $(installroot)$(bindir)/chkmpqcout
109 chmod 555 $(installroot)$(bindir)/chkmpqcout
110
111clean::
112 /bin/rm -f mpqc
113 /bin/rm -f parse.tmp*
114
115distclean::
116 /bin/rm -f mpqc
117 /bin/rm -f parse.tmp*
118 /bin/rm -f $(GENCXXSRC) $(GENINC) parse.output
119 /bin/rm -f mpqcrun
120
121ifneq ($(BUILDING_IN_SRCDIR),yes)
122ifeq ($(wildcard parse.cc),parse.cc)
123$(error "parse.cc exists in an object directory. This is now longer necessary or allowed. Delete the file to continue.")
124endif
125ifeq ($(wildcard scan.cc),scan.cc)
126$(error "scan.cc exists in an object directory. This is now longer necessary or allowed. Delete the file to continue.")
127endif
128ifeq ($(wildcard parse.h),parse.h)
129$(error "parse.h exists in an object directory. This is now longer necessary or allowed. Delete the file to continue.")
130endif
131endif
132
133$(SRCDIR)/parse.cc: $(SRCDIR)/parse.yy
134 @echo WARNING: The file $@ is out of date.
135 @echo It can be built by running \"make parser DODEPEND=no\" in the source directory.
136 @echo You may also get the message on files checked out of CVS, in which case you can touch $@ to stop getting this message.
137
138$(SRCDIR)/parse.h: $(SRCDIR)/parse.yy
139 @echo WARNING: The file $@ is out of date.
140 @echo It can be built by running \"make parser DODEPEND=no\" in the source directory.
141 @echo You may also get the message on files checked out of CVS, in which case you can touch $@ to stop getting this message.
142
143$(SRCDIR)/scan.cc: $(SRCDIR)/scan.ll
144 @echo WARNING: The file $@ is out of date.
145 @echo It can be built by running \"make scanner DODEPEND=no\" in the source directory.
146 @echo You may also get the message on files checked out of CVS, in which case you can touch $@ to stop getting this message.
147
148#################################################################
149
150$(BINOBJ:.$(OBJSUF)=.d): $(DEPENDINCLUDE)
151ifneq ($(DODEPEND),no)
152include $(BINOBJ:.$(OBJSUF)=.d)
153endif
154
155endif
156
157ifndef FLEX
158FLEX=flex
159endif
160
161ifndef BISON
162BISON=bison
163endif
164
165notobjdir_default:
166 @echo "Building in an unconfigured source directory."
167 @echo "The following make targets are available:"
168 @echo " make FLEX=<flex> scanner"
169 @echo " make BISON=<bison> parser"
170 @echo "Be sure to replace FlexLexer.h in the include"
171 @echo "directory with the correct version."
172
173# (only works with bison and flex)
174.PHONY: parser
175parser:
176 $(BISON) -v -d -o parse.tmp.cc parse.yy
177 cat parse.tmp.cc \
178 | sed "s/^int yyparse.*;$$//" \
179 | sed "s/^YYPARSE_RETURN_TYPE yyparse.*;$$//" \
180 | sed "s/yylval/MPQCInylval/g" \
181 > parse.cc
182 if test -f parse.tmp.cc.h; then \
183 echo "Older bison detected."; \
184 cat parse.tmp.cc.h | sed "s/yylval/MPQCInylval/g" > parse.h; \
185 /bin/mv parse.tmp.cc.output parse.output; \
186 else \
187 echo "Newer bison detected."; \
188 cat parse.tmp.hh | sed "s/yylval/MPQCInylval/g" > parse.h; \
189 /bin/mv parse.tmp.output parse.output; \
190 fi
191 #-@rm -f parse.tmp*
192
193.PHONY: scanner
194scanner:
195 echo "#ifdef HAVE_CONFIG_H" > scan.cc
196 echo "#include <scconfig.h>" >> scan.cc
197 echo "#endif" >> scan.cc
198 echo "#include <iostream>" >> scan.cc
199 echo "#ifdef USING_NAMESPACE_STD" >> scan.cc
200 echo "using namespace std;" >> scan.cc
201 echo "#endif" >> scan.cc
202 $(FLEX) -L -t scan.ll | grep -v "extern FILE .yyin" \
203 | grep -v "static int yy_get_next_buffer.*;" \
204 | grep -v "class istream;" \
205 | sed "s/static int yy_get_next_buffer/int yy_get_next_buffer/" \
206 | grep -v "static void yyunput.*;" \
207 | sed "s/static void yyunput/void yyunput/" \
208 | grep -v "static int yyinput.*;" \
209 | grep -v "extern.*isatty" \
210 | sed "s/static int yyinput/int yyinput/" \
211 | sed "s/yylval/MPQCInylval/g" \
212 >> scan.cc
Note: See TracBrowser for help on using the repository browser.