Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
공지
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.

assume nounderscore + getcwd

crkkos
초급자
1,152 조회수
i have a 1024 character.

i call int x = getcwd(DIR)

dir = "/home/mydirectory/"

If i run the same code, the only difference is, i use the assume nounderscore flag,

dir = "home/mydirectory " with spaces all the way up to 1024.

Why does the flag make a difference? Is there a way i can get the assume nounderscore flag,
make it have the spaces just like without the assume nounderscore flag?





0 포인트
5 응답
Steven_L_Intel1
1,152 조회수
My guess is that with assume nounderscore, you're getting a C library version of the routine, rather than the Fortran version. I recommend against using assume nounderscore - use an interface block and BIND(C,NAME="namegoeshere") if you need to call an external routine with non-Fortran conventions.
0 포인트
crkkos
초급자
1,152 조회수
My guess is that with assume nounderscore, you're getting a C library version of the routine, rather than the Fortran version. I recommend against using assume nounderscore - use an interface block and BIND(C,NAME="namegoeshere") if you need to call an external routine with non-Fortran conventions.

im having to use assume nounderscore since its part of a whole library, i just isolated the problem to this. for some reason also, with the assume nounderscore flag, the value returns is non 0, but with the flag it returns 0.
0 포인트
Steven_L_Intel1
1,152 조회수
As I said, you're calling the wrong routine. Try adding USE IFPORT in the routine that calls getcwd.
0 포인트
crkkos
초급자
1,152 조회수
As I said, you're calling the wrong routine. Try adding USE IFPORT in the routine that calls getcwd.

you were right, i traced both version of the code, one with the assume nounderscore and one without it, and looked at the assembly level calls to getcwd, and they were calling different functions. So i added a underscore to the getcwd call and it worked. Thanks Steve, btw, how was japan?
0 포인트
Steven_L_Intel1
1,152 조회수
I suppose that's another way to do it, though it's not what I would recommend. I hope you add a comment explaining it.

Japan was wonderful. Pictures are here - I'm still working on a travelogue.
0 포인트
응답