source: m4/ax_jobmarket.m4@ 004d5c

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 004d5c was 004d5c, checked in by Frederik Heber <heber@…>, 12 years ago

Removed JobMarket as it is now in its own repository.

  • added ax_jobmarket.m4.
  • added check to configure.ac
  • Removed libraries libJobMarket... in Makefile.am's, replaced by JobMarket_..._LIBS.
  • changed some includes that now required JobMarket/ prefix.

Larger change to get JobMarket including its tests out of MoleCuilder:

  • configure has new enable-switch for JobMarket. Only then, we tests for its presence and usability (and also for boost::asio).
  • I do not know how to check for AM_CONDITIONAL or config.h values properly in a shell. Hence, I moved all regression tests dealing with the JobMarket into their own folder tests/JobMarket with depends on CONDJOBMARKET whether its included or not, similar to tests/Python.
  • TESTFIX: regression tests moved to tests/JobMarket have their paths changed.
  • FragmentationAutomationAction is now conditionally compiled in as well.
  • some Makefile.am's changed because we now have JobMarket_CFLAGS and _LIBS similar CodePatterns.
  • We use boost::preprocessor to add it dependently on HAVE_JOBMARKET to src/Actions/GlobalListOfActions.
  • TESTFIX: The former required a small change to CodeChecks test testsuite-globallistofactions_hpp as we can check no longer for the action name within brackets there.
  • FIX: I removed some unnecessary includes (defs.hpp) from MPQCCommandJob...hpp into the .cpp files.
  • Property mode set to 100644
File size: 8.9 KB
Line 
1dnl
2dnl AM_PATH_JOBMARKET(MINIMUM-VERSION, [HAVE_DEBUG=no,yes,full], [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
3dnl
4
5AC_DEFUN([AM_PATH_JOBMARKET],
6[
7AC_REQUIRE([AM_PATH_CODEPATTERNS])
8
9AC_ARG_WITH(jobmarket,[ --with-jobmarket=PFX Prefix where JobMarket is installed (optional)],
10 jobmarket_prefix="$withval", jobmarket_prefix="")
11AC_ARG_WITH(jobmarket_include,[ --with-jobmarket_include=INCLUDE Where JobMarket' includes are installed (optional)],
12 jobmarket_include_prefix="$withval", jobmarket_include_prefix="")
13AC_ARG_WITH(cp_cv_jobmarket_libs,[ --with-cp_cv_jobmarket_libs=LIBPATH Where JobMarket' libs are installed (optional)],
14 cp_cv_jobmarket_libs_prefix="$withval", cp_cv_jobmarket_libs_prefix="")
15
16 jobmarket_version_min=$1
17 jobmarket_debug=$2
18
19 JobMarket_CFLAGS=""
20 JobMarket_LIBS=""
21 JobMarket_Controller_LIBS=""
22 JobMarket_PoolWorker_LIBS=""
23 JobMarket_Server_LIBS=""
24 JobMarket_LDFLAGS=""
25
26
27 jobmarket_pkgconfig=""
28 # try to set PKG_CONFIG_PATH
29 if test x$jobmarket_prefix != xno; then
30 if test -z $PKG_CONFIG_PATH; then
31 export PKG_CONFIG_PATH="$jobmarket_prefix/lib/pkgconfig/"
32 else
33 export PKG_CONFIG_PATH="$jobmarket_prefix/lib/pkgconfig/:$PKG_CONFIG_PATH"
34 fi
35 fi
36 # 1. test whether pkg-config works
37 JobMarket_CONFIG="no"
38 #AC_MSG_NOTICE([PKG_CONFIG_PATH is $PKG_CONFIG_PATH.])
39 jobmarket_libname="JobMarket"
40 if test x$jobmarket_debug != xno; then
41 PKG_CHECK_MODULES([JobMarket_debug], [JobMarket >= $jobmarket_version_min], [
42 jobmarket_pkgconfig=yes
43 JobMarket_CONFIG="pkg-config ${jobmarket_libname}-debug"
44 ], [
45 jobmarket_pkgconfig=no
46 ])
47 PKG_CHECK_MODULES([JobMarketController_debug], [JobMarketController >= $jobmarket_version_min], [
48 jobmarketcontroller_pkgconfig=yes
49 JobMarketController_CONFIG="pkg-config ${jobmarket_libname}Controller-debug"
50 ], [
51 jobmarketcontroller_pkgconfig=no
52 ])
53 PKG_CHECK_MODULES([JobMarketPoolWorker_debug], [JobMarketPoolWorker >= $jobmarket_version_min], [
54 jobmarketpoolworker_pkgconfig=yes
55 JobMarketPoolWorker_CONFIG="pkg-config ${jobmarket_libname}PoolWorker-debug"
56 ], [
57 jobmarketpoolworker_pkgconfig=no
58 ])
59 PKG_CHECK_MODULES([JobMarketServer_debug], [JobMarketServer >= $jobmarket_version_min], [
60 jobmarketserver_pkgconfig=yes
61 JobMarketServer_CONFIG="pkg-config ${jobmarket_libname}Server-debug"
62 ], [
63 jobmarketserver_pkgconfig=no
64 ])
65 else
66 PKG_CHECK_MODULES([JobMarket], [JobMarket >= $jobmarket_version_min], [
67 jobmarket_pkgconfig=yes
68 JobMarket_CONFIG="pkg-config $jobmarket_libname"
69 ], [
70 jobmarket_pkgconfig=no
71 ])
72 PKG_CHECK_MODULES([JobMarketController], [JobMarketController >= $jobmarket_version_min], [
73 jobmarketcontroller_pkgconfig=yes
74 JobMarketController_CONFIG="pkg-config ${jobmarket_libname}Controller"
75 ], [
76 jobmarketcontroller_pkgconfig=no
77 ])
78 PKG_CHECK_MODULES([JobMarketPoolWorker], [JobMarketPoolWorker >= $jobmarket_version_min], [
79 jobmarketpoolworker_pkgconfig=yes
80 JobMarketPoolWorker_CONFIG="pkg-config ${jobmarket_libname}PoolWorker"
81 ], [
82 jobmarketpoolworker_pkgconfig=no
83 ])
84 PKG_CHECK_MODULES([JobMarketServer], [JobMarketServer >= $jobmarket_version_min], [
85 jobmarketserver_pkgconfig=yes
86 JobMarketServer_CONFIG="pkg-config ${jobmarket_libname}Server"
87 ], [
88 jobmarketserver_pkgconfig=no
89 ])
90 fi
91
92
93 if test x$jobmarket_pkgconfig != xno; then
94 JobMarket_CFLAGS=`$JobMarket_CONFIG --cflags`
95 JobMarket_LIBS=`$JobMarket_CONFIG --libs`
96 fi
97 if test x$jobmarketcontroller_pkgconfig != xno; then
98 JobMarket_Controller_LIBS=`$JobMarketController_CONFIG --libs`
99 fi
100 if test x$jobmarketpoolworker_pkgconfig != xno; then
101 JobMarket_PoolWorker_LIBS=`$JobMarketPoolWorker_CONFIG --libs`
102 fi
103 if test x$jobmarketserver_pkgconfig != xno; then
104 JobMarket_Server_LIBS=`$JobMarketServer_CONFIG --libs`
105 fi
106
107 # else set by hand (or rather by --with..)
108 if test x$jobmarket_include_prefix != x ; then
109 if test -e $jobmarket_include_prefix/include; then
110 JobMarket_CFLAGS="$jobmarket_include_prefix/include"
111 #AC_MSG_NOTICE([jobmarket include found and used.])
112 else
113 AC_MSG_WARN([jobmarket include not found at $jobmarket_include_prefix/include.])
114 fi
115 fi
116 if test x$cp_cv_jobmarket_libs_prefix != x ; then
117 if test -e "$cp_cv_jobmarket_libs_prefix/lib/lib$jobmarket_libname.so"; then
118 JobMarket_LDFLAGS="-L$cp_cv_jobmarket_libs_prefix/lib"
119 JobMarket_LIBS="-l$jobmarket_libname"
120 JobMarket_Controller_LIBS="-l${jobmarket_libname}Controller"
121 JobMarket_PoolWorker_LIBS="-l${jobmarket_libname}PoolWorker"
122 JobMarket_Server_LIBS="-l${jobmarket_libname}Server"
123 #AC_MSG_NOTICE([jobmarket libs found and used.])
124 else
125 AC_MSG_WARN([jobmarket libs not found at $cp_cv_jobmarket_libs_prefix.])
126 fi
127 fi
128
129 jobmarket="no"
130 if test "x$JobMarket_CFLAGS" != "x"; then
131 if test "x$JobMarket_LIBS" != "x"; then
132 jobmarket="yes"
133 fi
134 fi
135
136
137 if test x$jobmarket_pkgconfig != xyes; then
138 # check version of lib
139 no_jobmarket=""
140 jobmarket_version=no
141 if test x$jobmarket = xyes; then
142 AC_MSG_CHECKING(for $jobmarket_libname - version >= $jobmarket_version_min)
143 if test "x$JobMarket_CONFIG" != xno; then
144 jobmarket_version=`$JobMarket_CONFIG --version`
145 else
146 jobmarket_version=""
147 fi
148
149 jobmarket_major_version=`echo $jobmarket_version | \
150 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
151 jobmarket_minor_version=`echo $jobmarket_version | \
152 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
153 jobmarket_micro_version=`echo $jobmarket_version | \
154 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
155
156 #AC_MSG_NOTICE([Version found is: $jobmarket_major_version.$jobmarket_minor_version.$jobmarket_micro_version])
157 #AC_MSG_NOTICE([Version required is: $jobmarket_version_min])
158
159 jobmarket_major_min=`echo $jobmarket_version_min | \
160 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
161 if test "x${jobmarket_major_min}" = "x" ; then
162 jobmarket_major_min=0
163 fi
164
165 jobmarket_minor_min=`echo $jobmarket_version_min | \
166 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
167 if test "x${jobmarket_minor_min}" = "x" ; then
168 jobmarket_minor_min=0
169 fi
170
171 jobmarket_micro_min=`echo $jobmarket_version_min | \
172 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
173 if test "x${jobmarket_micro_min}" = "x" ; then
174 jobmarket_micro_min=0
175 fi
176
177 if test $jobmarket_major_version -lt $jobmarket_major_min; then
178 jobmarket_version_proper=0
179 fi
180 if test $jobmarket_major_version -gt $jobmarket_major_min; then
181 jobmarket_version_proper=1
182 else
183 if test $jobmarket_minor_version -lt $jobmarket_minor_min; then
184 jobmarket_version_proper=0
185 fi
186 if test $jobmarket_minor_version -gt $jobmarket_minor_min; then
187 jobmarket_version_proper=1
188 else
189 if test $jobmarket_micro_version -ge $jobmarket_micro_min; then
190 jobmarket_version_proper=1
191 else
192 jobmarket_version_proper=0
193 fi
194 fi
195 fi
196 #AC_MSG_NOTICE([$jobmarket_version_proper])
197
198 if test $jobmarket_version_proper = 1 ; then
199 jobmarket_version=yes
200 AC_MSG_RESULT([$jobmarket_major_version.$jobmarket_minor_version.$jobmarket_micro_version])
201 else
202 AC_MSG_RESULT(no)
203 jobmarket_version=no
204 fi
205 fi
206 else
207 # with pkg-config version is checked
208 jobmarket_version=yes
209 fi
210 # check presence of lib
211 SAVE_CPPFLAGS="$CPPFLAGS"
212 SAVE_LIBS="$LIBS"
213 CPPFLAGS="$JobMarket_CFLAGS ${CodePatterns_CFLAGS}"
214 LIBS="$JobMarket_LIBS $CodePatterns_LDFLAGS $CodePatterns_LIBS"
215 if test x$jobmarket_version = xyes; then
216 AC_CACHE_CHECK(for $jobmarket_libname lib, cp_cv_jobmarket_lib, [
217 AC_LANG_PUSH([C++])
218 AC_LINK_IFELSE(
219 [
220 AC_LANG_PROGRAM([
221
222#include "CodePatterns/MemDebug.hpp"
223#include "JobMarket/JobId.hpp"
224
225struct Test {
226 Test(size_t _id) :
227 id(_id)
228 {}
229
230 size_t getId() const {
231 return id.getId();
232 }
233
234private:
235 JobId id;
236} test(1);
237
238], [
239test.getId();
240])
241 ],[
242 cp_cv_jobmarket_lib="yes"
243 ], [
244 cp_cv_jobmarket_lib="no"
245 ]
246 )
247 AC_LANG_POP([C++])
248 ])
249 fi
250 CPPFLAGS="$SAVE_CPPFLAGS"
251 LIBS="$SAVE_LIBS"
252
253 if test "x$cp_cv_jobmarket_lib" = xyes ; then
254 ifelse([$3], , :, [$3])
255 else
256 JobMarket_CFLAGS=""
257 JobMarket_LDFLAGS=""
258 JobMarket_LIBS=""
259 JobMarket_Controller_LIBS=""
260 JobMarket_PoolWorker_LIBS=""
261 JobMarket_Server_LIBS=""
262 ifelse([$4], , :, [$4])
263 fi
264
265 AC_SUBST(JobMarket_CFLAGS)
266 AC_SUBST(JobMarket_LDFLAGS)
267 AC_SUBST(JobMarket_LIBS)
268 AC_SUBST(JobMarket_Controller_LIBS)
269 AC_SUBST(JobMarket_PoolWorker_LIBS)
270 AC_SUBST(JobMarket_Server_LIBS)
271])
272
Note: See TracBrowser for help on using the repository browser.