I am right now trying to compile a c++ code using autoconf and automake. 
I have been able to compile this code using autoconf and automake under a
linux 64 
platform, using the g++ compiler. 
On windows XP 32 platforms, using cygwin, I have been able to compile the
same code, using 
the icl c++ intel compiler, but I had to tweak some of the compilation, at
link time. 

What happens is that when trying to link the library libISSM.a, automake
tries to gather all the 
libISSM_a-objects.o into libISS.a. But because I am using the intel c++ icl
compiler, every object 
has been compiled as objects.obj, so that at link time, libISSM.a cannot be
created. 

I looked at the compiler doc, and the -o option is replaced on windows by
the -Fe option. Because of that, icl does not recognize the -o naming
option, and the objects are compiled by adding .obj to the end of the .cpp
files. 

My question is the folllowing: how do I get autoconf and automake to
recognize it's using icl with a -Fe convention, instead of the -o. Should I
build an implicit rule for the icl compiler? how do I do that? 

thank you for any info. 

Eric Larour 
Jet Propulsion Laboratory 

P.S: 

here is my Makefile.am, configure.ac for the bulk of the code: 


INCLUDES = @DAKOTAINCL@ @PETSCINCL@ @SLEPCINCL@ @MPIINCL@ @MATLABINCL@ 
@METISINCL@  @PLAPACKINCL@  @BLASLAPACKINCL@ @MKLINCL@ @MUMPSINCL@ 
@TRIANGLEINCL@

#Compile serial library
lib_LIBRARIES = libISSM.a 

#Serial compilation
libISSM_a_SOURCES = ./objects/objects.h\
                                        ./objects/Object.h\
                                        ./objects/Element.h\
                                        ./objects/Element.cpp\
                                        ./objects/Material.h\
                                        ./objects/Material.cpp\
                                        ./objects/Load.h\
                                        ./objects/Load.cpp\
                                        ./objects/OptArgs.h\
                                        ./objects/OptPars.h\
                                        ./objects/SolverEnum.h\
                                        ./objects/Contour.h\
                                        ./objects/Contour.cpp\
                                        ./objects/Friction.h\
                                        ./objects/Friction.cpp\
                                        ./objects/DakotaPlugin.h\
                                        ./objects/DakotaPlugin.cpp\
                                        ./objects/Node.h\
                                        ./objects/Node.cpp\
                                        ./objects/Result.h\
                                        ./objects/Result.cpp\
                                        ./objects/Tria.h\
                                        ./objects/Tria.cpp\
                                        ./objects/Sing.h\
                                        ./objects/Sing.cpp\
                                        ./objects/Beam.h\
                                        ./objects/Beam.cpp\
                                        ./objects/Penta.h\
                                        ./objects/Penta.cpp\
                                        ./objects/Matice.h\
                                        ./objects/Matice.cpp\
                                        ./objects/Matpar.h\
                                        ./objects/Matpar.cpp\
                                        ./objects/Input.h\
                                        ./objects/Input.cpp\
                                        ./objects/ParameterInputs.h\
                                        ./objects/ParameterInputs.cpp\
                                        ./objects/Spc.cpp\
                                        ./objects/Spc.h\
                                        ./objects/Rgb.cpp\
                                        ./objects/Rgb.h\
                                        ./objects/Penpair.cpp\
                                        ./objects/Penpair.h\
                                        ./objects/Pengrid.cpp\
                                        ./objects/Pengrid.h\
                                        ./objects/Icefront.cpp\
                                        ./objects/Icefront.h\
                                        ./objects/Param.cpp\
                                        ./objects/Param.h\
                                        ./objects/NodeSets.cpp\
                                        ./objects/NodeSets.h\
                                        ./DataSet/DataSet.cpp\
                                        ./DataSet/DataSet.h\
                                        ./shared/shared.h\
                                        ./shared/Alloc/alloc.h\
                                        ./shared/Alloc/alloc.cpp\
                                        ./shared/Matlab/matlabshared.h\
                                        ./shared/Matlab/PrintfFunction.cpp\
                                        ./shared/Matlab/ModuleBoot.cpp\
                                        ./shared/Matlab/mxGetAssignedField.cpp\
                                        ./shared/Matlab/mxGetField.cpp\
                                        
./shared/Matlab/CheckNumMatlabArguments.cpp\
                                        ./shared/Matrix/matrix.h\
                                        ./shared/Matrix/MatrixUtils.cpp\
                                        ./shared/Dofs/dofs.h\
                                        ./shared/Dofs/dofsetgen.cpp\
                                        ./shared/Dofs/DistributeNumDofs.cpp\
                                        ./shared/Numerics/numerics.h\
                                        ./shared/Numerics/isnan.h\
                                        ./shared/Numerics/isnan.cpp\
                                        ./shared/Numerics/GaussPoints.h\
                                        ./shared/Numerics/cross.cpp\
                                        ./shared/Numerics/norm.cpp\
                                        ./shared/Numerics/GaussPoints.cpp\
                                        ./shared/Numerics/BrentSearch.cpp\
                                        ./shared/Numerics/OptFunc.cpp\
                                        ./shared/Numerics/extrema.cpp\
                                        ./shared/Exceptions/exceptions.h\
                                        ./shared/Exceptions/Exceptions.cpp\
                                        ./shared/Exceptions/exprintf.cpp\
                                        ./shared/Exp/exp.h\
                                        ./shared/Exp/IsInPoly.cpp\
                                        ./shared/Exp/IsInPolySerial.cpp\
                                        ./shared/Exp/DomainOutlineRead.cpp\
                                        ./shared/TriMesh/trimesh.h\
                                        
./shared/TriMesh/AssociateSegmentToElement.cpp\
                                        ./shared/TriMesh/GridInsideHole.cpp\
                                        ./shared/TriMesh/OrderSegments.cpp\
                                        ./shared/TriMesh/SplitMeshForRifts.cpp\
                                        ./shared/TriMesh/TriMeshUtils.cpp\
                                        ./shared/Sorting/binary_search.cpp\
                                        ./shared/Sorting/sorting.h\
                                        ./shared/Elements/elements.h\
                                        ./shared/Elements/ResolvePointers.cpp\
                                        ./shared/Elements/Paterson.cpp\
                                        
./shared/Elements/GetElementNodeData.cpp\
                                        ./shared/String/isdistributed.cpp\
                                        ./shared/String/sharedstring.h\
                                        ./toolkits/petsc\
                                        ./toolkits/petsc/patches\
                                        ./toolkits/petsc/patches/petscpatches.h\
                                        
./toolkits/petsc/patches/MatlabMatrixToPetscMatrix.cpp\
                                        
./toolkits/petsc/patches/MatlabVectorToPetscVector.cpp\
                                        
./toolkits/petsc/patches/PetscMatrixToMatlabMatrix.cpp\
                                        
./toolkits/petsc/patches/PetscVectorToMatlabVector.cpp\
                                        
./toolkits/petsc/patches/MatlabMatrixToDoubleMatrix.cpp\
                                        
./toolkits/petsc/patches/MatlabVectorToDoubleVector.cpp\
                                        
./toolkits/petsc/patches/PetscDetermineLocalSize.cpp\
                                        
./toolkits/petsc/patches/VecTranspose.cpp\
                                        
./toolkits/petsc/patches/VecToMPISerial.cpp\
                                        
./toolkits/petsc/patches/MatToSerial.cpp\
                                        ./toolkits/petsc/patches/VecMerge.cpp\
                                        ./toolkits/petsc/patches/NewVec.cpp\
                                        
./toolkits/petsc/patches/NewVecFromLocalSize.cpp\
                                        
./toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp\
                                        
./toolkits/petsc/patches/PetscOptionsInsertMultipleString.cpp\
                                        ./toolkits/petsc/patches/NewMat.cpp\
                                        
./toolkits/petsc/patches/SerialToVec.cpp\
                                        ./toolkits/petsc/patches/VecFree.cpp\
                                        
./toolkits/petsc/patches/VecDuplicatePatch.cpp\
                                        ./toolkits/petsc/patches/KSPFree.cpp\
                                        ./toolkits/petsc/patches/ISFree.cpp\
                                        ./toolkits/petsc/patches/MatFree.cpp\
                                        
./toolkits/petsc/patches/GetOwnershipBoundariesFromRange.cpp\
                                        
./toolkits/petsc/patches/VecPartition.cpp\
                                        
./toolkits/petsc/patches/MatPartition.cpp\
                                        ./toolkits/petsc/patches/MatInvert.cpp\
                                        
./toolkits/petsc/patches/MatMultPatch.cpp\
                                        ./toolkits/petsc/petscincludes.h\
                                        ./toolkits/mpi/mpiincludes.h\
                                        ./toolkits/mpi/patches/mpipatches.h\
                                        ./toolkits/mpi/patches/MPI_Upperrow.cpp\
                                        ./toolkits/mpi/patches/MPI_Lowerrow.cpp\
                                        
./toolkits/mpi/patches/MPI_Boundariesfromrange.cpp\
                                        ./toolkits/metis/metisincludes.h\
                                        ./toolkits/triangle/triangleincludes.h\
                                        ./toolkits.h\
                                        ./io/io.h\
                                        ./io/FetchData.cpp\
                                        ./io/WriteData.cpp\
                                        ./io/WriteDataToDisk.cpp\
                                        ./io/SerialFetchData.cpp\
                                        ./io/SerialWriteData.cpp\
                                        ./io/ParallelFetchData.cpp\
                                        ./io/ParallelFetchInteger.cpp\
                                        ./io/ParallelFetchMat.cpp\
                                        ./io/ParallelFetchScalar.cpp\
                                        ./io/ParallelFetchString.cpp\
                                        ./io/ModelFetchData.cpp\
                                        ./io/WriteNodeSets.cpp\
                                        ./io/WriteParams.cpp\
                                        ./io/FetchNodeSets.cpp\
                                        ./io/FetchRifts.cpp\
                                        ./io/ParameterInputsInit.cpp\
                                        ./io/pfopen.cpp\
                                        ./io/pfclose.cpp\
                                        ./EnumDefinitions/EnumDefinitions.h\
                                        ./EnumDefinitions/EnumDefinitions.cpp\
                                        
./EnumDefinitions/AnalysisTypeAsEnum.cpp\
                                        ./ModelProcessorx/Model.h\
                                        ./ModelProcessorx/Model.cpp\
                                        ./ModelProcessorx/CreateDataSets.cpp\
                                        ./ModelProcessorx/CreateParameters.cpp\
                                
./ModelProcessorx/DiagnosticHoriz/CreateElementsNodesAndMaterialsDiagnosticHoriz.cpp\
                                        
./ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
\
                                        
./ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp\
                                        
./ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp\
                                
./ModelProcessorx/DiagnosticVert/CreateElementsNodesAndMaterialsDiagnosticVert.cpp\
                                        
./ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp \
                                        
./ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp\
                                
./ModelProcessorx/DiagnosticHutter/CreateElementsNodesAndMaterialsDiagnosticHutter.cpp\
                                
./ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp \
                                        
./ModelProcessorx/DiagnosticHutter/CreateLoadsDiagnosticHutter.cpp\
                                
./ModelProcessorx/DiagnosticStokes/CreateElementsNodesAndMaterialsDiagnosticStokes.cpp\
                                
./ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp \
                                        
./ModelProcessorx/DiagnosticStokes/CreateLoadsDiagnosticStokes.cpp\
                                
./ModelProcessorx/SlopeCompute/CreateElementsNodesAndMaterialsSlopeCompute.cpp\
                                        
./ModelProcessorx/SlopeCompute/CreateConstraintsSlopeCompute.cpp \
                                        
./ModelProcessorx/SlopeCompute/CreateLoadsSlopeCompute.cpp\
                                        
./ModelProcessorx/Control/CreateParametersControl.cpp\
                                        
./ModelProcessorx/Thermal/CreateElementsNodesAndMaterialsThermal.cpp\
                                        
./ModelProcessorx/Thermal/CreateConstraintsThermal.cpp\
                                        
./ModelProcessorx/Thermal/CreateLoadsThermal.cpp\
                                        
./ModelProcessorx/Thermal/CreateParametersThermal.cpp\
                                        
./ModelProcessorx/Melting/CreateElementsNodesAndMaterialsMelting.cpp\
                                        
./ModelProcessorx/Melting/CreateConstraintsMelting.cpp\
                                        
./ModelProcessorx/Melting/CreateLoadsMelting.cpp\
                                        
./ModelProcessorx/Melting/CreateParametersMelting.cpp\
                                
./ModelProcessorx/Prognostic/CreateElementsNodesAndMaterialsPrognostic.cpp\
                                        
./ModelProcessorx/Prognostic/CreateConstraintsPrognostic.cpp\
                                        
./ModelProcessorx/Prognostic/CreateLoadsPrognostic.cpp\
                                        
./ModelProcessorx/Prognostic/CreateParametersPrognostic.cpp\
                                        
./ModelProcessorx/Qmu/CreateParametersQmu.cpp\
                                        ./Dofx/Dofx.h\
                                        ./Dofx/Dofx.cpp\
                                        ./Dux/Dux.h\
                                        ./Dux/Dux.cpp\
                                        
./GriddataMeshToGridx/GriddataMeshToGridx.h\
                                        
./GriddataMeshToGridx/GriddataMeshToGridx.cpp\
                                        ./ControlConstrainx/ControlConstrainx.h\
                                        
./ControlConstrainx/ControlConstrainx.cpp\
                                        ./Misfitx/Misfitx.h\
                                        ./Misfitx/Misfitx.cpp\
                                        ./Orthx/Orthx.h\
                                        ./Orthx/Orthx.cpp\
                                        ./Gradjx/Gradjx.h\
                                        ./Gradjx/Gradjx.cpp\
                                        ./UpdateFromInputsx/UpdateFromInputsx.h\
                                        
./UpdateFromInputsx/UpdateFromInputsx.cpp\
                                        ./UpdateGeometryx/UpdateGeometryx.h\
                                        ./UpdateGeometryx/UpdateGeometryx.cpp\
                                        
./UpdateNodePositionsx/UpdateNodePositionsx.h\
                                        
./UpdateNodePositionsx/UpdateNodePositionsx.cpp\
                                        ./ConfigureObjectsx/ConfigureObjectsx.h\
                                        
./ConfigureObjectsx/ConfigureObjectsx.cpp\
                                        ./ComputePressurex/ComputePressurex.h\
                                        ./ComputePressurex/ComputePressurex.cpp\
                                        ./BuildNodeSetsx/BuildNodeSetsx.h\
                                        ./BuildNodeSetsx/BuildNodeSetsx.cpp\
                                        ./BuildNodeSetsx/PartitionSets.cpp\
                                        ./SpcNodesx/SpcNodesx.h\
                                        ./SpcNodesx/SpcNodesx.cpp\
                                        ./MpcNodesx/MpcNodesx.h\
                                        ./MpcNodesx/MpcNodesx.cpp\
                                        ./InterpFromGridx/InterpFromGridx.cpp\
                                        ./InterpFromGridx/InterpFromGridx.h\
                                        
./InterpFromMesh2dx/InterpFromMesh2dx.cpp\
                                        ./InterpFromMesh2dx/InterpFromMesh2dx.h\
                                        
./InterpFromMesh3dx/InterpFromMesh3dx.cpp\
                                        ./InterpFromMesh3dx/InterpFromMesh3dx.h\
                                        ./HoleFillerx/HoleFillerx.cpp\
                                        ./HoleFillerx/HoleFillerx.h\
                                        ./MeshPartitionx/MeshPartitionx.cpp\
                                        ./MeshPartitionx/MeshPartitionx.h\
                                        ./ContourToMeshx/ContourToMeshx.cpp\
                                        ./ContourToMeshx/ContourToMeshx.h\
                                        ./ContourToNodesx/ContourToNodesx.cpp\
                                        ./ContourToNodesx/ContourToNodesx.h\
                                        
./Reducevectorgtosx/Reducevectorgtosx.cpp\
                                        ./Reducevectorgtosx/Reducevectorgtosx.h\
                                        
./Reducematrixfromgtofx/Reducematrixfromgtofx.cpp\
                                        
./Reducematrixfromgtofx/Reducematrixfromgton.cpp\
                                        
./Reducematrixfromgtofx/Reducematrixfromgtofx.h\
                                        
./Reduceloadfromgtofx/Reduceloadfromgtofx.h\
                                        
./Reduceloadfromgtofx/Reduceloadfromgtofx.cpp\
                                        
./NormalizeConstraintsx/NormalizeConstraintsx.cpp\
                                        
./NormalizeConstraintsx/NormalizeConstraintsx.h\
                                        
./NodeConnectivityx/NodeConnectivityx.cpp\
                                        ./NodeConnectivityx/NodeConnectivityx.h\
                                        
./ElementConnectivityx/ElementConnectivityx.cpp\
                                        
./ElementConnectivityx/ElementConnectivityx.h\
                                        ./SystemMatricesx/SystemMatricesx.cpp\
                                        ./SystemMatricesx/SystemMatricesx.h\
                                        
./PenaltyConstraintsx/PenaltyConstraintsx.cpp\
                                        
./PenaltyConstraintsx/PenaltyConstraintsx.h\
                                        
./PenaltySystemMatricesx/PenaltySystemMatricesx.cpp\
                                        
./PenaltySystemMatricesx/PenaltySystemMatricesx.h\
                                        ./Solverx/Solverx.cpp\
                                        ./Solverx/Solverx.h\
                                        
./Mergesolutionfromftogx/Mergesolutionfromftogx.cpp\
                                        
./Mergesolutionfromftogx/Mergesolutionfromftogx.h\
                                        ./ProcessParamsx/ProcessParamsx.cpp\
                                        ./ProcessParamsx/ProcessParamsx.h\
                                        ./Qmux/Qmux.h\
                                        ./Qmux/Qmux.cpp\
                                        ./Qmux/SpawnCore.cpp\
                                        ./Qmux/SpawnCoreSerial.cpp\
                                        
./FieldDepthAveragex/FieldDepthAveragex.cpp\
                                        
./FieldDepthAveragex/FieldDepthAveragex.h\
                                        ./FieldExtrudex/FieldExtrudex.cpp\
                                        ./FieldExtrudex/FieldExtrudex.h




libISSM_a_CXXFLAGS = -fPIC -DMATLAB -D_SERIAL_ -ansi -D_GNU_SOURCE
-fno-omit-frame-pointer -pthread -D_CPP_ 
if LARGEARRAYS
libISSM_a_CXXFLAGS += -D__GCC4BUILD__  
else
libISSM_a_CXXFLAGS += -DMX_COMPAT_32 -m32
endif







configure.ac: 

AC_INIT(ISSM,[1.0], [Eric Larour <eric.lar...@jpl.nasa.gov>])
AM_CONFIG_HEADER(config.h)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE
AC_PROG_RANLIB
AC_PROG_CC([gcc icl])
AC_PROG_CPP
AC_PROG_CXX([g++ icl])
AC_PROG_F77([ifort g77 gfortran])
AC_F77_LIBRARY_LDFLAGS
AM_PROG_CC_C_O
AC_PATH_XTRA
ISSM_OPTIONS
AC_CONFIG_FILES([Makefile
                        src/Makefile
                        src/c/Makefile
                        src/mex/Makefile
                        bin/Makefile])
AC_OUTPUT




what is in issm_options: 

dnl ISSM Options

AC_DEFUN([ISSM_OPTIONS],[
        dnl Debugging option check.
        AC_ARG_ENABLE([debugging],AS_HELP_STRING([--enable-debugging],
                                         [turn debug support on]),
                [enable_debugging=$enableval],[enable_debugging=no])
        if test "x$enable_debugging" = xyes; then
         AC_DEFINE([_DEBUG_],[1],[Macro to enable debugging in Dakota.])
        fi

        dnl serial build?
        AC_ARG_WITH([serial],
                          AS_HELP_STRING([--with-serial = value],
                                                         [serial compilation. 
]),
                          [SERIAL_VALUE=$withval],[SERIAL_VALUE="yes"])
        AC_MSG_CHECKING(for serial compilation)
        AM_CONDITIONAL([NOSERIAL], [test $SERIAL_VALUE = no])
        AC_MSG_RESULT($SERIAL_VALUE) 
        

        dnl parallel build?
        AC_ARG_WITH([parallel],
                          AS_HELP_STRING([--with-parallel = value],
                                                         [parallel compilation. 
]),
                          [PARALLEL_VALUE=$withval],[PARALLEL_VALUE="yes"])
        AC_MSG_CHECKING(for parallel compilation)
        AM_CONDITIONAL([NOPARALLEL], [test $PARALLEL_VALUE = no])
        AC_MSG_RESULT($PARALLEL_VALUE) 

        dnl: check that at least serial or parallel builds have been requested!
        if test "$SERIAL_VALUE" != "yes" ; then
                if test "$PARALLEL_VALUE" != "yes"; then
                AC_MSG_ERROR([cannot request --with-serial=no and 
--with-parallel=no at
the same time!])
                fi
        fi


        dnl Matlab directory
        AC_ARG_WITH([matlab-dir],
                          AS_HELP_STRING([--with-matlab-dir = DIR],
                                                         [matlab root 
directory. necessary for serial build.]),
                         [MATLAB_ROOT=$withval],[MATLAB_ROOT=""]) 
        
        if test -d "$MATLAB_ROOT"; then

                AC_MSG_CHECKING(for Matlab headers and libraries in 
$MATLAB_ROOT)

                dnl defaults
                HAVE_MATLAB=yes
                MATLABINCL=-I"$MATLAB_ROOT/extern/include";
                dnl  use matlab provided mexext routine to test for extension
                                
                MEX=$MATLAB_ROOT/bin/mex

                dnl OS-dependent variables and checks
                case "${host_os}" in
                        *linux*)
                        if test "${host_cpu}" = "x86_64";
                        then
                                MEXLIB=-L"$MATLAB_ROOT/bin/glnxa64/ -lmex"
                                MEXLINK="-pthread -shared
-W2,--version-script,${MATLAB_ROOT}/extern/lib/glnxa64/mexFunction.map";
                        else
                                MEXLIB=-L"$MATLAB_ROOT/bin/glnx86/ -lmex"
                                MEXLINK="-pthread -shared
-W2,--version-script,${MATLAB_ROOT}/extern/lib/glnx86/mexFunction.map";
                        fi
                        MEXEXT=`$MATLAB_ROOT/bin/mexext`
                        MEXEXT=".$MEXEXT"
                        ;;
                        *darwin9.6.0*)
                        MEXLIB=-L"$MATLAB_ROOT/bin/maci/ -lmex -lmx"
                        MEXLINK="-Wl,-twolevel_namespace -undefined error -arch 
i386
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
-bundle
-Wl,-exported_symbols_list,$MATLAB_ROOT/extern/lib/maci/mexFunction.map"
                        MEXEXT=`$MATLAB_ROOT/bin/mexext`
                        MEXEXT=".$MEXEXT"
                        ;;
                        *cygwin*)
                        MEXLIB="-dll -export:mexFunction
-LIBPATH:\"$MATLAB_ROOT\extern\lib\win32\microsoft\" libmx.lib libmex.lib
libmat.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib
advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
odbccp32.lib  -NOLOGO -INCREMENTAL:NO"


                        MEXEXT=`$MATLAB_ROOT/bin/mexext.bat`
                        MEXEXT=".$MEXEXT"
                        ;;

                esac

                AC_DEFINE([_HAVE_MATLAB_],[1],[with Matlab in ISSM src])
                AC_SUBST([MATLABINCL])
                AC_SUBST([MEX])
                AC_SUBST([MEXEXT])
                AC_SUBST([MEXLIB]) 
                AC_SUBST([MEXLINK])
        
                AC_MSG_RESULT($HAVE_MATLAB)
        else
                HAVE_MATLAB=no
        fi

        
        if test $HAVE_MATLAB = no; then
                if test "$SERIAL_VALUE" = "yes" ; then
                        AC_MSG_ERROR([--with-matlab-dir  missing. Matlab is 
needed to run ISSM
serially!])
                fi
        fi

        dnl get version number
        if test $HAVE_MATLAB = yes; then

                AX_MATLAB_VERSION
                
                dnl  if matlab version is 7.5 and more, and if platform is 
x86_64, then
compile with largearray
                dnl   default is no 
                largearrays=no
                if test $MATLAB_MAJOR -ge 7; then 
                        if test $MATLAB_MINOR -ge 5; then 
                                if test "${host_cpu}" = "x86_64"; then
                                        largearrays=yes
                                fi
                        fi
                fi
        fi
        AM_CONDITIONAL(LARGEARRAYS, test x$largearrays = xyes)
        
        dnl Triangle directory
        AC_ARG_WITH([triangle-dir],
                          AS_HELP_STRING([--with-triangle-dir = DIR], [triangle 
root directory.
necessary for serial build]),
                         [TRIANGLE_ROOT=$withval],[TRIANGLE_ROOT=""]) 
        AC_MSG_CHECKING(for Triangle headers and libraries )
        if test -d "$TRIANGLE_ROOT"; then


                dnl defaults
                HAVE_TRIANGLE=yes
                TRIANGLEINCL=-I$TRIANGLE_ROOT/
                TRIANGLELIB=$TRIANGLE_ROOT/triangle.a

                AC_DEFINE([_HAVE_TRIANGLE_],[1],[with Triangle in ISSM src])
                AC_SUBST([TRIANGLEINCL])
                AC_SUBST([TRIANGLELIB])

        else
                HAVE_TRIANGLE=no
        fi
        AC_MSG_RESULT($HAVE_TRIANGLE)

        AC_MSG_CHECKING(for triangle and parallel status)
        if test $HAVE_TRIANGLE = no; then
                if test "$SERIAL_VALUE" = "yes" ; then
                        AC_MSG_ERROR([--with-triangle-dir  missing. Triangle is 
needed to run
ISSM serially!])
                fi
        fi
        AC_MSG_RESULT(ok)

        dnl Dakota directory
        AC_ARG_WITH([dakota-dir],
                          AS_HELP_STRING([--with-dakota-dir = DIR], [dakota 
root directory.
necessary for serial build]),
                         [DAKOTA_ROOT=$withval],[DAKOTA_ROOT=""]) 
        AC_MSG_CHECKING(for Dakota )
        
        if test -d "$DAKOTA_ROOT"; then

                dnl defaults
                HAVE_DAKOTA=yes
                DAKOTAINCL=-I$DAKOTA_ROOT/include
                DAKOTALIB="-L$DAKOTA_ROOT/lib -ldakota -lteuchos -lpecos 
-lfftw3 -llhs 
-levidence -lsurfpack -lconmin -lddace -lfsudace    -ljega -lcport -lopt
-lpsuade -lnewmat    -lncsuopt -lgsl -lquadrature -lcoliny -lcolin -lpebbl    
-lutilib -l3po -lnappspack -lappspack -lconveyor -lshared -lcdd -lamplsolver
"

                AC_DEFINE([_HAVE_DAKOTA_],[1],[with Dakota in ISSM src])
                AC_SUBST([DAKOTAINCL])
                AC_SUBST([DAKOTALIB])

        else
                HAVE_DAKOTA=no
        fi
        AC_MSG_RESULT($HAVE_DAKOTA)

                
        dnl Metis directory
        AC_ARG_WITH([metis-dir],
                          AS_HELP_STRING([--with-metis-dir = DIR],
                                                         [metis root directory. 
necessary for serial build]),
                          [METIS_ROOT=$withval],[METIS_ROOT=""])

        if test -d "$METIS_ROOT"; then

                AC_MSG_CHECKING(for Metis headers and libraries in $METIS_ROOT)

                dnl defaults
                HAVE_METIS=yes
                
                case "${host_os}" in
                        *cygwin*)
                        METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib"
                        ;;
                        *linux*)
                        METISLIB=-L"$METIS_ROOT/ -lmetis"
                        ;;
                        *darwin9.6.0*)
                        METISLIB=-L"$METIS_ROOT/ -lmetis"
                        ;;
                esac
                                                  
                METISINCL=-I"$METIS_ROOT/Lib"

                AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src])
                AC_SUBST([METISINCL])
                AC_SUBST([METISLIB])
        else
                HAVE_METIS=no
        fi

        if test $HAVE_METIS = no; then
        AC_MSG_ERROR([--with-metis-dir  missing. Metis is needed to run ISSM]);
        else
        AC_MSG_RESULT($HAVE_METIS)
        fi

        dnl Mpi options!
        AC_MSG_CHECKING(for mpi...)
        AC_ARG_WITH([mpi-lib],
                          AS_HELP_STRING([--with-mpi-lib = otions],
                                                         [mpi options, for ex: 
"-L$MPIROOT -lmpich]),
                          [MPILIB=$withval],[MPILIB=""])
        
        AC_ARG_WITH([mpi-include],
                          AS_HELP_STRING([--with-mpi-include = DIR],
                                                         [mpi include 
directory, necessary for parallel build]),
                          [MPI_INCLUDE=$withval],[MPI_INCLUDE=""])

        dnl check that --with-mpi-include and --with-mpi-lib have been provided
        if test -z "$MPILIB" ; then
                if test "$PARALLEL_VALUE" = "yes" ; then
                        AC_MSG_ERROR([empty --with-mpi-lib options! MPI is 
needed to run ISSM in
paralle!])
                fi
        else
                if test -z "$MPI_INCLUDE" ; then
                        if test "$PARALLEL_VALUE" = "yes" ; then
                                AC_MSG_ERROR([empty --with-mpi-include 
directory! MPI is needed to run
ISSM in paralle!])
                        fi
                else
                        HAVE_MPI=yes
                        MPIINCL=-I"$MPI_INCLUDE/"
                        
                        AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
                        AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
                        AC_SUBST([MPIINCL])
                        AC_SUBST([MPILIB])
                fi
        fi
        AC_MSG_RESULT(done)

        dnl Petsc directory and architecture
        AC_ARG_WITH([petsc-dir],
                          AS_HELP_STRING([--with-petsc-dir = DIR],
                                                         [petsc root directory, 
necessary for parallel build]),
                          [PETSC_ROOT=$withval],[PETSC_ROOT=""])

        if test "$PARALLEL_VALUE" = "yes" ; then
                if test "$PETSC_ROOT" = "" ; then
                        AC_MSG_ERROR([missing --with-petsc-dir argument for 
parallel
compilation!])
                fi
        fi
        
        AC_ARG_WITH([petsc-arch],
                          AS_HELP_STRING([--with-petsc-arch = DIR],
                                                         [petsc arch , 
necessary for parallel build]),
                          [PETSC_ARCH=$withval],[PETSC_ARCH=""])

        if test "$PARALLEL_VALUE" = "yes" ; then
                if test "$PETSC_ARCH" = "" ; then
                        AC_MSG_ERROR([missing --with-petsc-arch argument for 
parallel
compilation!])
                fi
        fi
        
        AC_MSG_CHECKING(for Petsc headers and libraries in $PETSC_ROOT for
architecture $PETSC_ARCH)
        
        if test -d "$PETSC_ROOT"; then

                if test -d "$PETSC_ROOT/bmake/$PETSC_ARCH"; then
                
                        PETSCINCL="-I$PETSC_ROOT/include  -I$PETSC_ROOT/
-I$PETSC_ROOT/bmake/$PETSC_ARCH
-I$PETSC_ROOT/src/mat/impls/dense/mpi/plapack/"
                
                        case "${host_os}" in
                                *cygwin*)
                                PETSCLIB="-link 
-LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" libpetscksp.lib 
libpetscdm.lib  libpetscmat.lib  libpetscvec.lib libpetsc.lib 
libpetscsnes.lib libpetscts.lib libmpiuni.lib"
                                ;;
                                *linux*)
                                PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH 
-lpetscksp -lpetscdm -lpetscmat
-lpetscvec -lpetsc  -lpetscsnes -lpetscts"
                                ;;
                                *darwin9.6.0*)
                                PETSCLIB="-L$PETSC_ROOT/lib/$PETSC_ARCH 
-lpetscksp -lpetscdm -lpetscmat
-lpetscvec -lpetsc  -lpetscsnes -lpetscts"
                                ;;
                        esac
                                                  


                        AC_DEFINE([_HAVE_PETSC_],[1],[with Petsc in ISSM src])
                        AC_SUBST([PETSCINCL])
                        AC_SUBST([PETSCLIB])

                        HAVE_PETSC=yes
                else
                        HAVE_PETSC=no
                fi
        else
                HAVE_PETSC=no
        fi

        if test $HAVE_PETSC = no; then
                AC_MSG_ERROR([could not find petsc. user should specify 
--with-petsc-dir
and --with-petsc-arch options. Petsc is needed to run ISSM!])
        else
                AC_MSG_RESULT($HAVE_PETSC)
        fi

        dnl: when running in serial mode, MPI must be ignored, and set to 
internal
petsc mpiuni: 
        if test "$PARALLEL_VALUE" = "no" ; then
                HAVE_MPI=yes
                MPIINCL=-I"$PETSC_ROOT/include/mpiuni"

                case "${host_os}" in
                        *cygwin*)
                        MPILIB="-link -LIBPATH:\"$PETSC_ROOT/lib/$PETSC_ARCH\" 
libmpiuni.lib"
                        ;;
                        *linux*)
                        MPILIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
                        ;;
                        *darwin9.6.0*)
                        MPILIB="-L$PETSC_ROOT/lib/$PETSC_ARCH -lmpiuni"
                        ;;
                esac
                                                                  


                        
                AC_DEFINE([_HAVE_MPI_],[1],[with Mpi in ISSM src])
                AC_DEFINE([HAVE_MPI],[1],[with Mpi in ISSM src])
                AC_SUBST([MPIINCL])
                AC_SUBST([MPILIB])
        fi
        

        dnl Slepc directory
        AC_ARG_WITH([slepc-dir],
                          AS_HELP_STRING([--with-slepc-dir = DIR],
                                                         [slepc root 
directory]),
                          [SLEPC_ROOT=$withval],[SLEPC_ROOT=""])
                          
        AC_MSG_CHECKING(for Slepc headers and libraries in $SLEPC_ROOT)
        if test -d "$SLEPC_ROOT"; then


                dnl defaults
                HAVE_SLEPC=yes
                SLEPCINCL=-I"$SLEPC_ROOT/include"
                SLEPCLIB=-L"$SLEPC_ROOT/lib/ -lslepc"

                AC_DEFINE([_HAVE_SLEPC_],[1],[with Slepc in ISSM src])
                AC_SUBST([SLEPCINCL])
                AC_SUBST([SLEPCLIB])
        else
                HAVE_SLEPC=no
        fi
        AC_MSG_RESULT($HAVE_SLEPC)
        
        dnl Scalapack directory
        AC_ARG_WITH([scalapack-dir],
                          AS_HELP_STRING([--with-scalapack-dir = DIR],
                                                         [scalapack root 
directory]),
                          [SCALAPACK_ROOT=$withval],[SCALAPACK_ROOT=""])
                          
        AC_MSG_CHECKING(for Scalapack headers and libraries in $SCALAPACK_ROOT)
        if test -d "$SCALAPACK_ROOT"; then


                dnl defaults
                HAVE_SCALAPACK=yes
                SCALAPACKLIB=-L"$SCALAPACK_ROOT/ -lscalapack"

                AC_DEFINE([_HAVE_SCALAPACK_],[1],[with Scalapack in ISSM src])
                AC_SUBST([SCALAPACKLIB])
        else
                HAVE_SCALAPACK=no
        fi
        AC_MSG_RESULT($HAVE_SCALAPACK)

        dnl Blas-lapack directory
        AC_ARG_WITH([blas-lapack-dir],
                          AS_HELP_STRING([--with-blas-lapack-dir = DIR],
                                                         [blas-lapack root 
directory]),
                          [BLASLAPACK_ROOT=$withval],[BLASLAPACK_ROOT=""])
                          
        AC_MSG_CHECKING(for Blas and Lapack headers and libraries in
$BLASLAPACK_ROOT)
        if test -d "$BLASLAPACK_ROOT"; then


                dnl defaults
                HAVE_BLASLAPACK=yes
                BLASLAPACKINCL=""
                
                dnl: branch on whether we are running on windows or linux.
                case "${host_os}" in
                        *cygwin*)
                        BLASLAPACKLIB="-link -LIBPATH:\"$BLASLAPACK_ROOT\" 
libf2cblas.lib 
libf2clapack.lib"
                        ;;
                        *linux*)
                        BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack" 
                        ;;
                        *darwin9.6.0*)
                        BLASLAPACKLIB=-L"$BLASLAPACK_ROOT -lfblas -lflapack" 
                        ;;
                esac
                                                                  


                AC_DEFINE([_HAVE_BLASLAPACK_],[1],[with blas lapack in ISSM 
src])
                AC_SUBST([BLASLAPACKLIB])
                AC_SUBST([BLASLAPACKINCL])
        else
                HAVE_BLASLAPACK=no
        fi
        AC_MSG_RESULT($HAVE_BLASLAPACK)

        dnl mkl directory
        AC_ARG_WITH([mkl-dir],
                          AS_HELP_STRING([--with-mkl-dir = DIR],
                                                         [mkl root directory]),
                          [MKL_ROOT=$withval],[MKL_ROOT=""])
                          
        AC_MSG_CHECKING(for mkl headers and libraries in $MKL_ROOT)
        if test -d "$MKL_ROOT"; then

                dnl defaults
                HAVE_MKL=yes
                MKLINCL=""
                MKLLIB=-L"$MKL_ROOT -lmkl_lapack -lmkl -lguide"

                AC_DEFINE([_HAVE_MKL_],[1],[with mkl in ISSM src])
                AC_SUBST([MKLLIB])
                AC_SUBST([MKLINCL])
        else
                HAVE_MKL=no
        fi
        AC_MSG_RESULT($HAVE_MKL)

        dnl Plapack directory
        AC_ARG_WITH([plapack-dir],
                          AS_HELP_STRING([--with-plapack-dir = DIR],
                                                         [plapack root 
directory]),
                          [PLAPACK_ROOT=$withval],[PLAPACK_ROOT=""])
                          
        AC_MSG_CHECKING(for Plapack headers and libraries in $PLAPACK_ROOT)
        if test -d "$PLAPACK_ROOT"; then


                dnl defaults
                HAVE_PLAPACK=yes
                PLAPACKINCL=-I"$PLAPACK_ROOT/INCLUDE"
                PLAPACKLIB=-L"$PLAPACK_ROOT/ -lPLAPACK"

                AC_DEFINE([_HAVE_PLAPACK_],[1],[with Plapack in ISSM src])
                AC_SUBST([PLAPACKINCL])
                AC_SUBST([PLAPACKLIB])
        else
                HAVE_PLAPACK=no
        fi
        AC_MSG_RESULT($HAVE_PLAPACK)

        dnl Mumps directory
        AC_ARG_WITH([mumps-dir],
                          AS_HELP_STRING([--with-mumps-dir = DIR],
                                                         [mumps root 
directory]),
                          [MUMPS_ROOT=$withval],[MUMPS_ROOT=""])
                          
        AC_MSG_CHECKING(for Mumps headers and libraries in $MUMPS_ROOT)
        if test -d "$MUMPS_ROOT"; then

                dnl defaults
                HAVE_MUMPS=yes
                MUMPSINCL=-I"$MUMPS_ROOT/include"
                MUMPSLIB=-L"$MUMPS_ROOT/lib -ldmumps -lcmumps -lpord"

                AC_DEFINE([_HAVE_MUMPS_],[1],[with Mumps in ISSM src])
                AC_SUBST([MUMPSINCL])
                AC_SUBST([MUMPSLIB])
        else
                HAVE_MUMPS=no
        fi
        AC_MSG_RESULT($HAVE_MUMPS)

        dnl Blacs directory
        AC_ARG_WITH([blacs-dir],
                          AS_HELP_STRING([--with-blacs-dir = DIR],
                                                         [blacs root 
directory]),
                          [BLACS_ROOT=$withval],[BLACS_ROOT=""])
                          
        AC_MSG_CHECKING(for Blacs headers and libraries in $BLACS_ROOT)
        if test -d "$BLACS_ROOT"; then

                dnl defaults
                HAVE_BLACS=yes
                BLACSINCL=""
                BLACSLIB=-L"$BLACS_ROOT/ -lblacs"
        
                AC_DEFINE([_HAVE_BLACS_],[1],[with Blacs in ISSM src])
                AC_SUBST([BLACSINCL])
                AC_SUBST([BLACSLIB])
        else
                HAVE_BLACS=no
        fi
        AC_MSG_RESULT($HAVE_BLACS)

        dnl math library  option
        AC_MSG_CHECKING(for math library...)
        AC_ARG_WITH([math-lib],
                          AS_HELP_STRING([--with-math-lib = otions],
                                                         [math options, for ex: 
"/usr/lib/libm.a]),
                          [MATH_LIB=$withval],[MATH_LIB=""])

        dnl check that --with-math-lib may have been provided
        if test -n "$MATH_LIB" ; then
                HAVE_MATH=yes
                MATHLIB="$MATH_LIB"

                AC_DEFINE([_HAVE_MATH_],[1],[with MATH in ISSM src])
                AC_SUBST([MATHLIB])
        fi
        AC_MSG_RESULT(done)

        dnl fortran library  option
        AC_MSG_CHECKING(for fortran library...)
        AC_ARG_WITH([fortran-lib],
                          AS_HELP_STRING([--with-fortran-lib = options],
                                                         [fortran options, for 
ex: "/usr/lib/gfortran.a]),
                          [FORTRAN_LIB=$withval],[FORTRAN_LIB=""])

        dnl check that --with-fortran-lib may have been provided
        if test -n "$FORTRAN_LIB" ; then
                HAVE_FORTRAN=yes
                FORTRANLIB="$FORTRAN_LIB"

                AC_DEFINE([_HAVE_FORTRAN_],[1],[with FORTRAN in ISSM src])
                AC_SUBST([FORTRANLIB])
        fi
        AC_MSG_RESULT(done)

        dnl graphics library  option
        AC_MSG_CHECKING(for graphics library...)
        AC_ARG_WITH([graphics-lib],
                          AS_HELP_STRING([--with-graphics-lib = options],
                                                         [graphics options, for 
ex: "/usr/X11/lib/libX11.a]),
                          [GRAPHICS_LIB=$withval],[GRAPHICS_LIB=""])

        dnl check that --with-graphics-lib may have been provided
        if test -n "$GRAPHICS_LIB" ; then
                HAVE_GRAPHICS=yes
                GRAPHICSLIB="$GRAPHICS_LIB"

                AC_DEFINE([_HAVE_GRAPHICS_],[1],[with GRAPHICS in ISSM src])
                AC_SUBST([GRAPHICSLIB])
        fi
        AC_MSG_RESULT(done)

        dnl vendor?
        AC_ARG_WITH([vendor],
                          AS_HELP_STRING([--with-vendor = VENDOR], [vendor 
name, ex: intel]),
                         [VENDOR=$withval],[VENDOR=""]) 
        AC_MSG_CHECKING(for vendor compilers )
        if test -n "$VENDOR"; then

                if  test $VENDOR = intel; then
                        export CC=icl
                        export CXX=icl
                        export CXXFLAGS="-DWIN32 -D_INTEL_"
                else
                AC_MSG_ERROR([unknow compiler vendor!])
                fi
        fi
])


-- 
View this message in context: 
http://www.nabble.com/automake-and--Fe-option-for-icl-intel-compiler-c%2B%2B-tp24837262p24837262.html
Sent from the Gnu - Automake - General mailing list archive at Nabble.com.



Reply via email to