Execution problem with VS 2010

Execution problem with VS 2010

Ritratto di Clay Breshears (Intel)

I'm trying to build and run the CnC Samples included with the 0.6 installation. I'm using Visual Studio 2010 on a Windows Server 2008 R2 Enterprise system. The samples build fine, but when I attempt to run the executables they don't even get started. From the command line, I get an error that says the cnc_debug.dll file is not present (it is) and reinstalling the package might help. Placing the needed CnC DLL file in the execution directory doesn't fix this, either.

Running the apps from within VS under Debug, I get the message that 3 DLLs (ntdll, kernel32, and another)in the c:\\Windows\\SysWOW64 directory (or their PDB files) can't be found. The DLL files are present in that directory.

I've tried both Debug and Release builds, but am having no luck with execution. Are there some environment variables that aren't set correctly? Is the Windows OS version supported? (I've tried installing on my Win7 machine and it won't even attempt to install.)

Any help or advice would be most appreciated.

--clay

12 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Chih-ping Chen (Intel)

Hi Clay,

Did you use the CnC script "setenv__vs2010.bat -vs" to start your VS? If not, please give that a try.

-Chih-Ping

Clay, Sorry for your troubles and thanks for the report.

Using VS2010 should work.

First, since you're running on Windows Server, you'll want to make a copy of the Samples directory that is part of the CnC distribution (since \Program Files (x86) is not a writable directory). Copy the Samples directory intoa writable work area.

To get the Windows environment configured correctly and launchVisual Studio 2010, perform these steps:

Open a command prompt window, cmd.exe
cd into the CnC 0.6 installation directory
Launch Visual Studio 2010 using this command
setenv_intel64_vs2010 -vs

This will set your environment correctly so that the dll's can be found when the sample is executed.

It is also necessary to modify the VSproject to supply command line arguments e.g. for "Fib", to compute fibonacci of 10, modify the Properties>Debugging>Command Arguments field to contain the value 10

BTW I have CnC 0.6 vs2010 operating successfully on my Win7 laptop.

--Melanie

Ritratto di Clay Breshears (Intel)

Melanie & Chih-peng -

Thanks for the advice. I had not tried setting the environment and launching VS from the CnC directory, but it isn't helping. The architecture is X86, so I'm starting Visual Studio with the IA32 batch file and using the Win32 solution platform configuration to build and link (the 'x64' configuration won't link). I'm still getting the file errors as before (see below). One good point, though, the cnc.dll is being found at runtime.

Errors seen:

'primes.exe': Loaded 'C:\Users\user05\Desktop\primes\primes\Release\primes.exe', Symbols loaded.
'primes.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'primes.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'primes.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'primes.exe': Loaded 'C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Bin\ia32\vc10\cnc.dll', Symbols loaded.
The program '[5756] primes.exe: Native' has exited with code -1073741701 (0xc000007b).

I've tried using the simple Command Prompt window and both the IA32 and Intel 64 Visual Studio 2010 Command Prompt modes with the same results.

After running the setenv batch file in a command window, running the executable from the command line yields the same error as when running from within Visual Studio. It's finding the CnC libraries, but gets hung up on the SysWOW64 directory library files, which seems odd for a Win32 built executable.

--clay

Ritratto di Clay Breshears (Intel)

Quoting Melanie Blower (Intel)BTW I have CnC 0.6 vs2010 operating successfully on my Win7 laptop.

--Melanie

Just tried to reinstall and ran up against a message that says I don't have sufficient privilege to install in the standard directory. I'll see if I can get that "bug" fixed and try again.

--clay

On my win7 laptop, I use "setenv_ia32_vs2010.bat -vs" to launch vs2010

When I use Vs2010 to build and debug the primes project, I get messages similar to yoursin my Output window,

'primes.exe': Loaded 'C:\Users\mblower\Samples\VS2010\primes\primes\Debug\primes.exe', Symbols loaded.

'primes.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file

'primes.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file

'primes.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file

'primes.exe': Loaded 'C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Bin\ia32\vc10\cnc_debug.dll', Symbols loaded.

'primes.exe': Loaded 'C:\TBB\tbb30_018oss\bin\ia32\vc10\tbb_debug.dll', Symbols loaded.

'primes.exe': Loaded 'C:\Windows\SysWOW64\msvcp100d.dll', Symbols loaded.

'primes.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.

'primes.exe': Loaded 'C:\TBB\tbb30_018oss\bin\ia32\vc10\tbbmalloc_debug.dll', Symbols loaded.

However, this doesn't cause an execution error. BTW, the ".pdb" files are Microsoft symbolic debug info files. Since ntdll.dll is a system file, it'sokay that debug information wouldn't be available.

Be sure to modify the Visual Studio primes projectDebug properties "command argument" to specify the invocation parameters. For example, setting"-v 25" will compute and print the prime numbers between 1 and 25.

If you run from visual studio, the output window closes before you can view the results, you need to set a breakpoint at the closing curly brace of the main program. You could also try "Debug>Step into" to start and step through the program.

--Melanie

Ritratto di Clay Breshears (Intel)

Quoting Melanie Blower (Intel)BTW, the ".pdb" files are Microsoft symbolic debug info files. Since ntdll.dll is a system file, it'sokay that debug information wouldn't be available.

D'oh! Now that I read the "error" closer, I see that it really isn't an error on these files.

Even so, I'm still unable to get the executable to start (with command line arguments set). I can set a break-point at the first executable line of the code or the first declaration and still get the error. (There is a dialog box that pops up saying "The application was unable to start correctly (0xc000007b)." The serial version of the code builds and runs whether VS is started from the CnC environment or not.

Since this isn't the files (as I first thought), there must be something else going on related to CnC. I should see if the error code given might be of some help.

--clay

The error message "application was unable to start" often occurs when there's a missing dll in the search path. Comparing your Output messages to mine, I see that there's no report of the tbb dll being successfully loaded. Windows CnC 0.6 requires TBB 3.0 installation. The "getting started" guide describes how to do that, and also if you are using Parallel Studio 2011 you may already have it in your path.

(BTW we know that the CnC install is difficult and we have a goal of bundling TBB into future distributions to ameliorate the difficulty)

The bat file setenv_ia32_vs2010.bat checks that TBB30_INSTALL_DIR is set, and should issue an error message if that environment variable hasn't been established. These are the messages I get when I run setenv_ia32_vs2010.bat :

CNC_INSTALL_DIR=C:\Program Files (x86)\Intel\Concurrent Collections\0.6\
Setting environment for using Microsoft Visual Studio 2010 x86 tools.
Setting environment for Intel TBB by:
adding C:\TBB\tbb30_018oss\Include to INCLUDE
adding C:\TBB\tbb30_018oss\Lib\ia32\vc10 to LIB
adding C:\TBB\tbb30_018oss\Bin\ia32\vc10 to PATH
Setting environment for Intel CnC by:
adding C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Include
to INCLUDE
adding C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Lib\ia32\vc10
to LIB
adding C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Bin\ia32\vc10
to PATH
setup completed

From cmd.exe command prompt, you can view the environment settings via "set > env.txt". There should be a value for TBB30_INSTALL_DIR

Also, I noticed a bug. If you use cmd.exe, setenv_ia32_vs2010.bat, and try to run "cnc" from the command line, the path isn't set up properly to find theCnC translator. :( I'll file a bug report about that.

Perhaps you could send the output messages from running setenv_ia32_vs2010.bat, and also include your environment settings (set > env.txt)

On my system,I have TBB30 available in 2 places. Both from a direct download, and from installing Parallel Composer, and my CnC primes.exe executescorrectly with either.

Ritratto di Clay Breshears (Intel)

Here's what I get from the setenv_ia32_vs2010.bat:

C:\Program Files (x86)\Intel\Concurrent Collections\0.6>setenv_ia32_vs2010.bat

CNC_INSTALL_DIR=C:\Program Files (x86)\Intel\Concurrent Collections\0.6\

Setting environment for using Microsoft Visual Studio 2010 x86 tools.

Setting environment for Intel TBB by:

adding C:\Program Files (x86)\Intel\ComposerXE-2011\tbb\Include to INCLUDE
adding C:\Program Files (x86)\Intel\ComposerXE-2011\tbb\Lib\ia32\vc10 to LIB
adding C:\Program Files (x86)\Intel\ComposerXE-2011\tbb\Bin\ia32\vc10 to PATH

Setting environment for Intel CnC by:
adding C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Include to INCLUDE
adding C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Lib\ia32\vc10 to LIB
adding C:\Program Files (x86)\Intel\Concurrent Collections\0.6\Bin\ia32\vc10 to PATH

setup completed

I would have expected the serial version to have problems if the TBB include and library paths were not set correctly (since that code uses the tick_count facility).

The CnC and TBB environment variables seem to be set correctly:

CNC_INSTALL_DIR=C:\Program Files (x86)\Intel\Concurrent Collections\0.6\
TBB30_INSTALL_DIR=C:\Program Files (x86)\Intel\ComposerXE-2011\tbb

I had the systems admin uninstall and reinstall the package since Parallel Studio XE was installed after my installation of CnC. Still the same results when attempting to execute CnC apps.

The platform I've been trying to install on doesn't have Visual Studio 2008, so the Graph Builder was not able to install. Could this be the root of the problem?

I've got my Win7 laptop to install CnC and things work just fine on it. (It does have VS2008.) User error to blame for that one.

--clay

If it is a dll dependency issue, this tool may be of help: http://www.dependencywalker.com/

The absence of VS2008 on your servershouldn't cause an issue. (Graph Builder is an optional,GUI oriented way to create the CnC spec)

Ritratto di Clay Breshears (Intel)

Using the tool, the file missing seems to be MSVCR90.DLL, the ia32 version. The x64 version is found (along with the x64 TBB libraries). I found a copy and added the path to the PATHvariable.

Then the tool only gives me these two errors (which were included in the original list):

Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.

Error: Modules with different CPU types were found.

I understand the second one, but the first one has me baffled. Looking through the module download ordering within the tool, I see some indication that there may be problems with TBB and VTune from within Parallel Studio XE that is installed on the system. I'm not sure if this might be because of one or both of the errors listed above.

Hi Clay,
Thanks for allowing me access to your system. I was able to debug the problem.When the CnC application starts, it cannot find the tbb dll's.This is how you can fix the problem:Open a command window, cmd.exe, and execute these two commands:

c:\Program Files (x86)\Intel\ComposerXE-2011\tbb\bin\tbbvars.bat ia32 vs2010c:\Program Files (x86)\Intel\Concurrent Collections\0.6\setenv_ia32_vs2010.bat -vs

The first command sets up the TBB3.0 environment variables, and the second command sets up the CnC environment variables and launches visual studio. If you don't want to launch visual studio, just leave off the "-vs" argument. It's on our to-do list to improve the CnC installation to bundle with a compatible version of TBB.Best regards, MelanieBTW here's a useful way to list the dll's that are loaded by an application (from windows command prompt)

dumpbin /DEPENDENTS primes.exe

Accedere per lasciare un commento.