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

How to revise the Linux Makefile for using it on Windows

1234
Beginner
1,641 Views

 

 

 

Hi, Intel Compiler IT support guys,

I have been using Intel c/C++/Fortran compiler.  Under Linux, I use icl compiler to generate a static library of Scotch graph C code application.

Here is the makefile and under linux there is no problem and the static library is generated. but I want to generate a static library under Windows, could you tell me how to  revise this makefile so that it can be used on windows by the intel C compiler icl? I tried to do it several times but I failed. I look forward to your help and reply. Your reply will be highly appreciated.

 

My makefile used on Linux platform  is attached and please see it for details.

 

 

 

 

 

 

 

 

 

0 Kudos
9 Replies
1234
Beginner
1,637 Views

the file attached is the revised makefile I used on Windows.  Is there something wrong with it? Please tell me your ideas. thanks in advance.

0 Kudos
GouthamK_Intel
Moderator
1,623 Views

Hi,

Could you please let us know what are errors you are facing while using Windows Makefile?

Also, please share the source code and error logs so that it will help us to investigate more.


Regards

Goutham


0 Kudos
1234
Beginner
1,621 Views

Thanks indeed for your reply.

 On Windows platform, the makefile syntax is different from it on Linux. I revised the makefile used on Linux so that it is able to run on windows via nmake command. the following error occurred and  please see it:

D:\scotch_6.0.10wgraph2\src\libscotch>nmake

Microsoft (R) Program Maintenance Utility Version 14.16.27032.1
Copyright (C) Microsoft Corporation. All rights reserved.

NMAKE : fatal error U1073: don't know how to make '%.c'
Stop.

my revised makefile used on Windows is attached and please see it for details.

.........

CCS = icl
CFLAGS = /O3 /DCOMMON_RANDOM_FIXED_SEED /DIDXSIZE64

...............

%$(OBJ) : %.c
$(CCS) $(CFLAGS) $(CLIBFLAGS) /c $(<) /Fo $(@) /DSCOTCH_VERSION_NUM=$(VERSION) /DSCOTCH_RELEASE_NUM=$(RELEASE) /DSCOTCH_PATCHLEVEL_NUM=$(PATCHLEVEL)

%$(EXE) : %.c
$(CCS) $(CFLAGS) /DSCOTCH_VERSION_NUM=$(VERSION) /DSCOTCH_RELEASE_NUM=$(RELEASE) /DSCOTCH_PATCHLEVEL_NUM=$(PATCHLEVEL) $(<) /Fe $(@) $(LDFLAGS)

 

%.c is not recognized in the makefile on Windows.

 

Could you tell me if there is any error in my makefile_win? what's difference in syntax between Linux Makefile and Windows Makefile?  I look forward to hearing from you again.

 

Thanks again and have a good day,

 

 

 

 

 

 

 

 

 

 

0 Kudos
GouthamK_Intel
Moderator
1,602 Views

Hi,

Could you please provide source code or the link from where I can download the code so that we can investigate more on the issue you are facing.


Regards

Goutham


0 Kudos
1234
Beginner
1,594 Views
0 Kudos
1234
Beginner
1,588 Views

Hi, Goutham,

Thanks indeed for your reply.

I partition the source codes into 3 parts due to its size exceeding the maximum size allowed. All theses 3 files are attached.  Please use 7-Zip to uncompress these 3 *.zip files on Windows and them merge all files into one directory on both Linux and Windows. Then you may run ' make' to see it works well under Linux. On Windows you may use the Makefile_win uploaded in last reply to run 'nmake' to see it does not work well.

I look forward to your help and your help is really appreciated.

Have a good day,

Best regards,

Dingjun

 

0 Kudos
1234
Beginner
1,583 Views

Hi, again, Goutham,

Please also install flex and bison under Linux and win_flex and win_bison on windows in order to run 'make' or 'nmake' command. these are free software and you may download them on the website googled.

Thanks again,

Dingjun

 

0 Kudos
GouthamK_Intel
Moderator
1,555 Views

Hi,

Thanks for providing the source code!

Since this forum is for Intel Compiler related issues and looks like your issue is related to Makefile migration.

Therefore, we are making this thread as a community so that others can help you regarding this issue.

 

Also, please refer to the below example where both Linux Makefile and Windows Makefile exist for the same application.

https://github.com/oneapi-src/oneAPI-samples/tree/master/DirectProgramming/DPC%2B%2B/DenseLinearAlgebra/vector-add

Intel will no longer respond to this thread.

Please raise a new thread for any further assistance from Intel.

Have a Good day!

 

Regards

Goutham

0 Kudos
RahulV_intel
Moderator
1,533 Views

Intel will no longer monitor this thread. However, this thread will remain open for community members to participate.


0 Kudos
Reply