#-------------------------------------------------------------------- # Disable caching since it seems to get in the way # more times than it helps us. #-------------------------------------------------------------------- ## make sure we are in the correct dir AC_INIT(MakeIncl.ReactingFlows.in) ## There are some configs etc in ./config AC_CONFIG_AUX_DIR(config) ## Set what kind of a host and system this is AC_CANONICAL_HOST AC_CANONICAL_SYSTEM AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h strings.h sys/file.h sys/time.h unistd.h) ## ----------------------------------------------------------------------------- ## Things I have to look for ######################### # where cca-spec-classic-config and where ccafe-config is located # where the CFRFS Ports are ; the directory with AMPPort.h # where the document, .cca and .so files should be i.e install directory. Specified # by --prefix. # what the C++ compiler is # ## All the above will go into MakeIncl.. Also, the install dir # for the .so file will go into .cca, which is kept in # ./ccaComponent as !location=/ <--- do not forget this / # ## Apart from the above, I am going to hard-code the following in the MakeIncl..in # OPTIMIZATION = -O2 # FOPTIMIZATION = -O3 # SYSTEM = BEOWULF ## ------------------------------------------------------------------------------ ## Determine where the cca-spec-classic-config file is located AC_ARG_WITH(cca-spec-classic-config, [ Location of the cca-spec-classic-config file: --with-cca-spec-classic-config=Full path name to the cca-spec-classic-config file; --with-cca-spec-classic-config='/usr/local/cca/bin/cca-spec-classic-config'], [with_cca_spec_classic_config="$withval"], [with_cca_spec_classic_config=yes]) case "$with_cca_spec_classic_config" in no) # The user specified he doesn't want to specify where cca-spec-classic-config is # Crap out - can't work without it. AC_MSG_ERROR([ Option --without-cca-spec-classic-config will not work; the component needs it]) ;; yes) # The user did not give the location so search for this with_cca_spec_classic_config=_need_to_find ;; *) # The user gave me a real path. Check for the file anyway. AC_MSG_CHECKING( [for cca-spec-classic-config] ) if test -x "$with_cca_spec_classic_config"; then cca_spec_classic_config_file="$with_cca_spec_classic_config" AC_MSG_RESULT( [ Found "$with_cca_spec_classic_config" ] ) with_cca_spec_classic_config=_found else AC_MSG_ERROR( [ Could not find "$with_cca_spec_classic_config" ] ) fi ;; esac ## See if this file needs to be searched if test "$with_cca_spec_classic_config" = _need_to_find ; then # Where should I search this file by default ? system_dir_search="/usr/local/bin/ /usr/local/cca/bin/" hdir=$HOME home_dir_search1=" $hdir/bin/ $hdir/cca/bin/ " search_path=" $system_dir_search $home_dir_search1 " AC_FIND_FILE_STRICT_JR(cca-spec-classic-config, "$search_path") # AC_FIND_FILE_STRICT_JR will not return if it does not find the file. cca_spec_classic_config_dir="$ac_find_file_strict_dir" cca_spec_classic_config_file="$cca_spec_classic_config_dir/cca-spec-classic-config" with_cca_spec_classic_config=_found fi ############## repeat above logic for the file ccafe_config ## Determine where the ccafe-config file is located AC_ARG_WITH(ccafe-config, [ Location of the ccafe-config file: --with-ccafe-config=Full path name to the ccafe-config file; --with-ccafe-config='/usr/local/cca/bin/ccafe-config], [with_ccafe_config="$withval"], [with_ccafe_config=yes]) case "$with_ccafe_config" in no) # The user specified he doesn't want to specify where ccafe-config is # Crap out - can't work without it. AC_MSG_ERROR([ Option --without-ccafe-config will not work; the component needs it]) ;; yes) # The user did not give the location so search for this with_ccafe_config=_need_to_find ;; *) # The user gave me a real path. Check for the file anyway. AC_MSG_CHECKING( [for ccafe-config] ) if test -x "$with_ccafe_config"; then ccafe_config_file="$with_ccafe_config" AC_MSG_RESULT( [ Found "$with_ccafe_config" ] ) with_ccafe_config=_found else AC_MSG_ERROR( [ Could not find "$with_ccafe_config" ] ) fi ;; esac ## See if this file needs to be searched if test "$with_ccafe_config" = _need_to_find ; then # Where should I search this file by default ? system_dir_search="/usr/local/bin/ /usr/local/cca/bin/" hdir=$HOME home_dir_search1=" $hdir/bin/ $hdir/cca/bin/ " search_path=" $system_dir_search $home_dir_search1 " AC_FIND_FILE_STRICT_JR(ccafe-config, "$search_path") # AC_FIND_FILE_STRICT_JR will not return if it does not find the file. ccafe_config_dir="$ac_find_file_strict_dir" ccafe_config_file="$ccafe_config_dir/ccafe-config" with_ccafe_config=_found fi ## Need to find the directory where all the CRRFS Ports are AC_ARG_WITH(CFRFS_Ports, [ Location of the AMRPort.h file: --with-CFRFS_Ports=Directory_Name, Full dir name where AMRPort.h is kept; --with-CFRFS_Ports='/usr/local/cca/include/CFRFS_Ports], [with_CFRFS_Ports="$withval"], [with_CFRFS_Ports=yes]) case "$with_CFRFS_Ports" in no) # The user specified he doesn't want to specify where AMRPort.h is # Crap out - can't work without it. AC_MSG_ERROR([ Option --without-CFRFS_Ports will not work; the component needs it]) ;; yes) # The user did not give the location so search for this with_CFRFS_Ports=_need_to_find ;; *) # The user gave me a real path. Check for the file anyway. AC_MSG_CHECKING( [for AMRPort.h] ) if test -r "$with_CFRFS_Ports"/AMRPort.h; then CFRFS_PORTS_DIR="$with_CFRFS_Ports" AC_MSG_RESULT( [ Found "$with_CFRFS_Ports"/AMRPort.h ] ) with_CFRFS_Ports=_found else AC_MSG_ERROR( [ Could not find "$with_CFRFS_Ports"/AMRPort.h ] ) fi ;; esac ## See if this file needs to be searched if test "$with_CFRFS_Ports" = _need_to_find ; then # Where should I search this file by default ? system_dir_search="/usr/local/include/CFRFS_Ports /usr/local/cca/include/CFRFS_Ports" hdir=$HOME currdir=`pwd` home_dir_search1=" $hdir/CFRFS_Ports $hdir/cca/CFRFS_Ports " local_dir="$currdir/../CFRFS_Ports" search_path=" $local_dir $system_dir_search $home_dir_search1 " AC_FIND_FILE_STRICT_JR(AMRPort.h, "$search_path") # AC_FIND_FILE_STRICT_JR will not return if it does not find the file. CFRFS_PORTS_DIR="$ac_find_file_strict_dir" with_CFRFS_Ports=_found fi ## Need to find a Fortran 77 compiler AC_ARG_WITH(fcompiler, [Specify a Fortran compiler : --with-fcompiler=Name of a fortran compiler ; --with-fcompiler=pgf77 ], [with_fcompiler="$withval"], [with_fcompiler=yes] ) case "$with_fcompiler" in no) # The user specified he doesn't have a Fortran compiler # Crap out - can't work without it. AC_MSG_ERROR([ Option --without-fcompiler will not work; the module needs a F77 compiler]) ;; yes) # The user did not give the location so search for this with_fcompiler=_need_to_find ;; *) # The user gave me a real F77. Check for the file anyway. AC_MSG_CHECKING( [for $with_fcompiler] ) # I really cannot handle anything more than pgf77. Do this check here if test "$with_fcompiler" = "pgf77" ; then fc_pathname=`which $with_fcompiler | sed 's/'$with_fcompiler'//'` if test -x "$fc_pathname"/"$with_fcompiler" ; then AC_MSG_RESULT( [ Found "$with_fcompiler" ] ) FC="$with_fcompiler" FCOMPILERNAME="PGI" libpath=`echo $fc_pathname | sed 's/bin\///'` FTNRTL="-L$libpath/lib -Wl,-rpath,$libpath/lib -lpgftnrtl -lpgc" with_fcompiler=_found else AC_MSG_ERROR( [ Could not find "$with_fcompiler" ] ) fi else AC_MSG_WARN( [ Cannot deal with a compiler named "$with_fcompiler" ; will use default ] ) with_fcompiler=_need_to_find fi ;; esac ## Look for and use the default compiler, G77 if test "$with_fcompiler" = _need_to_find ; then # Where should I search this file by default ? system_dir_search="/usr/bin /usr/local/bin " hdir=$HOME home_dir_search=" $hdir/bin " search_path=" $system_dir_search $home_dir_search" AC_FIND_FILE_STRICT_JR(g77, "$search_path") # AC_FIND_FILE_STRICT_JR will not return if it does not find the file. FC="$ac_find_file_strict_dir"/g77 FCOMPILERNAME="G77" FTNRTL="-lg2c -lm" with_fcompiler=_found fi # Find C preprocessor AC_PROG_CXXCPP ## Check for the prefix if test "${prefix}" = "NONE"; then prefix=/usr/local fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi FINAL_INSTALL_DIR="${prefix}" VERSION_MAJOR=0.1 VERSION_MINOR=0.2 ## ----------------------------------------------------------------- # Final step. Substitute these definitions and form a # MakeIncl. file # # where cca-spec-classic-config is located and extract the following parameters # cca-spec-classic-config --var CCA_INC # cca-spec-classic-config --var CCA_CXX # cca-spec-classic-config --var CCA_CXX_FLAGS # cca-spec-classic-config --var CCA_LD_SEARCH_FLAGS # cca-spec-classic-config --var CCA_SHLIB_CFLAGS # cca-spec-classic-config --var CCA_SHLIB_LD # where ccafe-config is located and extract the following parameters # ccafe-config --var CCAFE_LIB_L_DIR # ccafe-config --var CCAFE_LIB_L # ccafe-config --var CCAFE_MPI_INC # ccafe-config --var CCAFE_pkgincludedir cca_inc=`$cca_spec_classic_config_file --var CCA_INC` cca_cxx=`$cca_spec_classic_config_file --var CCA_CXX` cca_cxx_flags=`$cca_spec_classic_config_file --var CCA_CXX_FLAGS` cca_ld_search_flags=`$cca_spec_classic_config_file --var CCA_LD_SEARCH_FLAGS` cca_shlib_cflags=`$cca_spec_classic_config_file --var CCA_SHLIB_CFLAGS` cca_shlib_ld=`$cca_spec_classic_config_file --var CCA_SHLIB_LD` ccafe_lib_l_dir=`$ccafe_config_file --var CCAFE_LIB_L_DIR` ccafe_lib_l=`$ccafe_config_file --var CCAFE_LIB_L` ccafe_mpi_inc=`$ccafe_config_file --var CCAFE_MPI_INC` ccafe_pkgincludedir=`$ccafe_config_file --var CCAFE_pkgincludedir` AC_SUBST(cca_inc) AC_SUBST(cca_cxx) AC_SUBST(cca_cxx_flags) AC_SUBST(cca_ld_search_flags) AC_SUBST(cca_shlib_cflags) AC_SUBST(cca_shlib_ld) AC_SUBST(ccafe_lib_l_dir) AC_SUBST(ccafe_lib_l) AC_SUBST(ccafe_mpi_inc) AC_SUBST(ccafe_pkgincludedir) AC_SUBST(FC) AC_SUBST(FTNRTL) AC_SUBST(FCOMPILERNAME) AC_SUBST(CFRFS_PORTS_DIR) AC_SUBST(FINAL_INSTALL_DIR) AC_OUTPUT(MakeIncl.ReactingFlows Doxygen.ReactingFlows ChemicalRates/ccaComponent/reaction.cca DiffCoeff/ccaComponent/DiffCoeff.cca DiffQuants/ccaComponent/DiffQuants.cca Diffusion/ccaComponent/DiffComp_JR.cca Driver/ccaComponent/Driver.cca HODiffusion/ccaComponent/HODiffComp_JR.cca HOLowMachDiffusion/ccaComponent/HOLowMachDiff_JR.cca IC/ccaComponent/ICcomponent_JR.cca NonConsConvection/ccaComponent/NonConsConvec.cca OneDFlowModel/ccaComponent/OneDFlowModel.cca SOLowMachDiffusion/ccaComponent/SOLowMachDiff_JR.cca ViscousStressTensor/ccaComponent/ViscousStressTensor.cca refComp/ccaComponent/ref.cca DRFM/ccaComponent/DC_drfm.cca PoissonRHSOpenDomain/ccaComponent/PoissonRHSOpenDomain_JR.cca, [], [] )