[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    Re: [CMake] Unexpected use of "ld" on Windows
From:       Arjen Markus <Arjen.Markus () deltares ! nl>
Date:       2015-02-11 15:33:13
Message-ID: 8CF085736108634681FD03EC36E6A0723D98EF48 () V-EXC-C02 ! DIRECTORY ! INTRA
[Download RAW message or body]

Hello Andreas,



Hm, that has crossed my mind - maybe I should simply rename that particular \
directory. It still seems odd though that this occurs. Anyway, thanks for the \
suggestion. This is simple enough to try ;).



Regards,



Arjen



From: Andreas Pakulat [mailto:apaku@gmx.de]
Sent: Wednesday, February 11, 2015 4:30 PM
To: Arjen Markus
Cc: cmake@cmake.org
Subject: Re: [CMake] Unexpected use of "ld" on Windows

Hi,

On Wed, Feb 11, 2015 at 3:16 PM, Arjen Markus \
<Arjen.Markus@deltares.nl<mailto:Arjen.Markus@deltares.nl>> wrote: Hello,

I am trying to build the Fortran interface to NetCDF4 on Windows, using the Intel \
Fortran compiler and "Nmake Makefiles" as the generator (see \
http://www.unidata.ucar.edu/downloads/netcdf/index.jsp).

I had some trouble getting the first part to build, but that is solved (small issues \
with the code). The second part, which is supposed to build a C library that can be \
called from Fortran, presents a more serious problem: for some reason CMake picks \
parts of another toolchain to build this:

The Makefile contains these lines to compile the sources:
        cd D:\netcdf\netcdf-build-fortran\libsrc
        C:\PROGRA~2\MICROS~3.0\VC\bin\amd64\cl.exe  @<<
 /nologo $(C_FLAGS) $(C_DEFINES) /FoCMakeFiles\ncfortran.dir\fort-attio.c.obj \
/FdD:\netcdf\netcdf-build-fortran\libsrc\ncfortran.pdb -c \
D:\netcdf\netcdf-fortran-4.4.1\libsrc\fort-attio.c

But to build the library it contains:

libsrc\ncfortran.dll: d:\netcdf\netcdf-build\liblib\netcdf.lib
libsrc\ncfortran.dll: libsrc\CMakeFiles\ncfortran.dir\objects1.rsp
        @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --red --bold "Linking \
C shared library ncfortran.dll"  cd D:\netcdf\netcdf-build-fortran\libsrc
        d:\CMake2.8.10.2\bin\cmake.exe -E vs_link_dll \
C:\PROGRA~2\HASKEL~1\201320~1.0\mingw\bin\ld.exe /nologo \
@CMakeFiles\ncfortran.dir\objects1.rsp @<<  /out:ncfortran.dll /implib:ncfortran.lib \
/pdb:D:\netcdf\netcdf-build-fortran\libsrc\ncfortran.pdb /dll /version:0.0 \
/STACK:10000000 /INCREMENTAL:YES /machine:x64  /debug \
d:\netcdf\netcdf-build\liblib\netcdf.lib kernel32.lib user32.lib gdi32.lib \
winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib <<

As you can see, it has picked up a linker (ld.exe) belonging to a completely \
different compiler/package for this step.

I have no idea where this is coming from and how to fix this. Does anyone have any \
suggestions?

Seeing the path to that ld.exe I'm reminded of a problem a colleague recently had. He \
has Haskell installed on his system and either haskell itself or some haskell library \
came with mingw and his PATH ended up including the bin dir of that mingw \
installation. Even if that entry is after the VS compiler CMake apparently chooses to \
pick up the mingw toolchain (or parts of it), so one has to make sure that there's no \
MinGW compiler or linker or other part of the toolchain in any of the directories in \
PATH. At least thats how he resolved the issue.

Andreas
DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain \
confidential and privileged information. If you are not the intended recipient please \
notify the sender immediately and destroy this message. Unauthorized use, disclosure \
or copying of this message is strictly prohibited. The foundation 'Stichting \
Deltares', which has its seat at Delft, The Netherlands, Commercial Registration \
Number 41146461, is not liable in any way whatsoever for consequences and/or damages \
resulting from the improper, incomplete and untimely dispatch, receipt and/or content \
of this e-mail.


[Attachment #3 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<link rel="Stylesheet" type="text/css" media="all" href="mailoffice.css"><style><!--
/* Font Definitions */
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:SimSun;
	panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
	{font-family:"\@SimSun";
	panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
p
	{mso-style-priority:99;
	mso-margin-top-alt:auto;
	margin-right:0cm;
	mso-margin-bottom-alt:auto;
	margin-left:0cm;
	font-size:12.0pt;
	font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
	{mso-style-priority:99;
	mso-style-link:"Balloon Text Char";
	margin:0cm;
	margin-bottom:.0001pt;
	font-size:8.0pt;
	font-family:"Tahoma","sans-serif";}
span.EmailStyle18
	{mso-style-type:personal-reply;
	font-family:"Arial","sans-serif";
	color:#1F497D;}
span.BalloonTextChar
	{mso-style-name:"Balloon Text Char";
	mso-style-priority:99;
	mso-style-link:"Balloon Text";
	font-family:"Tahoma","sans-serif";}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	font-family:"Calibri","sans-serif";}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple" id="notables">
<div class="WordSection1">
<p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Hello \
Andreas,<o:p></o:p></span></p> <p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
 <p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Hm, \
that has crossed my mind &#8211; maybe I should simply rename that particular \
directory. It still seems odd though that this occurs. Anyway,  thanks for the \
suggestion. This is simple enough to try ;).<o:p></o:p></span></p> <p \
style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
 <p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Regards,<o:p></o:p></span></p>
 <p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
 <p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Arjen<o:p></o:p></span></p>
 <p style="margin:0cm;margin-bottom:.0001pt"><span \
style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"><o:p>&nbsp;</o:p></span></p>
 <p class="MsoNormal"><span \
style="font-size:11.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
 <div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" \
style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span \
lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> \
Andreas Pakulat [mailto:apaku@gmx.de] <br>
<b>Sent:</b> Wednesday, February 11, 2015 4:30 PM<br>
<b>To:</b> Arjen Markus<br>
<b>Cc:</b> cmake@cmake.org<br>
<b>Subject:</b> Re: [CMake] Unexpected use of &quot;ld&quot; on \
Windows<o:p></o:p></span></p> </div>
</div>
<p class="MsoNormal"><span style="font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <div>
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-family:&quot;Times \
New Roman&quot;,&quot;serif&quot;">Hi,<o:p></o:p></span></p> <div>
<p class="MsoNormal"><span style="font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> <div>
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-family:&quot;Times \
New Roman&quot;,&quot;serif&quot;">On Wed, Feb 11, 2015 at 3:16 PM, Arjen Markus \
&lt;<a href="mailto:Arjen.Markus@deltares.nl" \
target="_blank">Arjen.Markus@deltares.nl</a>&gt; wrote:<o:p></o:p></span></p> <p \
class="MsoNormal" style="margin-left:4.8pt"><span style="font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;">Hello,<br> <br>
I am trying to build the Fortran interface to NetCDF4 on Windows, using the Intel \
Fortran compiler and &quot;Nmake Makefiles&quot; as the generator (see <a \
href="http://www.unidata.ucar.edu/downloads/netcdf/index.jsp" target="_blank"> \
http://www.unidata.ucar.edu/downloads/netcdf/index.jsp</a>).<br> <br>
I had some trouble getting the first part to build, but that is solved (small issues \
with the code). The second part, which is supposed to build a C library that can be \
called from Fortran, presents a more serious problem: for some reason CMake picks \
parts  of another toolchain to build this:<br>
<br>
The Makefile contains these lines to compile the sources:<br>
&nbsp; &nbsp; &nbsp; &nbsp; cd D:\netcdf\netcdf-build-fortran\libsrc<br>
&nbsp; &nbsp; &nbsp; &nbsp; C:\PROGRA~2\MICROS~3.0\VC\bin\amd64\cl.exe&nbsp; \
@&lt;&lt;<br> &nbsp;/nologo $(C_FLAGS) $(C_DEFINES) \
/FoCMakeFiles\ncfortran.dir\fort-attio.c.obj \
/FdD:\netcdf\netcdf-build-fortran\libsrc\ncfortran.pdb -c \
D:\netcdf\netcdf-fortran-4.4.1\libsrc\fort-attio.c<br> <br>
But to build the library it contains:<br>
<br>
libsrc\ncfortran.dll: d:\netcdf\netcdf-build\liblib\netcdf.lib<br>
libsrc\ncfortran.dll: libsrc\CMakeFiles\ncfortran.dir\objects1.rsp<br>
&nbsp; &nbsp; &nbsp; &nbsp; @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) \
--red --bold &quot;Linking C shared library ncfortran.dll&quot;<br> &nbsp; &nbsp; \
&nbsp; &nbsp; cd D:\netcdf\netcdf-build-fortran\libsrc<br> &nbsp; &nbsp; &nbsp; \
&nbsp; d:\CMake2.8.10.2\bin\cmake.exe -E vs_link_dll \
C:\PROGRA~2\HASKEL~1\201320~1.0\mingw\bin\ld.exe /nologo \
@CMakeFiles\ncfortran.dir\objects1.rsp @&lt;&lt;<br> &nbsp;/out:ncfortran.dll \
/implib:ncfortran.lib /pdb:D:\netcdf\netcdf-build-fortran\libsrc\ncfortran.pdb /dll \
/version:0.0 /STACK:10000000 /INCREMENTAL:YES /machine:x64&nbsp; /debug \
d:\netcdf\netcdf-build\liblib\netcdf.lib kernel32.lib user32.lib gdi32.lib \
winspool.lib  shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib \
advapi32.lib<br> &lt;&lt;<br>
<br>
As you can see, it has picked up a linker (ld.exe) belonging to a completely \
different compiler/package for this step.<br> <br>
I have no idea where this is coming from and how to fix this. Does anyone have any \
suggestions?<o:p></o:p></span></p> <div>
<p class="MsoNormal"><span style="font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> </div>
<div>
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-family:&quot;Times \
New Roman&quot;,&quot;serif&quot;">Seeing the path to that ld.exe I'm reminded of a \
problem a colleague recently had. He has Haskell installed on his system and either \
haskell itself or some haskell  library came with mingw and his PATH ended up \
including the bin dir of that mingw installation. Even if that entry is after the VS \
compiler CMake apparently chooses to pick up the mingw toolchain (or parts of it), so \
one has to make sure that there's no MinGW  compiler or linker or other part of the \
toolchain in any of the directories in PATH. At least thats how he resolved the \
issue.<o:p></o:p></span></p> </div>
<div>
<p class="MsoNormal"><span style="font-family:&quot;Times New \
Roman&quot;,&quot;serif&quot;"><o:p>&nbsp;</o:p></span></p> </div>
<div>
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-family:&quot;Times \
New Roman&quot;,&quot;serif&quot;">Andreas<o:p></o:p></span></p> </div>
</div>
</div>
</div>
</div>
</div>
DISCLAIMER: This message is intended exclusively for the addressee(s) and may contain \
confidential and privileged information. If you are not the intended recipient please \
notify the sender immediately and destroy this message. Unauthorized use, disclosure  \
or copying of this message is strictly prohibited. The foundation 'Stichting \
Deltares', which has its seat at Delft, The Netherlands, Commercial Registration \
Number 41146461, is not liable in any way whatsoever for consequences and/or damages \
resulting from  the improper, incomplete and untimely dispatch, receipt and/or \
content of this e-mail. </body>
</html>



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information \
on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
--===============1015490094==--



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic