Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28386 Discussions

PSXE2018 change to compilervars.bat?

dajum
Novice
809 Views

executing

"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.0.124\windows\bin\compilervars.bat" intel64

under PSXE2018 now results in the current directory being changed from where the command was issued to in my case c:\users\dave\source

Why is this?  Is it possible to get this changed back to not affecting the current directory? This didn't happen in any previous version.

 

0 Kudos
8 Replies
Steve_Lionel
Honored Contributor III
809 Views

I'm not seeing that behavior. Are you typing this command into a command prompt window, or are you using a shortcut?

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\Steve>"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.0.124\windows\bin\compilervars.bat" intel64

Intel(R) MPI Library 2018 for Windows* Target Build Environment for Intel(R) 64 applications
Copyright (C) 2007-2017 Intel Corporation. All rights reserved.

Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
Intel(R) Compiler 18.0 (package 124)

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.16
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Users\Steve>

 

0 Kudos
dajum
Novice
809 Views

Well we did it in code, and also in a command prompt.  Be we did start on the D: in both cases.

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\dave>d:

D:\>"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.0.124\windows\bin\compilervars.bat" intel64

Intel(R) MPI Library 2018 for Windows* Target Build Environment for Intel(R) 64 applications
Copyright (C) 2007-2017 Intel Corporation. All rights reserved.

Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
Intel(R) Compiler 18.0 (package 124)

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.15
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

C:\Users\dave\source>

0 Kudos
Steve_Lionel
Honored Contributor III
809 Views

It doesn't do that for me.

D:\>
D:\>"C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018.0.124\windows\bin\compilervars.bat" intel64

Intel(R) MPI Library 2018 for Windows* Target Build Environment for Intel(R) 64 applications
Copyright (C) 2007-2017 Intel Corporation. All rights reserved.

Copyright (C) 1985-2017 Intel Corporation. All rights reserved.
Intel(R) Compiler 18.0 (package 124)

**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.16
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

D:\>

I can't see any command in the Intel or Microsoft files that would do this.

0 Kudos
mecej4
Honored Contributor III
809 Views

Steve, please see the Visual Studio 2017 batch file <VS17_dir>\Common7\Tools\vsdevcmd\core\vsdevcmd_end.bat

if "%VSCMD_START_DIR%" NEQ "" (
    cd /d "%VSCMD_START_DIR%"
) else (
    if EXIST "%USERPROFILE%\Source" (
        cd /d "%USERPROFILE%\Source"
    )
)

 

0 Kudos
dajum
Novice
809 Views

Is there an easy way to get all the bat files to echo what they are doing?

I haven't modified any of the PSXE files or the VS files.  And I have no clue how it gets to the source folder.

BTW I got a case submitted for the compiler crash this morning.  Took them 3 days to figure out how to let me login.  But no word on the crash yet.

0 Kudos
Steve_Lionel
Honored Contributor III
809 Views

mecej4 wrote:

Steve, please see the Visual Studio 2017 batch file <VS17_dir>\Common7\Tools\vsdevcmd\core\vsdevcmd_end.bat

if "%VSCMD_START_DIR%" NEQ "" (
    cd /d "%VSCMD_START_DIR%"
) else (
    if EXIST "%USERPROFILE%\Source" (
        cd /d "%USERPROFILE%\Source"
    )
)

Huh - I missed that. Fascinating. Sure enough, if there is a Source subfolder of your profile's default directory, the VS2017 setup moves you there. That's not nice.....

0 Kudos
dajum
Novice
809 Views

Steve,

We sort of fixed it by putting the calls to compilervars in a wrapper that saves the current directory and then restores it. It will work, but as you say it's not nice.

Not sure why I have a Source directory either.  I'm guessing MS added it sometime, because I know I didn't. But seems you don't so that is also a puzzle.

Thanks for the help mecej4!

Dave

0 Kudos
mecej4
Honored Contributor III
809 Views

You could fool the vsdevcmd_end.bat script by setting the environment variable VSCMD_START_DIR to ".", i.e., a period, without the quotes, in the Environment Variables control panel of Windows, if you do not fear that doing so will derail something else.

0 Kudos
Reply