source: ThirdParty/mpqc_open/src/bin/mpqc/Makefile@ 482400e

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_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 482400e was 482400e, checked in by Frederik Heber <heber@…>, 8 years ago

Changes to mpqc_open to be usable as autoconf subdir.

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