Git Product home page Git Product logo

Comments (9)

zerothi avatar zerothi commented on May 26, 2024

As always with fortran, don't mix compilers where you are using modules.

I.e. compile fdict with intel compiler.

from fdict.

hkp888 avatar hkp888 commented on May 26, 2024

Okay, I made my setup.make file as follows:

FC=ifort FFLAGS = -g

When I create the library, I get this:

VPATH="." ./src/variable.sh
ifort -E -P -x c -I./src -I./src -I. ./src/variable_pp.F90 | sed -f ./src/filter.sed > variable.f90
ifort: command line warning #10155: ignoring option '-x'; argument required
ifort: error #10236: File not found: 'c'
ifort -c -o variable.o -g variable.f90
VPATH="." ./src/dictionary.sh
ifort -E -P -x c -I./src -I./src -I. ./src/dictionary_pp.F90 | sed -f ./src/filter.sed > dictionary.f90
ifort: command line warning #10155: ignoring option '-x'; argument required
ifort: error #10236: File not found: 'c'
ifort -c -o dictionary.o -g dictionary.f90
ar -ru libfdict.a variable.o dictionary.o
ar: creating libfdict.a
ranlib libfdict.a

However, since the library folders are there, I tried compiling my program. It no longer spits out the error from the post above, but I get this:

subroutine1.f90(39): error #6767: No matching user defined OPERATOR with the given type and rank has been defined. [KV]
dict_1 = dict_1 // (key_string .kv. value1 )
---------------------------------^

subroutine1.f90(39): error #6054: A CHARACTER data type is required in this context. [DICT_1]
dict_1 = dict_1 // (key_string .kv. value1 )
----------^

subroutine1.f90(39): error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands.
dict_1 = dict_1 // (key_string .kv. value1 )
----------------^

subroutine2.f90(55): error #6285: There is no matching specific subroutine for this generic subroutine call. [ASSIGN]
call assign(some_variable, dict_1, key_string1)
------^

Could these errors be due to the error in the library compilation? ifort: error #10236: File not found: 'c' ?

from fdict.

zerothi avatar zerothi commented on May 26, 2024

Could you try simply doing:

make VENDOR=intel

That should work.

Otherwise you could add:

FPP = ifort -E -P -xc

to your setup.make file.

from fdict.

hkp888 avatar hkp888 commented on May 26, 2024

Thank you, Nick.

  1. This is what I get if I use make VENDOR=intel to create the library:
    VPATH="." ./setup.sh --default
    VPATH="." ./src/variable.sh
    ifort -E -P -x c -I./src -I./src -I. ./src/variable_pp.F90 | sed -f ./src/filter.sed > variable.f90
    ifort: command line warning #10155: ignoring option '-x'; argument required
    ifort: error #10236: File not found: 'c'
    ifort -c -o variable.o variable.f90
    VPATH="." ./src/dictionary.sh
    ifort -E -P -x c -I./src -I./src -I. ./src/dictionary_pp.F90 | sed -f ./src/filter.sed > dictionary.f90
    ifort: command line warning #10155: ignoring option '-x'; argument required
    ifort: error #10236: File not found: 'c'
    ifort -c -o dictionary.o dictionary.f90
    ar -ru libfdict.a variable.o dictionary.o
    ar: creating libfdict.a
    ranlib libfdict.a

  2. And if I add FPP = ifort -E -P -xc to the setup.make, I get:

VPATH="." ./setup.sh --default
VPATH="." ./src/variable.sh
ifort -E -P -xc -I./src -I./src -I. ./src/variable_pp.F90 | sed -f ./src/filter.sed > variable.f90
ifort: command line warning #10130: unknown extension 'c' ignored in option '-x'
ifort -c -o variable.o -g variable.f90
VPATH="." ./src/dictionary.sh
ifort -E -P -xc -I./src -I./src -I. ./src/dictionary_pp.F90 | sed -f ./src/filter.sed > dictionary.f90
ifort: command line warning #10130: unknown extension 'c' ignored in option '-x'
ifort -c -o dictionary.o -g dictionary.f90
ar -ru libfdict.a variable.o dictionary.o
ar: creating libfdict.a
ranlib libfdict.a

Then if I try to link the library and compile my program:
error #7002: Error in opening the compiled module file. Check INCLUDE paths. [DICTIONARY]
use dictionary
----^
error #7002: Error in opening the compiled module file. Check INCLUDE paths. [VARIABLE]
use variable

:(

from fdict.

zerothi avatar zerothi commented on May 26, 2024

Which version of the Intel compiler are you using?

from fdict.

hkp888 avatar hkp888 commented on May 26, 2024

I was using 2013.2, but I also tried the 2015 and 2016 versions. It looks like the -xc flag is not recognized. What is its purpose?

from fdict.

zerothi avatar zerothi commented on May 26, 2024

The -xc flag is to force intel compilers to pre-process fortran files as C source. Not always needed, but sometimes I have found this to be required.

  1. You should proceed with the 2nd option in the previous comments. I.e. FPP = ifort -E -P -xc, although a warning is issued I don't have any problems in the later linking step.

  2. I think you are linking incorrectly since the error is that the compiler can't find the module file at all. Could you post all directories and command line for linking with your application?

  3. I never answered your PS comment initially. My recommendation for compiling stuff is that your main application has a clear separation of used libraries and the application libraries.

app: app.o
    $(FC) -o app app.o $(LIBS)

FDICT_PATH = /path/to/fdict/parent
FDICT_LIBS = -L$(FDICT_PATH) -lfdict
FDICT_INC = -I$(FDICT_PATH)

INCLUDE += $(FDICT_INC)
LIBS += $(FDICT_LIBS)

In this way all paths from different sub-projects are clearly separated. I hope this clarifies

from fdict.

hkp888 avatar hkp888 commented on May 26, 2024

Sorry for the delay. I could only get back to this post now.

The way I've been trying to link is with the lines below in a file called build.sh located in my application directory (/project/). The library directory fdict-master is inside my Fortran application directory:

#!/bash/bin
FDICT_PATH=/project/fdict-master/
FDICT_LIBS=-L$(FDICT_PATH) -lfdict
FDICT_INC=-I$(FDICT_PATH)

INCLUDE+=$(FDICT_INC)
LIBS+=$(FDICT_LIBS)

ifort -O3 -openmp -c -traceback *.f90 
ifort -O3 -openmp -c -traceback *.F90 
ifort -O3 -openmp -o NU_Trans *.o $(LIBS)

Then I run it with source build.sh

from fdict.

zerothi avatar zerothi commented on May 26, 2024

You should probably do:

#!/bash/bin
FDICT_PATH=/project/fdict-master/
FDICT_LIBS=-L$(FDICT_PATH) -lfdict
FDICT_INC=-I$(FDICT_PATH)

INCLUDE+=$(FDICT_INC)
LIBS+=$(FDICT_LIBS)

ifort -O3 -openmp -c -traceback *.f90 $(INCLUDE)
ifort -O3 -openmp -c -traceback *.F90 $(INCLUDE)
ifort -O3 -openmp -o NU_Trans *.o $(LIBS)

from fdict.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.