Comments (9)
As always with fortran, don't mix compilers where you are using modules.
I.e. compile fdict with intel compiler.
from fdict.
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.
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.
Thank you, Nick.
-
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
-
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.
Which version of the Intel compiler are you using?
from fdict.
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.
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.
-
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. -
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?
-
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.
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.
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)
- Overload the operator(=), to interface the assign and associate functions HOT 5
- Can't get it to work HOT 3
- How to implement in an example HOT 4
- Creating the dictionary from a read file HOT 5
- Add c_ptr, c_funptr to variable and dictionary HOT 1
- please provide a pkgconfig HOT 2
- Memory leak when overwriting entries from concat
- README.md clarification/enhancement HOT 4
- problem with install HOT 20
- Compilation error with CRAY compiler HOT 3
- interface which to query contained type field HOT 1
- document cmake building instructions HOT 1
- Fails to build with `ninja-build` HOT 2
- Make project compatible with `FetchContent` HOT 6
- Clarify the api HOT 2
- Using plain C preprocessor instead of fypp? HOT 7
- CI tools HOT 4
- Strongly typed dictionaries HOT 7
- having error in compiling siesta-master HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fdict.