Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

Running Chemkin through fortran

    • 194106015
      Subscriber

      Hello, Can someone help with this,

      When i am trying to run Chemkin through Fortran in Linux platfrom( Ubuntu),  I am getting error for the standard example files also. Below is the terminal o/p when i run the make file

      neeraj@HP-Z2:~/Desktop/Neeraj/Project_in_Linux/Code/sample_apps_f77/sksample$ make -f sksample_unix.mak
      Compiling sksample_driver.f
      ifort -assume noold_maxminloc -fPIC -O3 -m64 -D_LINUXX8664 -DUSE_XERCES_2_8 -qopenmp -mkl=sequential -I. -Iunix -I../unix -I.. -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/include/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/user_routines -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/solvers/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/multiPhase -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/kinetics/API  -I/include -I/include/xercesc -I/source/encryption -nofor_main -fpp  -I/opt/intel/oneapi/mkl/2021.4.0/include/intel64/lp64 -I/opt/intel/oneapi/mkl/2021.4.0/include  -c -o sksample_driver.o sksample_driver.f
      ifort: command line remark #10412: option '-mkl=sequential' is deprecated and will be removed in a future release. Please use the replacement option '-qmkl=sequential'
      ifort: command line warning #10434: option '-nofor_main' use with underscore is deprecated; use '-nofor-main' instead
      Compiling sksample.f
      ifort -assume noold_maxminloc -fPIC -O3 -m64 -D_LINUXX8664 -DUSE_XERCES_2_8 -qopenmp -mkl=sequential -I. -Iunix -I../unix -I.. -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/include/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/user_routines -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/solvers/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/multiPhase -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/kinetics/API  -I/include -I/include/xercesc -I/source/encryption -nofor_main -fpp  -I/opt/intel/oneapi/mkl/2021.4.0/include/intel64/lp64 -I/opt/intel/oneapi/mkl/2021.4.0/include  -c -o sksample.o sksample.f
      ifort: command line remark #10412: option '-mkl=sequential' is deprecated and will be removed in a future release. Please use the replacement option '-qmkl=sequential'
      ifort: command line warning #10434: option '-nofor_main' use with underscore is deprecated; use '-nofor-main' instead
      Creating /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample
      ifort -mkl=sequential -fpp -I. -Iunix -I../unix -I.. -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/include/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/user_routines -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/solvers/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/source/multiPhase -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/kinetics/API  -I/include -I/include/xercesc -I/source/encryption -L. -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/ -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/ -o /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample sksample_driver.o sksample.o -L. -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/ -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/ /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/chemkin_xml.a  /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/restart_xml.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/chemkin_zip.a  /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/ckptm.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/surface_chemkin.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/chemkin.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/solvers.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib//libmkl_blas95_lp64.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib//libmkl_lapack95_lp64.a  -lpthread -lm -mkl=sequential /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/user_routines.a -lxerces-c-3.2 -lckzip -lckunzip -lCKGlobalMechanism   -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/ -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/lib/ -qopenmp -lpthread -lrt -lstdc++ 
      ifort: command line remark #10412: option '-mkl=sequential' is deprecated and will be removed in a future release. Please use the replacement option '-qmkl=sequential'
      ifort: command line remark #10412: option '-mkl=sequential' is deprecated and will be removed in a future release. Please use the replacement option '-qmkl=sequential'
      Running sksample
      /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample < sksample.inp > sksample.out
      /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample: error while loading shared libraries: libxerces-c-3.2.so: cannot open shared object file: No such file or directory
      make: *** [sksample_make.inc:55: sksample.out] Error 127

    • jcooper
      Ansys Employee

      Hi Neeraj:

      The Chemkin API document details some preparation steps for Chemkin compilation on Unix. I would suggest going over these if you haven't already.  The primary issue here seems to be a missing library, however:

      /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample: error while loading shared libraries: libxerces-c-3.2.so: cannot open shared object file

      The Ansys Chemkin-Pro installation file include/chemkin_make_unix.inc (include\chemkin_make_pc.inc for PC), defines make (nmake) macros for required compile and link flags, as well as library names and locations. You MUST use this installation file when compiling your own code to ensure that the compiler directives are consistent with those used in Chemkin-Pro, and to avoid errors during linking. A user makefile can set a few additional macros to compile and link a program; the user macro, CKROOT for example, must be defined as the root location of your Chemkin-Pro installation.  This should be included in the make file as below:

      (Please see the Chemkin installation test files in ...ANSYS Inc\v231\reaction\chemkinpro.win64\samples\chemkin_cfd_api\test01 for another test program that uses the make file below.)

      #
      # This make file is used to build the Chemkin chemkin_cfd_api sample.

      ALL : chemkin_cfd_api.out

      # relative path to the CHEMKIN install directory
      CKROOT  = ../../..

      # global CHEMKIN make directives
      include $(CKROOT)/include/chemkin_make_unix.inc

      ALL_OBJS = $(CKROOT)/samples/chemkin_cfd_api/cpp_interface/KINetics_Driver$(OBJECT) $(CKROOT)/samples/chemkin_cfd_api/cpp_interface/KINeticsLibrary$(OBJECT)

      ALL_LIBS = $(CPPF77_LIBFLAGS) -lKINetics -lkinetics_usr $(SAX_ONLY_LIBFLAGS) $(CPPF77_SYSTEM_LIBS)

      CHEMKININCLUDE = -I. -I$(CKROOT)/include/ -I$(CKROOT)/samples/chemkin_cfd_api/API/

      # make directives for this problem
      include chemkin_cfd_api_test01_make.inc

      chemkin_cfd_api.out     : chemkin_cfd_test$(EXE)
          $(CK_DISPLAY) Running chemkin_cfd_test
          .$(SLASH)chemkin_cfd_test$(EXE) > chemkin_cfd_api.out

      I hope this helps.

      Best Regards,

      Judy

       

       

    • 194106015
      Subscriber

      Hello Judy, Thanks for the response.

      I have gone through the Chemkin API document and have updated the CKROOT path.

      I am trying to run a sample example problem provided in samples provided in .

      /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/samples/sample_apps_f77

      There in make file i have to just update the CKROOT, and i have done that.

      If we see my o/p which i posted, it is compiling properly ksample_driver.f, sksample.f etc

      It has problem when its running sksample in line

      home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample < sksample.inp > sksample.out

      here sksample is an exe file ,

      in error msg

      /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro_linuxx8664/bin/sksample: error while loading shared libraries: libxerces-c-3.2.so: cannot open shared object file

      here i think its considering sksample as an folder.  The shared object libxerces-c-3.2.so is present inside /.../chemkinpro_linuxx8664/bin but it  is searching inside sksample folder. Thats what i think is causing issue.

      Thanks in advance

      Regards

      Neeraj

       

    • jcooper
      Ansys Employee

      HI Neeraj:

      You can try moving a copy of the file into cksample to see if it addresses the problem. 

      The make file is pretty old.  Can you please send me the output from the compile and link steps?

      Thanks,

      Judy

      • 194106015
        Subscriber

        Hello Judy, Thaks for the response.

        Regarding moving a copy of file to cksample: I tried that but cant because cksample is a exe file present inside ../bin . This exe file is called to run the program , i am unable to create a folder cksample inside bin as already with same name an exe file is there.

        Output from the terminal :

        ~/Desktop/Neeraj/Project_in_Linux/Code/sample_apps_f77/sksample$ make -i -f sksample_unix.mak

        Compiling sksample_driver.f
        ifort -assume noold_maxminloc -fPIC -O3 -m64 -D_LINUXX8664 -DUSE_XERCES_2_8 -qopenmp -mkl=sequential -I. -Iunix -I../unix -I.. -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/include/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/user_routines -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/solvers/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/multiPhase -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/kinetics/API  -I/include -I/include/xercesc -I/source/encryption -nofor_main -fpp  -I/opt/intel/oneapi/mkl/2021.4.0/include/intel64/lp64 -I/opt/intel/oneapi/mkl/2021.4.0/include  -c -o sksample_driver.o sksample_driver.f
        Compiling sksample.f
        ifort -assume noold_maxminloc -fPIC -O3 -m64 -D_LINUXX8664 -DUSE_XERCES_2_8 -qopenmp -mkl=sequential -I. -Iunix -I../unix -I.. -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/include/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/user_routines -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/solvers/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/multiPhase -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/kinetics/API  -I/include -I/include/xercesc -I/source/encryption -nofor_main -fpp  -I/opt/intel/oneapi/mkl/2021.4.0/include/intel64/lp64 -I/opt/intel/oneapi/mkl/2021.4.0/include  -c -o sksample.o sksample.f
        Creating /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/sksample
        ifort -mkl=sequential -fpp -I. -Iunix -I../unix -I.. -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/include/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/user_routines -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/solvers/ -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/source/multiPhase -I/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/kinetics/API  -I/include -I/include/xercesc -I/source/encryption -L. -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/ -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/ -o /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/sksample sksample_driver.o sksample.o -L. -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/ -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/ /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/chemkin_xml.a  /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/restart_xml.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/chemkin_zip.a  /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/ckptm.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/surface_chemkin.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/chemkin.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/solvers.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib//libmkl_blas95_lp64.a /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib//libmkl_lapack95_lp64.a  -lpthread -lm -mkl=sequential /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/user_routines.a -lxerces-c-3.2 -lckzip -lckunzip -lCKGlobalMechanism   -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/ -L/home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/lib/ -qopenmp -lpthread -lrt -lstdc++ 
        Running chem
        /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/chem -i chem.inp -o chem.out
        Licenses Released
        Running surf
        /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/surf -i surf.inp -o surf.out
        Licenses Released
        Running sksample
        /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/sksample < sksample.inp > sksample.out
        /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664/bin/sksample: error while loading shared libraries: libxerces-c-3.2.so: cannot open shared object file: No such file or directory
        make: [sksample_make.inc:55: sksample.out] Error 127 (ignored)

        sksample_unix.mak file has

        #***********************************************************************BEGIN-HDR
        #
        #  © 2022 ANSYS, Inc.  Unauthorized use, distribution, or duplication is prohibited.
        #
        #  $Header: /chemkin/4.1/prebuild/samples/sample_apps_cpp/sksample/sksample_unix.mak 55    12/21/05 8:46p Frupley $
        #
        #  $NoKeywords: $
        #***********************************************************************END-HDR
        #
        # This make file is used to build the Chemkin SKSAMPLE sample.

        ALL : sksample.out

        # relative path to the CHEMKIN install directory
        CKROOT  = /home/neeraj/Documents/Ansys_inst/ansys_inc/v222/reaction/chemkinpro.linuxx8664

        # global CHEMKIN make directives
        include $(CKROOT)/include/chemkin_make_unix.inc


        # first part of the Fortran link command
        ifdef USE_INT64
        LINK  = $(FOR) $(FFLAGS) $(LDFLAGS) $(EXENAME)
        else
        LINK  = $(FOR) -mkl=sequential -fpp $(CHEMKININCLUDE) $(LDFLAGS) $(EXENAME)
        endif

        # make directives for this problem
        include sksample_make.inc

        ----------------------------------------------------------------------------

        sksample_make.inc file has

        #***********************************************************************BEGIN-HDR
        #
        #  © 2022 ANSYS, Inc.  Unauthorized use, distribution, or duplication is prohibited.
        #
        #  $Header: /chemkin/4.3/prebuild/samples/sample_apps_f77/sksample/sksample_make.inc 16    5/16/08 9:51a Frupley $
        #
        #  $NoKeywords: $
        #***********************************************************************END-HDR
        #
        # This make file is used to build the Chemkin SKSAMPLE sample.

        #
        # targets to build
        #

        SKSAMPLE_OBJS = sksample_driver$(OBJECT) sksample$(OBJECT)
        $(CHEMKINBIN)sksample$(EXE)   : $(SKSAMPLE_OBJS)
            $(CK_DISPLAY) Creating $@
            $(LINK) $? $(ALL_LIBRARIES)
            $(REMOVE) $(INTERMEDIATE_FILES)

        #
        # run the programs
        #

        #*************************************
        #   Run gas-phase Chemkin interpreter
        #     the input file is 'chem.inp'
        #     the output file is 'chem.out'
        #*************************************
        chem.asc     : $(CHEMKINBIN)chem$(EXE) therm.dat chem.inp
            $(CK_DISPLAY) Running chem
            $(REMOVE) $(CHEM_OUTPUTS)
            $(CHEMKINBIN)chem -i chem.inp -o chem.out

        #*************************************
        #   Run Surface Chemkin interpreter
        #     the input file is 'surf.inp'
        #     the output file is 'surf.out'
        #*************************************
        surf.asc     : $(CHEMKINBIN)surf$(EXE) chem.asc therm.dat surf.inp
            $(CK_DISPLAY) Running surf
            $(REMOVE) $(SURF_OUTPUTS)
            $(CHEMKINBIN)surf -i surf.inp -o surf.out

        #*************************************
        #   Run Sksample
        #     the input file is 'sksample.inp'
        #     the output file is 'sksample.out'
        #*************************************
        SKSAMPLE_OUTPUTS = sksample.out
        sksample.out  : $(CHEMKINBIN)sksample$(EXE) surf.asc sksample.inp chemkindata.dtd
            $(CK_DISPLAY) Running sksample
            $(REMOVE) $(SKSAMPLE_OUTPUTS)
            $(CHEMKINBIN)sksample < sksample.inp > sksample.out

        ALL_EXES     = $(CHEMKINBIN)sksample$(EXE)
        CLEAN       :
            $(REMOVE) $(EXTRA_CLEAN) $(ALL_EXES) $(ALL_LIBS) $(SKSAMPLE_OUTPUTS)

        ----------------------------------------------------------------------------

         

         

         

    • jcooper
      Ansys Employee

      HI Neeraj:

      It is possible that the environment is setup incorrectly, so that Chemkin doesn't know where to look for the file.  The default is in the working folder.

      Please try source either chemkinpro_setup.csh or chemkinpro_setup.ksh in ansys_inc\v222\reaction\chemkinpro.linuxx8664\bin directory.  This will set up the necessary environment for running Chemkin on Linux.

      Best Regards,

      Judy

    • 194106015
      Subscriber

      Hello Judy.

      Thanks for the reply. You are correct

      When we are sourcing the .ksh file in .bashrc, it was not able to source the .ksh file properly because of the improper folder name chemkinpro.linuxx8664.  This folder is generated automatically while installation. I changed the folder name to chemkinpro_linuxx8664, then updated this folder name where ever required in scripts and now its working fine.

      Thanks again for the help and support

      Regards

      Neeraj

       

Viewing 5 reply threads
  • The topic ‘Running Chemkin through fortran’ is closed to new replies.