datetime-fortran
datetime-fortran copied to clipboard
Building with autotools (not all libs are copied)
Hello, and HUGE thanks for your enormous effort. Now datetime operations in FORTRAN have stopped being a nightmare! :+1: One weird thing I'd like to highlight though. Building with autotools:
./configure --prefix=/path/to/folder
make
make install
at the make install
stage the only datetime_module.mod
is actually copied in the destination include folder. That is not enough to link datetime.
Fast solution: manually copy all *.mod files from src/lib
to /path/to/folder/include
.
The issue is probably OS related. I'm using CentOS7, ifort-19.
I tried this and couldn't reproduce on my Ubuntu 18.10. I'm not experienced with autotools, maybe @tcanich will have an idea.
Weird... Have just tried on my Mac -- the same result. I did:
wget https://github.com/wavebitscientific/datetime-fortran/releases/download/v1.6.0/datetime-fortran-1.6.0.tar.gz
FC=ifort ./configure --prefix=/opt/datetime-fortran-1.6.0
make
make check
sudo make install
All went smoothly but there is only datetime_module.mod in the include folder. So I had to cp other *.mod files from src/lib/ again. I'm not an expert in autotools as well. That's why I couldn't fix it by myself. Anyway, it's not a big deal :) Thanx again!
Is there anything in your lib folder, /opt/datetime-fortran-1.6.0/lib
?
Yes:
ls /opt/datetime-fortran-1.6.0/lib/
libdatetime.a pkgconfig
Hi,
I think I see the problem in src/lib/Makefile.am, nodist_include_HEADERS on line 1 restricts this to only install datetime_module.mod. @milacurcic I've sent a pull request ca18d40 with a fix which installs all of the headers. I don't have a machine here with a suitable combination of autotools and Intel compiler, but this should work...
Tom
Thanks, Tom, I will try it.
Alexander: I'm sorry, I read your original message but somehow my brain went somewhere else. I also get only datetime_module.mod in the include directory. However, I struggle reproducing this:
That (datetime_module.mod) is not enough to link datetime.
Can you give an example program that needs any other module than datetime_module.mod?
Thank you, Tom!
Milan, It was early morning when I was writing that. Apologize :)
I meant that having the datetime_module.mod only in the include folder makes compiling FORTRAN code with use datetime_module
impossible.
But if I copy all *.mod files from src/lib to the include -- everything compiles and works perfectly.
Got it, but I'm saying for me I can build with just datetime_module.mod, with gfortran.
I just tried with ifort and indeed I can't, just like you. This looks like an Intel-specific issue, however from the top of my head, I don't know whether the GNU or the Intel behavior is standard conforming. I will do some research.
Anyway, for now, it doesn't hurt for now to copy all .mod files to make ifort happy.
Agreed. It doesn't ;) Maybe it's related to shared/dynamic compilation but I couldn't find this option in configure.