source: m4/ax_lapack.m4@ f06d52

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 f06d52 was f06d52, checked in by Frederik Heber <heber@…>, 12 years ago

Added LevMartester that employs levmar package for non-linear regression.

  • as liblevmar is not a dynamically linked library, we don't need lapack.
  • path to levmar has to be given with --with-levmar (and is not tested so far).
  • LevMartester is linked against liblevmar and with includes.
  • copied Meyer's (reformulated) problem from lmdemo.c which is solved to same result.
  • Property mode set to 100644
File size: 4.9 KB
Line 
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_lapack.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
8#
9# DESCRIPTION
10#
11# This macro looks for a library that implements the LAPACK linear-algebra
12# interface (see http://www.netlib.org/lapack/). On success, it sets the
13# LAPACK_LIBS output variable to hold the requisite library linkages.
14#
15# To link with LAPACK, you should link with:
16#
17# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS
18#
19# in that order. BLAS_LIBS is the output variable of the AX_BLAS macro,
20# called automatically. FLIBS is the output variable of the
21# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by AX_BLAS), and is
22# sometimes necessary in order to link with F77 libraries. Users will also
23# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same
24# reason.
25#
26# The user may also use --with-lapack=<lib> in order to use some specific
27# LAPACK library <lib>. In order to link successfully, however, be aware
28# that you will probably need to use the same Fortran compiler (which can
29# be set via the F77 env. var.) as was used to compile the LAPACK and BLAS
30# libraries.
31#
32# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library
33# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
34# is not found. If ACTION-IF-FOUND is not specified, the default action
35# will define HAVE_LAPACK.
36#
37# LICENSE
38#
39# Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
40#
41# This program is free software: you can redistribute it and/or modify it
42# under the terms of the GNU General Public License as published by the
43# Free Software Foundation, either version 3 of the License, or (at your
44# option) any later version.
45#
46# This program is distributed in the hope that it will be useful, but
47# WITHOUT ANY WARRANTY; without even the implied warranty of
48# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
49# Public License for more details.
50#
51# You should have received a copy of the GNU General Public License along
52# with this program. If not, see <http://www.gnu.org/licenses/>.
53#
54# As a special exception, the respective Autoconf Macro's copyright owner
55# gives unlimited permission to copy, distribute and modify the configure
56# scripts that are the output of Autoconf when processing the Macro. You
57# need not follow the terms of the GNU General Public License when using
58# or distributing such scripts, even though portions of the text of the
59# Macro appear in them. The GNU General Public License (GPL) does govern
60# all other use of the material that constitutes the Autoconf Macro.
61#
62# This special exception to the GPL applies to versions of the Autoconf
63# Macro released by the Autoconf Archive. When you make and distribute a
64# modified version of the Autoconf Macro, you may extend this special
65# exception to the GPL to apply to your modified version as well.
66
67#serial 7
68
69AU_ALIAS([ACX_LAPACK], [AX_LAPACK])
70AC_DEFUN([AX_LAPACK], [
71AC_REQUIRE([AX_BLAS])
72ax_lapack_ok=no
73
74AC_ARG_WITH(lapack,
75 [AS_HELP_STRING([--with-lapack=<lib>], [use LAPACK library <lib>])])
76case $with_lapack in
77 yes | "") ;;
78 no) ax_lapack_ok=disable ;;
79 -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;;
80 *) LAPACK_LIBS="-l$with_lapack" ;;
81esac
82
83# Get fortran linker name of LAPACK function to check for.
84AC_F77_FUNC(cheev)
85
86# We cannot use LAPACK if BLAS is not found
87if test "x$ax_blas_ok" != xyes; then
88 ax_lapack_ok=noblas
89 LAPACK_LIBS=""
90fi
91
92# First, check LAPACK_LIBS environment variable
93if test "x$LAPACK_LIBS" != x; then
94 save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS"
95 AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS])
96 AC_TRY_LINK_FUNC($cheev, [ax_lapack_ok=yes], [LAPACK_LIBS=""])
97 AC_MSG_RESULT($ax_lapack_ok)
98 LIBS="$save_LIBS"
99 if test $ax_lapack_ok = no; then
100 LAPACK_LIBS=""
101 fi
102fi
103
104# LAPACK linked to by default? (is sometimes included in BLAS lib)
105if test $ax_lapack_ok = no; then
106 save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS"
107 AC_CHECK_FUNC($cheev, [ax_lapack_ok=yes])
108 LIBS="$save_LIBS"
109fi
110
111# Generic LAPACK library?
112for lapack in lapack lapack_rs6k; do
113 if test $ax_lapack_ok = no; then
114 save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS"
115 AC_CHECK_LIB($lapack, $cheev,
116 [ax_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS])
117 LIBS="$save_LIBS"
118 fi
119done
120
121AC_SUBST(LAPACK_LIBS)
122
123# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
124if test x"$ax_lapack_ok" = xyes; then
125 ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1])
126 :
127else
128 ax_lapack_ok=no
129 $2
130fi
131])dnl AX_LAPACK
Note: See TracBrowser for help on using the repository browser.