Comments (10)
should be
utctime=datetime(year=2013,month=1,day=1)
but won't compile anyway
from datetime-fortran.
This compiler message usually implies that the calling signature in the constructor call does not match its interface. And because it doesn't, the compiler tries to default structure constructor, which doesn't work because components are declared private
.
This program compiles OK for me:
program test
use iso_fortran_env, only: real64
use datetime_module, only: datetime, timedelta
implicit none
type(datetime) :: utctime
utctime = datetime(2013, 1, 1, tz=-5._real64)
utctime = datetime(year=2013, month=1, day=1)
utctime = datetime(2013, 1, 1)
end program test
but tested with ifort 18:
$ ifort -V
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.128 Build 20170811
Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
I don't have v17 at hand so I can't test it right now.
Be extra careful when passing tz
argument to the constructor, as of right now, it has to match the real64
kind size:
utctime = datetime(2013, 1, 1, tz=-5._real64)
from datetime-fortran.
made some progress after added
use iso_fortran_env, only: real64
and corrected tz
with Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 18.0.0.128 Build 20170811
Still this error because of some mp stuff
test.o: In function MAIN__': test.f90:(.text+0x63): undefined reference to
mod_datetime_mp_datetime_constructor_'
from datetime-fortran.
OK, it looks like all that is left is to link to datetime properly:
ifort test.f90 /path/to/datetime/libdatetime.a -ldatetime
from datetime-fortran.
I have that, it is some odd issue
ifort -c -L/apps/codes/datetime-fortran/build/lib -ldatetime -I/apps/codes/datetime-fortran/build/include test.f90
from datetime-fortran.
What does ifort say?
from datetime-fortran.
ifort 18 compiles fine except some problem with linking to the library that is being sorted out (may be related to mpi ifort on my computer)
ifort 17 fails like below
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.5.239 Build 20170817
PROGRAM test
USE iso_fortran_env, ONLY: real64
USE datetime_module, ONLY: datetime, timedelta
IMPLICIT NONE
TYPE(datetime) :: utctime
INTEGER :: i,j
utctime=datetime(year=2013,month=1,day=1,tz=-5._real64)
utctime=datetime(2013,1,1)
! utctime=utctime%utc()
END PROGRAM test
USE datetime_module, ONLY: datetime, timedelta
------^
test.f90(8): error #6406: Conflicting attributes or multiple declaration of name. [DATETIME]
TYPE(datetime) :: utctime
-------^
test.f90(12): error #6404: This name does not have a type, and must have an explicit type. [UTCTIME]
utctime=datetime(year=2013,month=1,day=1,tz=-5._real64)
--^
test.f90(12): error #6406: Conflicting attributes or multiple declaration of name. [DATETIME]
utctime=datetime(year=2013,month=1,day=1,tz=-5._real64)
----------^
test.f90(13): error #6406: Conflicting attributes or multiple declaration of name. [DATETIME]
utctime=datetime(2013,1,1)
----------^
test.f90(4): error #6580: Name in only-list does not exist. [DATETIME]
USE datetime_module, ONLY: datetime, timedelta
-----------------------------^
test.f90(4): error #6580: Name in only-list does not exist. [TIMEDELTA]
USE datetime_module, ONLY: datetime, timedelta
---------------------------------------^
compilation aborted for test.f90 (code 1)
from datetime-fortran.
I need to check it again fort ifort 17, will try again later and post errors
from datetime-fortran.
I figured the problem. intel 17 and 18 will both compile. If I can I would suggest one extension to the library in terms of generic functions: it would be beneficial to code datetime so it works with
datetime(year=2013,month=1,day=1,tz=-5._real64),
datetime(year=2013,month=1,day=1,tz=-5.), etc. i.e. tz as a real or an integer.
Thanks for your patience.
from datetime-fortran.
It would be straightforward to make the constructor generic to allow various kinds for tz
argument. But this would increase the code size considerable for a feature with such small surface area. Unless there are more requests for it I'm not inclined to make it generic.
from datetime-fortran.
Related Issues (20)
- Document building with cmake and autotools HOT 1
- Define output (write) methods for datetime and timedelta instances HOT 1
- strptime does not handle errors HOT 1
- Cannot set seconds or others of timedelta HOT 3
- strptime does not zero tm struct before calling c_strptime HOT 1
- Very strange (possibly compiler) bug with date2num HOT 3
- incorrect literal with REAL64 kind HOT 8
- add support for mingw HOT 1
- Can't build tests on win-ifort. Fails on linker with strptime HOT 4
- "undefined reference" when using datetime-fortran HOT 7
- Building with autotools (not all libs are copied) HOT 9
- Dealing with huge timedelta values HOT 5
- Generic procedure including a sub-class of TimeDelta HOT 3
- Bug in function now() HOT 2
- Strptime Undefined Reference Error HOT 7
- Hour comparison in num2date is incorrect HOT 2
- Function that ingests ISO format and returns datetime? HOT 1
- CMake uses different compiler flags to autotools HOT 6
- Processing of `secondsSinceEpoch` and its reverse processing routine. 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 datetime-fortran.