- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
GETLOG produces nothing on Linux when stdin is redirected.
$ cat main.f90
!===============================================================================
PROGRAM MAIN
USE IFPORT
CHARACTER(16) :: user
CALL GETLOG(user)
PRINT *, "User: ",user
END
!===============================================================================
$ ifort main.f90
$ ./a.out
User: fanning
$ ./a.out < /dev/null
User:
$ ifort -V
Intel(R) Fortran Compiler XE for applications running on IA-32, Version 15.0.5.223 Build 20150805
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
Also fails under:
Intel(R) Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.5.223 Build 20150805
Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thank you for your post. I will look into this.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thank you again for reporting this and for the convenient reproducer. Turns out this is reproducible on IA32 Linux only. I submitted this to Development for investigation/repair.
(Internal tracking id: DPD200377513)
(Resolution Update on 05/26/2016): This defect is fixed in the Intel® Parallel Studio XE 2016 Update 3 Release (ifort Version 16.0.3.210 Build 20160415 - PSXE 2016.3.067 / CnL 2016.3.210- Linux)
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Glad it's being looked into. However I do see it on both ia32 and intel64. Hopefully the fix will apply to both.
Thanks!
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I see you noted that but I cannot reproduce this on intel64 even having tried multiple compilers. I will add a note in the internal tracking id to ensure Development is aware of your findings and ensure they consider that during their investigation.
What version of Linux do you use with intel64?
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
$ uname -a
Linux <hostname> 2.6.18-406.el5 #1 SMP Tue Jun 2 17:25:57 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
and
$ cat /etc/redhat-release
CentOS release 5.11 (Final)
Let me know if you need other information.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I did a little more experimentation, and the issue may reside within Linux, not Intel Fortran. For example:
$ cat getlogin.cc
#include <iostream>
#include <unistd.h>
int main()
{
std::cout << "Hello, World!" << std::endl;
std::cout << "Login: " << getlogin() << std::endl;
}
$ c++ getlogin.cc
$ ./a.out
Hello, World!
Login: <mylogin>
but
$ ./a.out < /dev/null
Hello, World!
Login: $ (No login presented. Prompt appears here.)
It turns out that when using input redirection, the system call "getlogin" returns NULL.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Appreciate the added details/insight. I'll relay this to Development.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
I confirmed this defect is fixed in the Intel® Parallel Studio XE 2016 Update 3 release available from the Intel® Software Development Products Registration Center (IRC). Thank you for reporting this. The underlying defect with our Fortran compiler did relate to calling getlogin. Also, my confirmation of this fix was on IA-32 only. I was never able to reproduce this on Intel® 64; however, the fix does apply to both.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Thomas,
for portable code I recommend
call getenv ("LOGNAME", user)
instead of GETLOG.
Hope this helps,
Harald
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Or even more portable:
call GET_ENVIRONMENT_VARIABLE("LOGNAME",user)
- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable