Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Linking Problems with icl under cygwin

Scheibe__Patrick
New Contributor I
592 Views

Hi,

we have a software-project here which I try to compile with cygwin. The project used from the start the Intel Compiler, so it is not a convertion problem between g++/vc and Intel. I have our software running on OSX, Linux and Windows (but compiled with IntelC inside a Visual Studio project).

I followed the hints given here and start a cygwin-bash through the Intel-Commandline to get all environment variables. I can sucessfully compile and link the whole program, but when I try to start it I get

  1. an error message saying that .. is required and could not be found and if I put the dll (from the redist directory of VC) beside the executable..
  2. I get something like "could not initialise application properly (0xc0000022)"
  3. I used the dependency walker to check whether I can find out something more. The Walker says I'm missing COREDLL.DLL, MSVCP90.DLL, IESHIMS.DLL and WER.DLL. When I copy the libraries msvcm90.dll, msvcp90.dll and msvcr90.dll fromC:\\WINDOWS\\WinSxS\\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375 into the application, the dep. Walker says the onlyIESHIMS.DLL and WER.DLL are missing.

Maybe it helps when I provide the command-line arguments for the compile-call:

COPTS=/c /Zl /I$(MLINCLUDE) /I "../include" /I "../lib/src/OpenNL2/src/genericNL" /D "__CONSOLE__" /MT /fp:fast /Qopenmp /Qparallel /Oi-

LOPTS= ml32i3m.lib ANN.lib tbb.lib chull.lib fftw3.lib kernel32.lib user32.lib gdi32.lib /Qparallel /Qopenmp /fp:fast /link /LIBPATH:../lib/Windows /MACHINE:X86 /OUT:dip32.exe /SUBSYSTEM:CONSOLE

I'm sure I can provide additional information if required but can please someone give me hint how to tackle this problem?

Cheers,

Patrick

PS: If someone is interested why I'm using cygwin when I already have a running VS-project: I wan't to have a one-step nightly build for this. This includes svn over ssh, building the project and commiting the application into the repository. If there is somewhere an error I want the script to login on a mail-server and send me a mail with the full output. I had this running for Linux and OSX in less than an hour.. But I'm not a Windows-user, so the best I could think of was to use cygwin where I have all stuff I need. If someone has a better idea how to achieve this behaviour with a VS project... I'm open for any suggestions.

0 Kudos
7 Replies
aazue
New Contributor I
592 Views

Hi,


With my bad our English i have not really exactly understand your problem
If you want work Gnu compiler running BILL operating system , download at this links
This version working very very well
also Msys included , cygwin entire packagel unnecessary.
less performance compared original Linux +/- 5%

http://www.tdragon.net/recentgcc/


Kind regards

0 Kudos
TimP
Honored Contributor III
593 Views

If you run in the same environment where you compiled and linked successfully, there ought to be no problem with visibility of Microsoft dlls, unless you have objects built with different versions of Visual Studio. If you mix objects built with MSVC and ICL, you won't be able to use /fast, and you will need to set /GL- for the VC builds.

Usually, /EHsc or some equivalent is required when compiling C++ source code with VC. You don't give any indication whether you have used ICL throughout.

According to my understanding, tbb and openmp (or parallel) are mutually incompatible, so you should verify whether the application works with just one or the other.

Usually, inability to find dll from the redist directory is associated with turning off manifest in VS build. I'm fighting my own obstacles in that area, so I don't know the solutions.

0 Kudos
Scheibe__Patrick
New Contributor I
593 Views

Hi,

@bustaf: no, sorry, I don't want to work with gcc or BILL operating system (whatever this is).

But I have an update. I created an Visual Studio project and the software compiles fine but doesn't start. Same behaviour, same errors. More or less per accident we tried the created executable on a different machine and it worked.

So it seems it is an issue of the installation of the compilation-computer.

Cheers

Patrick

0 Kudos
Brandon_H_Intel
Employee
593 Views

One thing that looks fishy to me is that you're using /MT, but then msvcp90.dll is being required at runtimewhich is the runtime specified by /MD. Make sure you're not mixing objects or static libs that were built with different C or C++ runtime settings. See the article at http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx for more information.

I am somewhat familiar with getting the compiler to work under Cygwin*, and I don't recall running into this kind of error before, so I don't know what else to suggest. Manifests can be tricky as suggested by a previous poster. Maybe try to get something simple built with the same compiler and linker options so that you can have a baseline "good" build to compare against to try to narrow down on the difference that is causing the problems for you.

0 Kudos
aazue
New Contributor I
593 Views

Hi Patrick

If I understand now ?? you having Icc compiler version Linux installed under Bill system (Bill is diminished for define product O/S Microsoft) with use Cygwin.
I have move several utility linux in in Microsoft for an customer. first i have use Cygwin complete but result several problem (dll) after i have use link dowload that given previous exchange and all result good.
Team of this version Gcc with msys have make very well work.
But I have not install Icc with Msys .

Kind regards


0 Kudos
Scheibe__Patrick
New Contributor I
593 Views

Hi,

@Brandon: yes you are right with the /MT. I was trying different settings since I had hoped I can somehow link all dependencies statically into the executable. But when I tested to switch from /MD to /MT I gave the same COPTs to all source files and it was consitent (and not working).

Last week after I wrote the post, I went through all steps with a friend and at some point he asked whether I really have "everything" installed from Visual Studio. I didn't and we reinstalled Visual Studio completely to have all the .Net crap. Since then I have the really strange behaviour that when compiling through the cygwin-shell, the process stops and hangs.

Checking the task manager shows that mcpcom.exe is running without doing something. Killing this process and you get your bash back but I can no longer test compiling. Maybe this is related to Issue DPD200139895 here:

http://software.intel.com/en-us/articles/intel-professional-edition-compilers-111-fixes-list/

(I cannot create html-links)

I have only Intel Compiler 11.0 installed there. So until I get the new version there's not really much I can do.

@tim18:

I know this all sounds really strange but let me first emphasise that: The machine where I'm testing is a virtual XP (some kind of sandbox in university) which is set up completely new and has nothing installed beside cygwin, Visual St. and the Intel C.

I compiled everything with the Intel Compiler and didn't mix Visual Studio compiles and icl compiles. Additionally, we are using openmp and tbb several years together without any problems since inside the code we use either openmp or tbb, but never together inside a function. The program compiles and runs fine on Linux, OSX and Windows. The only thing that changed now is, that I wanted to use an XP which is reacheable all the time to automatically build the stuff from svn. For this purpose I asked our administrator whether I can have a server-like XP with VPN-login, etc etc.

@bustaf: I cannot use some other compiler. We have an image-processing library which uses heavily the TBB and OpenMP.

@All: Thank you all for your comments. Originally, I wrote here since I'm far away from beeing experienced in VS and Bill-OS and I thought I had done a really stupid obvious mistake. I'll wait until I get the new Intel Compiler 11.1 and hope that then the mcpcom issue is solved or (if not) I have reinstalled everything.

Anyway, I will post the progress here.

Cheers and many thanks,

Patrick

0 Kudos
Scheibe__Patrick
New Contributor I
593 Views
Hi,

finally I want to give some hints:

Situation: I have code which compiles fine under Linux and OSX with usual Makefiles. I need to compile it as automatically as possible for Windows.

Final solution:

  • use CMake, which is a generator for many build-systems. It can create Makefiles, VS Projects, Eclipse Projects, CodeBlocks Projects, etc.. So you don't write Makefiles manually but you write configuration files for CMake defining how to build your application. Then you call cmake with some generator: normal Makefiles for Linux and OSX and NMake Makefiles for Windows.
  • Use powershell under Windows and combine this with the iclvars.bat to ensure that the shell has all required paths. I made a shortcut with the command C:\\WINDOWS\\SysWOW64\\cmd.exe /E:ON /V:ON /K ""d:\\Program Files (x86)\Intel\\Compiler\\11.1\\060\\bin\\iclvars.bat" intel64 & %SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\powershell.exe";
  • If you wrote your CMakeLists.txt right, the only thing to do is to call cmake -G "NMake Makefiles" and finally nmake.
There are some small traps but they are solved quickly. For instance you have to distinguish the way you give cflags and linker opts since under Windows something like -parallel becomes /Qparallel. And you should be aware that you want to define NOMINMAX if you have class-member-functions which are named min or max. Otherwise you get a really stupid error message since the already defined min and max are macros.

So far. After fiddeling 4 days trying to create a vs-project with cmake which runs fine the final solution with NMake required only 30 min. I saw it, tried it and it worked perfectly.

Thanks again for all the help,
I hope this gives something back.

Cheers
Patrick
0 Kudos
Reply